You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: deployment/instance-scheduler-remote.template
+120-42
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"AWSTemplateFormatVersion": "2010-09-09",
3
-
"Description": "ECS and RDS scheduler cross account role, version 2.2.2.0",
3
+
"Description": "(SO0030) - Instance scheduler cross account role, version %version%",
4
4
"Parameters": {
5
5
"InstanceSchedulerAccount": {
6
6
"Type": "String",
@@ -29,6 +29,16 @@
29
29
"Resources": {
30
30
"EC2SchedulerCrossAccountRole": {
31
31
"Type": "AWS::IAM::Role",
32
+
"Metadata": {
33
+
"cfn_nag": {
34
+
"rules_to_suppress": [
35
+
{
36
+
"id": "W11",
37
+
"reason": "All policies have been scoped to be as restrictive as possible. This solution needs to access ec2/rds resources across all regions."
38
+
}
39
+
]
40
+
}
41
+
},
32
42
"Properties": {
33
43
"AssumeRolePolicyDocument": {
34
44
"Version": "2012-10-17",
@@ -53,48 +63,116 @@
53
63
}]
54
64
},
55
65
"Path": "/",
56
-
"Policies": [{
57
-
"PolicyName": "EC2InstanceSchedulerRemote",
58
-
"PolicyDocument": {
59
-
"Version": "2012-10-17",
60
-
"Statement": [{
61
-
"Effect": "Allow",
62
-
"Action": [
63
-
"ec2:DescribeInstances",
64
-
"ec2:StartInstances",
65
-
"ec2:StopInstances",
66
-
"ec2:ModifyInstanceAttribute",
67
-
"ec2:CreateTags",
68
-
"ec2:DeleteTags"
69
-
],
70
-
"Resource": [
71
-
"*"
72
-
]
73
-
}, {
74
-
"Effect": "Allow",
75
-
"Action": [
76
-
"rds:DescribeDBInstances",
77
-
"rds:DescribeDBSnapshots",
78
-
"rds:StartDBInstance",
79
-
"rds:StopDBInstance",
80
-
"rds:AddTagsToResource",
81
-
"rds:RemoveTagsFromResource",
82
-
"rds:DeleteDBSnapshot"
83
-
],
84
-
"Resource": [
85
-
"*"
86
-
]
87
-
}, {
88
-
"Effect": "Allow",
89
-
"Action": [
90
-
"tag:GetResources"
91
-
],
92
-
"Resource": [
93
-
"*"
66
+
"Policies": [
67
+
{
68
+
"PolicyName": "EC2InstanceSchedulerRemote",
69
+
"PolicyDocument": {
70
+
"Version": "2012-10-17",
71
+
"Statement": [
72
+
{
73
+
"Effect": "Allow",
74
+
"Action": "rds:DeleteDBSnapshot",
75
+
"Resource": {
76
+
"Fn::Join": [
77
+
":",
78
+
[
79
+
"arn:aws:rds:*",
80
+
{
81
+
"Ref": "AWS::AccountId"
82
+
},
83
+
"snapshot:*"
84
+
]
85
+
]
86
+
}
87
+
},
88
+
{
89
+
"Effect": "Allow",
90
+
"Action": [
91
+
"rds:AddTagsToResource",
92
+
"rds:RemoveTagsFromResource",
93
+
"rds:DescribeDBSnapshots",
94
+
"rds:StartDBInstance",
95
+
"rds:StopDBInstance"
96
+
],
97
+
"Resource": {
98
+
"Fn::Join": [
99
+
":",
100
+
[
101
+
"arn:aws:rds:*",
102
+
{
103
+
"Ref": "AWS::AccountId"
104
+
},
105
+
"db:*"
106
+
]
107
+
]
108
+
}
109
+
},
110
+
{
111
+
"Effect": "Allow",
112
+
"Action": [
113
+
"rds:StartDBCluster",
114
+
"rds:StopDBCluster"
115
+
],
116
+
"Resource": [
117
+
{
118
+
"Fn::Join": [
119
+
":",
120
+
[
121
+
"arn:aws:rds:*",
122
+
{
123
+
"Ref": "AWS::AccountId"
124
+
},
125
+
"cluster:*"
126
+
]
127
+
]
128
+
}
129
+
]
130
+
},
131
+
{
132
+
"Effect": "Allow",
133
+
"Action": [
134
+
"ec2:StartInstances",
135
+
"ec2:StopInstances",
136
+
"ec2:CreateTags",
137
+
"ec2:DeleteTags"
138
+
],
139
+
"Resource": [
140
+
{
141
+
"Fn::Join": [
142
+
":",
143
+
[
144
+
"arn:aws:ec2:*",
145
+
{
146
+
"Ref": "AWS::AccountId"
147
+
},
148
+
"instance/*"
149
+
]
150
+
]
151
+
}
152
+
]
153
+
},
154
+
{
155
+
"Effect": "Allow",
156
+
"Action": [
157
+
"rds:DescribeDBClusters",
158
+
"rds:DescribeDBInstances",
159
+
160
+
"ec2:DescribeInstances",
161
+
"ec2:DescribeRegions",
162
+
"ec2:ModifyInstanceAttribute",
163
+
164
+
"ssm:DescribeMaintenanceWindows",
165
+
166
+
"tag:GetResources"
167
+
],
168
+
"Resource": [
169
+
"*"
170
+
]
171
+
}
94
172
]
95
-
}]
173
+
}
96
174
}
97
-
}]
175
+
]
98
176
}
99
177
}
100
178
},
@@ -109,4 +187,4 @@
109
187
"Description": "Arn for cross account role for Instance scheduler, add this arn to the list of crossaccount roles (CrossAccountRoles) parameter of the Instance Scheduler template."
0 commit comments