Gists are examples that demonstrate a concept, but are not actively maintained and may not work in your environment or current versions of Atmos without adaptations.
README.md2.2 KB
View on GitHubAWS Declared Secrets
Runnable example for declared secrets backed by AWS SSM Parameter Store and AWS Secrets Manager.
Covers
kind: aws/ssmwithsecret: truekind: aws/asmwithsecret: trueatmos secret set/get/list/validate/delete- instance, stack, and global scopes
!secretconsumption and masked describe output- automatic Terraform
TF_VAR_*injection for secret-bearingvars
Setup
- Replace
REGIONandACCOUNT_IDiniam/secrets-policy.json. - Attach the policy to the AWS identity used by Atmos.
- Configure AWS credentials or an Atmos auth identity.
Set Values
cd gists/aws-secretsatmos secret set SSM_INSTANCE_TOKEN=dev-instance-token -s dev -c secret-consumer --forceatmos secret set SSM_STACK_TOKEN=dev-stack-token -s dev -c secret-consumer --forceatmos secret set GLOBAL_SHARED_TOKEN=shared-token -s dev -c secret-consumer --forceatmos secret set 'ASM_DATABASE_CONFIG={"username":"demo","password":"dev-db-password","host":"db.dev.local"}' -s dev -c secret-consumer --forceatmos secret set SSM_INSTANCE_TOKEN=prod-instance-token -s prod -c secret-consumer --forceatmos secret set SSM_STACK_TOKEN=prod-stack-token -s prod -c secret-consumer --forceatmos secret set 'ASM_DATABASE_CONFIG={"username":"demo","password":"prod-db-password","host":"db.prod.local"}' -s prod -c secret-consumer --force
Use Values
atmos secret list -s dev -c secret-consumeratmos secret validate -s dev -c secret-consumeratmos secret get ASM_DATABASE_CONFIG -s dev -c secret-consumer --path '.password' --mask=falseatmos describe component secret-consumer -s devatmos terraform plan secret-consumer -s dev
Cleanup
atmos secret delete SSM_INSTANCE_TOKEN -s dev -c secret-consumer --forceatmos secret delete SSM_STACK_TOKEN -s dev -c secret-consumer --forceatmos secret delete GLOBAL_SHARED_TOKEN -s dev -c secret-consumer --forceatmos secret delete ASM_DATABASE_CONFIG -s dev -c secret-consumer --forceatmos secret delete SSM_INSTANCE_TOKEN -s prod -c secret-consumer --forceatmos secret delete SSM_STACK_TOKEN -s prod -c secret-consumer --forceatmos secret delete ASM_DATABASE_CONFIG -s prod -c secret-consumer --force