aws-samples / amazon-ecs-mythicalmysfits-workshop

A tutorial for developers who want to learn about how to containerized applications on top of AWS using AWS Fargate. You will build a sample website that leverages infrastructure as code, containers, CI/CD, and more! If you're planning on running this, let us know @ aws-mythical-mysfits@amazon.com. At re:Invent 2018, these sessions were run as CON214/CON321/CON322.
Apache License 2.0
335 stars 176 forks source link

Unable to upload S3 artefacts. #37

Open nsubrahm-aws opened 3 years ago

nsubrahm-aws commented 3 years ago

After running the CloudFormation stack, I am running script/setup command. It fails with two errors viz. unable to locate gsed and unable to upload to S3 bucket. See below.

To install gsed, I had to first install brew, brew install gsed and then alias gsed=sed. But, this does not work.

which: no gsed in (/home/ec2-user/.linuxbrew/bin:/home/ec2-user/.linuxbrew/sbin:/home/ec2-user/.nvm/versions/node/v10.23.3/bin:/home/ec2-user/.rvm/gems/ruby-2.6.3/bin:/home/ec2-user/.rvm/gems/ruby-2.6.3@global/bin:/home/ec2-user/.rvm/rubies/ruby-2.6.3/bin:/home/ec2-user/.rvm/gems/ruby-2.6.3/bin:/home/ec2-user/.rvm/gems/ruby-2.6.3@global/bin:/home/ec2-user/.rvm/rubies/ruby-2.6.3/bin:/home/ec2-user/.rvm/gems/ruby-2.6.3/bin:/home/ec2-user/.rvm/gems/ruby-2.6.3@global/bin:/home/ec2-user/.rvm/rubies/ruby-2.6.3/bin:/usr/local/bin:/bin:/usr/bin:/home/ec2-user/.local/bin:/home/ec2-user/bin:/usr/local/bin:/home/ec2-user/.rvm/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/aws/bin:/usr/local/bin:/home/ec2-user/.local/bin:/home/ec2-user/bin:/usr/local/bin:/home/ec2-user/.rvm/bin:/home/ec2-user/.local/bin:/home/ec2-user/bin:/opt/aws/bin:/usr/local/bin:/home/ec2-user/.local/bin:/home/ec2-user/bin:/usr/local/bin:/home/ec2-user/.rvm/bin:/home/ec2-user/.local/bin:/home/ec2-user/bin)
upload failed: ../../../../../tmp/tmp.JS3hWcAhhP/confirm.html to s3://mysfits-fargate-mythicalbucket-1u1bgbgeqd152/confirm.html An error occurred (AccessDenied) when calling the PutObject operation: Access Denied
upload failed: ../../../../../tmp/tmp.JS3hWcAhhP/js/aws-sdk-2.246.1.min.js to s3://mysfits-fargate-mythicalbucket-1u1bgbgeqd152/js/aws-sdk-2.246.1.min.js An error occurred (AccessDenied) when calling the PutObject operation: Access Denied
upload failed: ../../../../../tmp/tmp.JS3hWcAhhP/js/amazon-cognito-identity.min.js to s3://mysfits-fargate-mythicalbucket-1u1bgbgeqd152/js/amazon-cognito-identity.min.js An error occurred (AccessDenied) when calling the PutObject operation: Access Denied
upload failed: ../../../../../tmp/tmp.JS3hWcAhhP/index.html to s3://mysfits-fargate-mythicalbucket-1u1bgbgeqd152/index.html An error occurred (AccessDenied) when calling the PutObject operation: Access Denied
upload failed: ../../../../../tmp/tmp.JS3hWcAhhP/js/aws-cognito-sdk.min.js to s3://mysfits-fargate-mythicalbucket-1u1bgbgeqd152/js/aws-cognito-sdk.min.js An error occurred (AccessDenied) when calling the PutObject operation: Access Denied
upload failed: ../../../../../tmp/tmp.JS3hWcAhhP/register.html to s3://mysfits-fargate-mythicalbucket-1u1bgbgeqd152/register.html An error occurred (AccessDenied) when calling the PutObject operation: Access Denied
n
dcheng commented 3 years ago

Same exact issue

nsubrahm-aws commented 3 years ago

Only way to get this working was to make the S3 buckets public!

gsed message can be ignored because in their script, they default to sed.

meetreks commented 3 years ago

Resolved it my removing the acl command in upload-site folder under workshop1 Just use -- aws s3 sync $TEMP_DIR s3://$BUCKET_NAME