mohammad obaid
mohammad obaid

Reputation: 413

Access denied in bitbucket-s3 deployment

I am trying to create pipeline for my angular project such that when developer push code to develop branch , its build file get auto deployed to s3 bucket . For this I created aws user with following policy

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "s3:*",
            "Resource": "*"
        }
    ]
}

and my atlassian config file as follows

image: node:10

pipelines:
  branches:
   develop:
    - step:
        caches:
          - node
        script:
          - npm install
          - npm install -g @angular/cli
          - ng build --prod
          - ls -ltr
          - cd dist/portalfrontend
          - pipe: atlassian/aws-s3-deploy:0.2.4
            variables:
              AWS_ACCESS_KEY_ID: $AWS_ACCESS_KEY_ID
              AWS_SECRET_ACCESS_KEY: $AWS_SECRET_ACCESS_KEY
              AWS_DEFAULT_REGION: 'ap-south-1'
              ACL: "public-read"
              S3_BUCKET: 'bitbucket-s3-deployment-xxxxxxxx'
              LOCAL_PATH: $(pwd)
        deployment: develop

but still I am getting An error occurred (AccessDenied) when calling the PutObject operation: Access Denied .

Can anyone help me on this issue ?

Upvotes: 4

Views: 1236

Answers (1)

Younghun Jung
Younghun Jung

Reputation: 361

Try to change ACL value from 'public-read' to 'bucket-owner-full-control'

Upvotes: 3

Related Questions