-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathalks.tf
43 lines (39 loc) · 862 Bytes
/
alks.tf
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
31
32
33
34
35
36
37
38
39
40
41
42
43
#
# PROVIDERS
#
provider "alks" {
url = "https://alks.foo.com/rest"
}
provider "aws" {
region = "us-east-1"
}
# CREATE IAM ROLE
resource "alks_iamrole" "test_role" {
name = "aba-test-123456"
type = "Amazon EC2"
include_default_policies = false
}
# ATTACH POLICY
resource "aws_iam_role_policy" "test_policy" {
name = "test_policy"
role = "${alks_iamrole.test_role.name}"
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"ec2:Describe*"
],
"Effect": "Allow",
"Resource": "*"
}
]
}
EOF
}
# ATTACH MANAGED POLICY
resource "aws_iam_role_policy_attachment" "sr-attach" {
role = "${alks_iamrole.test_role.name}"
policy_arn = "arn:aws:iam::aws:policy/service-role/AWSElasticBeanstalkService"
}