Documentation
¶
Overview ¶
Package awscommons contains routines for interacting with AWS. Meant to provide high level interfaces used throughout various Gruntwork CLIs. NOTE: The routines in this package are adapted for aws-sdk-go-v2, not V1.
NewS3Client will return a new AWS SDK client for interacting with AWS Secrets Manager.
Index ¶
- Constants
- func GetSecretsManagerMetadata(opts *Options, secretID string) (*secretsmanager.DescribeSecretOutput, error)
- func GetSecretsManagerSecretString(opts *Options, arn string) (string, error)
- func NewDefaultConfig(opts *Options) (aws.Config, error)
- func NewS3Client(opts *Options) (*s3.Client, error)
- func NewSecretsManagerClient(opts *Options) (*secretsmanager.Client, error)
- func SecretsManagerEntryExists(opts *Options, arn string) (bool, error)
- func UploadObjectString(opts *Options, bucket, key, contents string) error
- type Options
Constants ¶
const (
DefaultRegion = "us-east-1"
)
Variables ¶
This section is empty.
Functions ¶
func GetSecretsManagerMetadata ¶
func GetSecretsManagerMetadata(opts *Options, secretID string) (*secretsmanager.DescribeSecretOutput, error)
GetSecretsManagerMetadata returns the metadata of the Secrets Manager entry with the given ID.
func GetSecretsManagerSecretString ¶
GetSecretsManagerSecretString will return the secret value stored at the given Secrets Manager ARN.
func NewDefaultConfig ¶
NewDefaultConfig will retrieve a new authenticated AWS config using SDK default credentials. This config can be used to setup new AWS service clients.
func NewS3Client ¶ added in v0.10.0
NewS3Client will return a new AWS SDK client for interacting with AWS S3.
func NewSecretsManagerClient ¶
func NewSecretsManagerClient(opts *Options) (*secretsmanager.Client, error)
NewSecretsManagerClient will return a new AWS SDK client for interacting with AWS Secrets Manager.
func SecretsManagerEntryExists ¶
SecretsManagerEntryExists returns whether or not the SecretsManager Entry with the given ARN exists. This will return an error if it exists, but is not accessible due to permission issues, or if there is an authentication issue.
func UploadObjectString ¶ added in v0.10.0
UploadObjectString will upload the provided string to the given S3 bucket as an object under the specified key.
Types ¶
type Options ¶
Options represents all the parameters necessary for setting up authentication credentials with AWS.
func NewOptions ¶
NewOptions will create a new aws.Options struct that provides reasonable defaults for unspecified values.