Last active
September 12, 2018 21:19
-
-
Save maguec/c17fdb0eb306b9746c9aa157236fab99 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "region" {} | |
variable "profile" {} | |
provider "aws" { | |
region = "${var.region}" | |
profile = "${var.profile}" | |
version = "~> 1.0" | |
} | |
resource "aws_iam_group" "tf-admins" { | |
name = "tf-admins" | |
path = "/tf-admins/" | |
} | |
resource "aws_iam_user" "tf-chris" { | |
name = "tf-chris" | |
path = "/tf-admins/" | |
} | |
resource "aws_iam_access_key" "tf-chris" { | |
user = "${aws_iam_user.tf-chris.name}" | |
pgp_key = "keybase:maguec" | |
} | |
resource "aws_iam_group_membership" "tf-admins" { | |
name = "tf-admins-group-membership" | |
users = [ | |
"${aws_iam_user.tf-chris.name}", | |
] | |
group = "${aws_iam_group.tf-admins.name}" | |
} | |
resource "aws_iam_group_policy" "tf-admins-policy" { | |
name = "tf-admins-policy" | |
group = "${aws_iam_group.tf-admins.id}" | |
policy = <<EOF | |
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Effect": "Allow", | |
"Action": "*", | |
"Resource": "*" | |
} | |
] | |
} | |
EOF | |
} | |
output tf-chris-id { | |
value = "${aws_iam_access_key.tf-chris.id}" | |
} | |
output tf-chris-secret { | |
value = "\n-----BEGIN PGP MESSAGE-----\n\n${aws_iam_access_key.tf-chris.encrypted_secret}\n-----END PGP MESSAGE-----\n" | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment