Bitbucket pipeline to launch a docker image from AWS ECR to AWS Elastic Beanstalk

Viewed 43

I've already created a Bitbucket pipeline to build an application image and upload it to AWS ECR.

# Bitbucket pipeline to build an image and upload it to AWS ECR

image: atlassian/default-image:2
pipelines:
  branches:
    master:
      - step:
          caches:
            - docker
          services:
            - docker
          name: Build and Push
          deployment: Production
          script:
            - echo "Build Docker and Push to Registry"
            - docker build -t $AWS_ECR_REPOSITORY .
            - docker inspect $AWS_ECR_REPOSITORY
            - pipe: atlassian/aws-ecr-push-image:1.4.1
              variables:
                AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
                AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
                AWS_DEFAULT_REGION: $AWS_DEFAULT_REGION
                IMAGE_NAME: $AWS_ECR_REPOSITORY

Now I want to create another bitbucket pipeline which can take that image from AWS ECR and deploy that application on AWS Elastic Beanstalk. I'm not sure how to do that.

0 Answers
Related