In this tutorial you’ll learn the following:
AmazonS3FullAccess policyLogin to AWS and navigate to Identity access management (IAM)
Add userProgrammatic accessAmazonS3FullAccess and this basicly mean that we are allowing any action on any resource related to S3. This is not desired in production as you want to restrict the users access to just the buckets that they work with.Bear in mind that every user you attach to this group will inherit the permissions with AmazonS3FullAccess.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "s3:*",
"Resource": "*"
}
]
}We will use both Access Key ID and Secret access key to access S3 programmatically.
Create a file in your home directory .aws/credential and paste:
Access Key IDSecret access key[default]
aws_access_key_id=AKIAY4Y5NDV5****46ZV6ANC****
aws_secret_access_key=********aws s3api create-bucket --bucket my-bucket123131 --region us-east-1
{
"Location": "/my-bucket123131"
}aws s3 ls
aws s3 sync . s3://my-bucket123131
aws s3 ls s3://my-bucket123131
aws s3api delete-bucket --bucket my-bucket123131
--force flagaws s3 rb s3://my-bucket123131 --force
