Integrations
AWS Secrets Manager
How to continuously sync your secrets with AWS Secrets Manager.
Prerequisites
- AWS Console Access
- AWS IAM access
- Ability to create IAM roles and Policies
- Ability to access IAM users
Setup
-
Create new AWS policy
- Navigate to the Create New Policy section in the AWS IAM console.
- Switch to the JSON tab.
- Enter the following policy.
{ "Version": "2012-10-17", "Statement": [ { "Sid": "AllowSecretsManagerAccess", "Effect": "Allow", "Action": [ "secretsmanager:GetSecretValue", "secretsmanager:DescribeSecret", "secretsmanager:PutSecretValue", "secretsmanager:CreateSecret", "secretsmanager:DeleteSecret", "secretsmanager:TagResource", "secretsmanager:UpdateSecret" ], "Resource": "*" } ] }
- Optionally provide tags.
- Name your policy as “envsecrets” and hit create.
-
Create an AWS Role
- Navigate to the create role section of the AWS IAM console
- Select AWS account for the Trusted entity type
- Select Another AWS account under An AWS account
- Enter 284838358097 for the Account ID. This is envsecrets’s account ID.
- Under Options check Require external ID
- Enter your organisation ID for the External ID. You can obtain your organisation ID by visiting the organisation settings in your envsecrets dashboard.
- Leave require MFA unchecked
- Attach the “envsecrets” policy you created above.
- Name your role as “envsecrets” and complete the role setup.
- Copy the new role’s ARN.
-
Configuration
- Go to integrations catalog in your envsecrets dashboard and choose “AWS Secrets Manager.”
- On the setup/connection page, enter your AWS region and ARN of the “envsecrets” role you created above and save.
Activation
- Go to the integrations dashboard in your envsecrets organisation and under “AWS Secrets Manager” choose “Sync New Environment With Your AWS Secrets Manager Account.”
- In the page that opens, select your envsecrets project, environment and enter the name with which you wish you save your secret in AWS Secrets Manager.
- Complete and save the form.
Usage
Platform
- Navigate to the environment for which you activated the integration.
- Click on the “Sync” button.
- Choose the ASM Secret to which you want to sync your secrets.
- Approve the sync.
CLI
- Use the command:
envs sync --env [name-of-your-remote-environment]
- Choose the ASM integration.
Once your secrets are synced, it is recommended you go to your ASM Secret and validate the new values.
Every new version of your secret in envsecrets will create a new version of the existing secret in AWS Secrets Manager.