~nromdotcom/gemif

ref: 1cf152a81acc4ad82894ce77f883aa30942d4a0a gemif/infra/iam.tf -rw-r--r-- 642 bytes
1cf152a8Norm MacLennan Make protobuf a little happier 1 year, 1 month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
resource "aws_iam_instance_profile" "gemif" {
  name = "gemif-profile"
  role = aws_iam_role.gemif.name
}

resource "aws_iam_role" "gemif" {
  name = "gemif-role"
  path = "/"

  assume_role_policy = <<EOF
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": "sts:AssumeRole",
            "Principal": {
               "Service": "ec2.amazonaws.com"
            },
            "Effect": "Allow",
            "Sid": ""
        }
    ]
}
EOF
}

resource "aws_iam_role_policy_attachment" "gemif_ssm" {
  role       = aws_iam_role.gemif.name
  policy_arn = "arn:aws:iam::aws:policy/service-role/AmazonEC2RoleforSSM"
}