-
Notifications
You must be signed in to change notification settings - Fork 4
/
stackset_template.tf
96 lines (96 loc) · 3.7 KB
/
stackset_template.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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// Note: ExpelAccessPolicy is a duplicate policy statement with CloudTrail Manager IAM Policy
locals {
stackset_template = <<TEMPLATE
{
"AWSTemplateFormatVersion": "2010-09-09",
"Parameters" : {
"ExpelCustomerOrganizationGUID" : {
"Type" : "String"
},
"ExpelAccountARN" : {
"Type" : "String"
},
"ExpelRoleName" : {
"Type" : "String"
}
},
"Resources": {
"IAMR7FYC": {
"Type": "AWS::IAM::Role",
"Properties": {
"ManagedPolicyArns": [
{
"Ref": "IAMMP12SQ7"
}
],
"RoleName": { "Ref": "ExpelRoleName" },
"AssumeRolePolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": { "Ref": "ExpelAccountARN" }
},
"Action": "sts:AssumeRole",
"Condition": {
"StringEquals": {
"sts:ExternalId": { "Ref": "ExpelCustomerOrganizationGUID" }
}
}
}
]
}
}
},
"IAMMP12SQ7": {
"Type": "AWS::IAM::ManagedPolicy",
"Properties": {
"ManagedPolicyName": "ExpelAccessPolicy",
"PolicyDocument": {
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"cloudtrail:DescribeTrails",
"cloudtrail:GetTrailStatus",
"cloudtrail:ListTrails",
"cloudtrail:GetTrail",
"config:GetDiscoveredResourceCounts",
"config:ListDiscoveredResources",
"ec2:DescribeInstances",
"ec2:DescribeRegions",
"ec2:DescribeSecurityGroups",
"ec2:DescribeVolumes",
"ecs:DescribeClusters",
"ecs:DescribeContainerInstances",
"ecs:DescribeTaskDefinition",
"ecs:ListClusters",
"ecs:ListContainerInstances",
"ecs:ListTaskDefinitions",
"eks:DescribeCluster",
"eks:ListClusters",
"iam:Get*",
"iam:List*",
"lambda:GetFunction",
"lambda:ListFunctions",
"lightsail:GetInstances",
"lightsail:GetRegions",
"organizations:ListAccounts",
"rds:DescribeDBInstances",
"rds:ListTagsForResource",
"s3:ListAllMyBuckets",
"s3:GetBucketNotification",
"s3:GetEncryptionConfiguration"
],
"Resource": "*"
}
]
}
}
}
}
}
TEMPLATE
}