Click here to Skip to main content
15,886,026 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to Create the following resources using Terraform:

An S3 bucket

An IAM role

An IAM policy attached to the role that allows it to perform any S3 actions on that bucket and the objects in it

An EC2 instance with the IAM role attached

Create a README.md and document all assumptions made. Login to the EC2 instance and validate access to the bucket using the role.

What I have tried:

{
   "Version":"2012-10-17",
   "Statement":[
      {
         "Effect":"Allow",
         "Action": "s3:ListAllMyBuckets",
         "Resource":"arn:aws:s3:::*"
      },
      {
         "Effect":"Allow",
         "Action":["s3:ListBucket","s3:GetBucketLocation"],
         "Resource":"arn:aws:s3:::awsexamplebucket1"
      },
      {
         "Effect":"Allow",
         "Action":[
            "s3:PutObject",
            "s3:PutObjectAcl",
            "s3:GetObject",
            "s3:GetObjectAcl",
            "s3:DeleteObject"
         ],
         "Resource":"arn:aws:s3:::awsexamplebucket1/*"
      }
   ]
}
Posted
Updated 30-Oct-20 1:21am
v2
Comments
[no name] 29-Oct-20 19:35pm    
We're all waiting to hear what happened with "what you tried".
Member 14978977 30-Oct-20 6:57am    
can you help gerry

1 solution

Here is What I have tried so far to


{ "Version":"2012-10-17", "Statement":[ { "Effect":"Allow", "Action": "s3:ListAllMyBuckets", "Resource":"arn:aws:s3:::" }, { "Effect":"Allow", "Action":["s3:ListBucket","s3:GetBucketLocation"], "Resource":"arn:aws:s3:::awsexamplebucket1" }, { "Effect":"Allow", "Action":[ "s3:PutObject", "s3:PutObjectAcl", "s3:GetObject", "s3:GetObjectAcl", "s3:DeleteObject" ], "Resource":"arn:aws:s3:::awsexamplebucket1/" } ] }
 
Share this answer
 
Comments
CHill60 30-Oct-20 7:22am    
By posting this as a solution you have removed your question from the list of unanswered posts, meaning you are less likely to get assistance. I suggest that you delete this. You can add detail to your question using the "Improve Question" link - if it's not visible try hovering your mouse over your question

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900