Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,368,557
Community Members
 
Community Events
168
Community Groups

add Multiple aws account profile

Is there a way to put multiple aws accounts defined in the pipeline . Currently creating a pipeline to deploy aws lambda function to multiple aws accounts as shown below. Already inplaced the corresponding env variables on the repo settings but it still fails. 

 

- step: *build-zip-push
- step:
name: Deploy to DEV
deployment: DEV
script:
- |
export AWS_ACCESS_KEY_ID=$PREPROD_SECRET_KEY
export AWS_SECRET_ACCESS_KEY=$PREPROD_SECRET_KEY
- pipe: atlassian/aws-lambda-deploy:1.1.0
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
ERROR:
✖ Failed to update Lambda function code. Error: An error occurred (IncompleteSignatureException) when calling the UpdateFunctionCode operation: Credential must have exactly 5 slash-delimited elements, e.g. keyid/date/region/service/term, got '$PREPROD_SECRET_KEY/20211012/REGION/lambda/aws4_request'

3 answers

Its better not to use AWS_ACCESS_KEY & AWS_SECRET_ACCESS_KEY. Rather use OIDC settings supported by Bitbucket pipeline: https://support.atlassian.com/bitbucket-cloud/docs/deploy-on-aws-using-bitbucket-pipelines-openid-connect/

 

below works for me:

Screen Shot 2022-08-29 at 2.53.25 pm.png

0 votes

@Paul Quincy  Hi. Thanks for your question. Please provide us with full bitbucket-pipelines.yml file to understand your case more clearly.

Regards, Igor.

0 votes
Ajay _view26_ Community Leader Oct 17, 2021

Hi @Paul Quincy 

 

I use the below pipeline code to update my Lamda 

 

# This is a sample build configuration for Other.
# Check our guides at https://confluence.atlassian.com/x/5Q4SMw for more examples.
# Only use spaces to indent your .yml configuration.
# -----
# You can specify a custom docker image from Docker Hub as your build environment.
image: atlassian/default-image:2

pipelines:
custom:
deploy:
- step:
name: Build and package
script:
- apt-get update && apt-get install -y zip
- zip -r lambda.zip index.js package.json package-lock.json services node_modules
artifacts:
- lambda.zip
- step:
script:
- pipe: atlassian/aws-lambda-deploy:0.5.3
variables:
AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID # Optional if already defined in the context.
AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY # Optional if already defined in the context.
AWS_DEFAULT_REGION: $AWS_REGION # Optional if already defined in the context.
FUNCTION_NAME: $AWS_LAMBDA_FUNCTION_NAME
COMMAND: 'update' # 'alias' or 'update'
# Update variables
ZIP_FILE: 'lambda.zip'

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events