Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package awsutils
- import (
- "fmt"
- "github.com/aws/aws-sdk-go/aws"
- "github.com/aws/aws-sdk-go/aws/session"
- "github.com/aws/aws-sdk-go/service/ssm"
- )
- /*
- GetSMM returns the value from AWS system parameter store
- */
- func GetSMM() {
- // This picks the env variable AWS_PROFILE, and AWS_REGION
- sess := session.Must(session.NewSessionWithOptions(session.Options{
- SharedConfigState: session.SharedConfigEnable,
- }))
- ssmClient := ssm.New(sess)
- getParametersByPathInput := &ssm.GetParameterInput{
- Name: aws.String("/PlatformConfig/your/path/here"),
- WithDecryption: aws.Bool(false),
- }
- param, err := ssmClient.GetParameter(getParametersByPathInput)
- if err != nil {
- panic(err)
- }
- fmt.Printf("The value of the parameter: %s", *param.Parameter.Value)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement