# README
awsutils/secretsmanager
The secretsmanager
package is a collection of utility functions
designed to simplify common secretsmanager tasks.
Table of contents
Functions
CreateConnection()
CreateConnection() Connection
CreateConnection creates a connection with Secrets Manager and returns it.
CreateOrUpdateSecret(*secretsmanager.SecretsManager, string, string, string)
CreateOrUpdateSecret(*secretsmanager.SecretsManager string string string) error
CreateOrUpdateSecret creates a new secret or updates an existing one.
CreateSecret(*secretsmanager.SecretsManager, string, string, string)
CreateSecret(*secretsmanager.SecretsManager, string, string, string) error
CreateSecret creates an input secretName
with the specified secretValue
.
DeleteSecret(*secretsmanager.SecretsManager, string, bool)
DeleteSecret(*secretsmanager.SecretsManager, string, bool) error
DeleteSecret deletes an input secretName
.
It will attempt to do so forcefully if forceDelete
is set to true.
GetSecret(*secretsmanager.SecretsManager, string)
GetSecret(*secretsmanager.SecretsManager, string) string, error
GetSecret returns the value of an input secretName
.
ReplicateSecret(Connection, string, string, []string)
ReplicateSecret(Connection, string, string, []string) error
ReplicateSecret replicates a secret with the specified secretName
to multiple target regions.
UpdateSecret(*secretsmanager.SecretsManager, string, string)
UpdateSecret(*secretsmanager.SecretsManager, string, string) error
UpdateSecret updates an existing secret
Installation
To use the awsutils/secretsmanager package, you first need to install it. Follow the steps below to install via go get.
go get github.com/l50/awsutils/secretsmanager
Usage
After installation, you can import the package in your Go project using the following import statement:
import "github.com/l50/awsutils/secretsmanager"
Tests
To ensure the package is working correctly, run the following
command to execute the tests for awsutils/secretsmanager
:
go test -v
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
License
This project is licensed under the MIT License - see the LICENSE file for details.