awsssm package - github.com/PaddleHQ/go-aws-ssm - Go Packages (original) (raw)
- Variables
- type Parameter
- type ParameterStore
- func (ps *ParameterStore) GetAllParametersByPath(path string, decrypt bool) (*Parameters, error)
- func (ps *ParameterStore) GetParameter(name string, decrypted bool) (*Parameter, error)
- func (ps *ParameterStore) PutSecureParameter(name, value string, overwrite bool) error
- func (ps *ParameterStore) PutSecureParameterWithCMK(name, value string, overwrite bool, kmsID string) error
- type Parameters
This section is empty.
This section is empty.
type Parameter struct { Value *string }
Parameter holds a Systems Manager parameter from AWS Parameter Store
GetValue return the actual Value of the parameter
type ParameterStore struct {
}
ParameterStore holds all the methods tha are supported against AWS Parameter Store
NewParameterStore is creating a new ParameterStore by creating an AWS Session
func NewParameterStoreWithClient(client ssmClient) *ParameterStore
NewParameterStoreWithClient is creating a new ParameterStore with the given ssm Client
GetAllParametersByPath is returning all the Parameters that are hierarchy linked to this path For example a request with path as /my-service/dev/ Will return /my-service/dev/param-a, /my-service/dev/param-b, etc... but will not return recursive paths the `ssm:GetAllParametersByPath` permission is required to the `arn:aws:ssm:aws-region:aws-account-id:/my-service/dev/*`
This will also page through and return all elements in the hierarchy, non-recursively
GetParameter is returning the parameter with the given name For example a request with name as /my-service/dev/param-1 Will return the parameter value if exists or ErrParameterInvalidName if parameter cannot be found The `ssm:GetParameter` permission is required to the `arn:aws:ssm:aws-region:aws-account-id:/my-service/dev/param-1` resource
PutSecureParameter is setting the parameter with the given name to a passed in value. Allow overwriting the value of the parameter already exists, otherwise an error is returned For example a request with name as '/my-service/dev/param-1': Will set the parameter value if exists or ErrParameterInvalidName if parameter already exists or is empty and `overwrite` is false. The `ssm:PutParameter` permission is required to the `arn:aws:ssm:aws-region:aws-account-id:/my-service/dev/param-1` resource
PutSecureParameterWithCMK is the same as PutSecureParameter but with a passed in CMK (Customer Master Key) For example a request with name as '/my-service/dev/param-1' and a `kmsID` of 'foo': Will set the parameter value if exists or ErrParameterInvalidName if parameter already exists or is empty and `overwrite` is false. The `ssm:PutParameter` permission is required to the `arn:aws:ssm:aws-region:aws-account-id:/my-service/dev/param-1` resource The `kms:Encrypt` permission is required to the `arn:aws:kms:us-east-1:710015040892:key/foo`
type Parameters struct {
}
Parameters holds the output and all AWS Parameter Store that have the same base path
NewParameters creates a Parameters
func (p *Parameters) Decode(output interface{}) error
Decode decodes the parameters into the given struct We are using this package to decode the values to the struct https://github.com/mitchellh/mapstructureFor more details how you can use this check the parameter_test.go file
GetAllValues returns a map with all the keys and values in the store.
GetValueByFullPath returns the value based on the full path
GetValueByName returns the value based on the name so the AWS Parameter Store parameter name is base path + name
Read implements the io.Reader interface for the key/value pair