Terraform module which creates IAM resources on AWS.
These types of resources are supported:
Root module calls these modules which can also be used separately to create independent resources:
- user - creates iam user
- access_key - creates access key to user
- policy - Creates a policy and attach it to user
module "user" {
source = "github.com/javilac/terraform-aws-iam"
user_name = "access-to-s3-examplebucket"
policy_name = "access-to-s3-examplebucket-rw"
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::examplebucket"
]
},
{
"Effect": "Allow",
"Action": [
"s3:List*",
"s3:Get*",
"s3:Put*",
"s3:Delete*"
],
"Resource": [
"arn:aws:s3:::examplebucket/*"
]
}
]
}
EOF
}Module created by Javier Avila.
Apache 2 Licensed. See LICENSE for full details.