Chirag S Modi
Chirag S Modi

Reputation: 419

AWS code deploy deployment failed with github

I have created a pipeline for code deployment with github, but it is failing at DownloadBundle with Access Denied error.

I have created a role with AmazonEC2FullAccess and AWSCodeDeployRole to the deployment iam and also crated role for ec2 AmazonEC2FullAccess I have attached couple of screenshot for setting of code deployment group also I have placed appspec.yml in the root directory of my repo.

version: 0.0
os: linux
files:
  - source: /
    destination: /var/www/html/
    overwrite: true
file_exists_behavior: OVERWRITE
hooks:
  BeforeInstall:
    - location: scripts/install_dependencies.sh
      timeout: 300
      runas: root
  ApplicationStart:
    - location: scripts/start_server.sh
      timeout: 300
      runas: root

enter image description here enter image description here

Note: I am using Auto scaling

Upvotes: 2

Views: 238

Answers (1)

Can Arda Aydin
Can Arda Aydin

Reputation: 224

For this purpose your EC2 instance has to access S3 as well, check if your EC2 instance has permission to access the related S3 Bucket. Also if you are using KMS for encryption of your bucket, your EC2 instance has to have KMS permissions as well.

Upvotes: 1

Related Questions