I have a code for pushing AWS ECR image and then updating the ECS service with the newly pushed image. Some time in the code the environment variables is passed correctly and sometime not. Not sure why this behaviour is happening. Same code with different behavior. Please help. Please find my code below:
Thank you for your question!
It's a good case for atlassian/aws-ecr-push-image pipe:
- step: oidc: true script: # build the image - docker build -t my-docker-image . # use the pipe to push the image to AWS ECR - pipe: atlassian/aws-ecr-push-image:1.5.0 variables: AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION AWS_OIDC_ROLE_ARN: 'arn:aws:iam::123456789012:role/role_name' IMAGE_NAME: my-docker-image
and atlassian/aws-ecs-deploy pipe:
- step: oidc: true script: - pipe: atlassian/aws-ecs-deploy:1.6.2 variables: AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION AWS_OIDC_ROLE_ARN: 'arn:aws:iam::123456789012:role/role_name' CLUSTER_NAME: 'my-ecs-cluster' SERVICE_NAME: 'my-ecs-service' TASK_DEFINITION: 'task-definition.json'
Bitbucket Pipes support OIDC, more details provided in the Deploy on AWS using Bitbucket Pipelines OpenID Connect guide.
To discover more pipes, visit our Bitbucket Pipes Marketplace.
Best regards,
Oleksandr Kyrdan
Thank you! Oleksandr Kyrdan. Answer is really helpful.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.