Skip to content

Instantly share code, notes, and snippets.

@ericksoen
Created February 26, 2020 04:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericksoen/0bbd6e715ff14f0be05fed8b45e13ce1 to your computer and use it in GitHub Desktop.
Save ericksoen/0bbd6e715ff14f0be05fed8b45e13ce1 to your computer and use it in GitHub Desktop.
provider "aws" {
region = "us-east-1"
}
data "aws_iam_policy_document" "policy" {
statement {
effect = "Allow"
actions = ["s3:CreateBucket"]
resources = ["*"]
}
}
resource "aws_iam_user" "user" {
name = "terraform-user"
}
resource "aws_iam_user_policy" "attach" {
name = "inline-policy"
user = aws_iam_user.user.name
policy = data.aws_iam_policy_document.policy.json
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment