Access AWS secrets manager in Bitbucket pipeline.
Add the following snippet to the script section of your bitbucket-pipelines.yml
file:
- pipe: sykescottages/bitbucket-secrets-manager
FILE: '<string>'
AWS_ACCESS_KEY_ID: '<string>'
AWS_ACCESS_KEY_ID: '<string>'
AWS_SECRET_ACCESS_KEY: '<string>'
AWS_SECRET_NAME: '<string>'
AWS_REGION: '<string>'
AWS_PROFILE: '<string>'
CONFIG: '<string>'
Variable | Usage |
---|---|
FILE | File Name you Wish you save to. (Default .env) |
AWS_ACCESS_KEY_ID (*) | AWS key id. |
AWS_SECRET_ACCESS_KEY (*) | AWS secret key. |
AWS_SECRET_NAME (*) | The name of the secret. |
AWS_REGION (*) | AWS region. |
AWS_PROFILE (*) | The name of the AWS profile. eg default, production, non-prod, staging, dev |
CONFIG | Path to AWS config file eg (s3 restricted access) |
(*) = required variable. This variable needs to be specified always when using the pipe. |
- $AWS_ACCESS_KEY
- $AWS_SECRET_KEY
To use this pipe you should have AWS secrets manager setup.
Example pipe yaml
script:
- pipe: sykescottages/bitbucket-secrets-manager
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_KEY
AWS_SECRET_NAME: sm-s-ew1-project
AWS_REGION: eu-west-1
AWS_PROFILE: staging