I need to create an IAM user with s3 permissions using cloudformation.
I havent found a solution
Use AWS::IAM::User to create the IAM User.
Here's a YAML template that uses Managed Policies:
DeveloperUser:
Type: 'AWS::IAM::User'
Properties:
UserName: user-developer
ManagedPolicyArns:
- 'arn:aws:iam::aws:policy/AWSServiceCatalogEndUserFullAccess'
- 'arn:aws:iam::aws:policy/ReadOnlyAccess'
- 'arn:aws:iam::aws:policy/CloudWatchFullAccess'
- 'arn:aws:iam::aws:policy/AmazonVPCFullAccess'
- 'arn:aws:iam::aws:policy/AmazonS3FullAccess'
Here's a JSON policy that has inline permissions:
"User":{
"Type":"AWS::IAM::User",
"Properties":{
"Policies":[
{
"PolicyName":"S3",
"PolicyDocument":{
"Statement":[
{
"Effect":"Allow",
"Action":[
"s3:*",
],
"Resource":[
"arn:aws:s3:::my-bucket",
"arn:aws:s3:::my-bucket/*"
]
}
]
}
}
]
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With