Skip to content

Commit 4f9fd68

Browse files
authored
Update to include new instance types (#64)
1 parent 5f0ec7d commit 4f9fd68

File tree

1 file changed

+56
-15
lines changed

1 file changed

+56
-15
lines changed

catalog/ec2-policies.yaml

Lines changed: 56 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,17 @@
1313

1414
# This policy denies instance families that aren't based on the Nitro system as documented in the following document:
1515
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html#ec2-nitro-instances
16-
# The listing below *are* Nitro-based instances. Most are collected from the following CLI query:
17-
# aws ec2 describe-instance-types \
16+
# The listing below *are* Nitro-based instances. They are collected from the following CLI query:
17+
#
18+
# aws --region us-east-1 ec2 describe-instance-types \
1819
# --filters Name=hypervisor,Values=nitro \
19-
# --query "InstanceTypes[*].[InstanceType]" --output text | cut -f 1 -d. | sort | uniq
20+
# --query "InstanceTypes[*].[InstanceType]" --output text | \
21+
# cut -f 1 -d. | sort | uniq | awk '{print " - " $0 ".*"}'
2022
#
21-
# However, that the command only lists instance types available in the default region. To be
23+
# However, that the command only lists instance types available in the specified region. To be
2224
# fully comprehensive, the command should be run in all regions where instances are launched.
23-
# As a shortcut, we only run the command in us-east-1, us-west-2, and eu-north-1, as these
25+
# As a shortcut, we only run the command in the default regions (those that do not require opt-in).
26+
# To date, it appears that the combination of us-east-1, us-east-2, us-west-2, and eu-west-1
2427
# regions combined appear to cover all instance types.
2528
#
2629
# In order to fit within the 5120-character limit for policies
@@ -37,7 +40,7 @@
3740
- test: "StringNotLike"
3841
variable: "ec2:InstanceType"
3942
values:
40-
# updated 2024-04-11
43+
# updated 2025-02-14
4144
- a1.*
4245
- c5.*
4346
- c5a.*
@@ -55,16 +58,20 @@
5558
- c7g.*
5659
- c7gd.*
5760
- c7gn.*
61+
- c7i-flex.*
5862
- c7i.*
63+
- c8g.*
5964
- d3.*
6065
- d3en.*
6166
- dl1.*
6267
- dl2q.*
68+
- f2.*
6369
- g4ad.*
6470
- g4dn.*
6571
- g5.*
6672
- g5g.*
6773
- g6.*
74+
- g6e.*
6875
- gr6.*
6976
- hpc6a.*
7077
- hpc6id.*
@@ -73,6 +80,8 @@
7380
- i3en.*
7481
- i4g.*
7582
- i4i.*
83+
- i7ie.*
84+
- i8g.*
7685
- im4gn.*
7786
- inf1.*
7887
- inf2.*
@@ -94,11 +103,14 @@
94103
- m7a.*
95104
- m7g.*
96105
- m7gd.*
97-
- m7i.*
98106
- m7i-flex.*
107+
- m7i.*
108+
- m8g.*
99109
- p3dn.*
100110
- p4d.*
101111
- p5.*
112+
- p5e.*
113+
- p5en.*
102114
- r5.*
103115
- r5a.*
104116
- r5ad.*
@@ -118,22 +130,31 @@
118130
- r7gd.*
119131
- r7i.*
120132
- r7iz.*
133+
- r8g.*
121134
- t3.*
122135
- t3a.*
123136
- t4g.*
124137
- trn1.*
125138
- trn1n.*
139+
- trn2.*
126140
- u-12tb1.*
127141
- u-18tb1.*
128142
- u-24tb1.*
129143
- u-3tb1.*
130144
- u-6tb1.*
131145
- u-9tb1.*
146+
- u7i-12tb.*
147+
- u7i-6tb.*
148+
- u7i-8tb.*
149+
- u7in-16tb.*
150+
- u7in-24tb.*
151+
- u7in-32tb.*
132152
- vt1.*
133153
- x2gd.*
134154
- x2idn.*
135155
- x2iedn.*
136156
- x2iezn.*
157+
- x8g.*
137158
- z1d.*
138159

139160
resources:
@@ -144,13 +165,16 @@
144165
# https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/data-protection.html#encryption-transit
145166
# and enumerated by the following command (adapted from the command specified in the documentation):
146167
#
147-
# aws ec2 describe-instance-types \
148-
# --filters Name=network-info.encryption-in-transit-supported,Values=true \
149-
# --query "InstanceTypes[*].[InstanceType]" --output text | cut -f 1 -d. | sort | uniq
168+
# aws --region us-east-1 ec2 describe-instance-types \
169+
# --filters Name=network-info.encryption-in-transit-supported,Values=true \
170+
# --query "InstanceTypes[*].[InstanceType]" --output text | \
171+
# cut -f 1 -d. | sort | uniq | awk '{print " - " $0 ".*"}'
150172
#
151-
# Note that the command only lists instance types available in the default region. To be
173+
# However, that the command only lists instance types available in the specified region. To be
152174
# fully comprehensive, the command should be run in all regions where instances are launched.
153-
# Since that is difficult, this policy is based on the official AWS documentation instead.
175+
# As a shortcut, we only run the command in the default regions (those that do not require opt-in).
176+
# To date, it appears that the combination of us-east-1, us-east-2, us-west-2, and eu-west-1
177+
# regions combined appear to cover all instance types.
154178
#
155179
# In order to fit within the 5120-character limit for policies
156180
# (See https://docs.aws.amazon.com/organizations/latest/userguide/org_troubleshoot_policies.html )
@@ -166,7 +190,7 @@
166190
- test: "StringNotLike"
167191
variable: "ec2:InstanceType"
168192
values:
169-
# updated 2024-04-11
193+
# updated 2025-02-14
170194
- c5a.*
171195
- c5ad.*
172196
- c5n.*
@@ -179,15 +203,19 @@
179203
- c7g.*
180204
- c7gd.*
181205
- c7gn.*
206+
- c7i-flex.*
182207
- c7i.*
208+
- c8g.*
183209
- d3.*
184210
- d3en.*
185211
- dl1.*
186212
- dl2q.*
213+
- f2.*
187214
- g4ad.*
188215
- g4dn.*
189216
- g5.*
190217
- g6.*
218+
- g6e.*
191219
- gr6.*
192220
- hpc6a.*
193221
- hpc6id.*
@@ -196,6 +224,8 @@
196224
- i3en.*
197225
- i4g.*
198226
- i4i.*
227+
- i7ie.*
228+
- i8g.*
199229
- im4gn.*
200230
- inf1.*
201231
- inf2.*
@@ -211,12 +241,14 @@
211241
- m7a.*
212242
- m7g.*
213243
- m7gd.*
214-
- m7i.*
215244
- m7i-flex.*
245+
- m7i.*
246+
- m8g.*
216247
- p3dn.*
217248
- p4d.*
218-
- p4de.*
219249
- p5.*
250+
- p5e.*
251+
- p5en.*
220252
- r5dn.*
221253
- r5n.*
222254
- r6a.*
@@ -229,18 +261,27 @@
229261
- r7gd.*
230262
- r7i.*
231263
- r7iz.*
264+
- r8g.*
232265
- trn1.*
233266
- trn1n.*
267+
- trn2.*
234268
- u-12tb1.*
235269
- u-18tb1.*
236270
- u-24tb1.*
237271
- u-3tb1.*
238272
- u-6tb1.*
239273
- u-9tb1.*
274+
- u7i-12tb.*
275+
- u7i-6tb.*
276+
- u7i-8tb.*
277+
- u7in-16tb.*
278+
- u7in-24tb.*
279+
- u7in-32tb.*
240280
- vt1.*
241281
- x2idn.*
242282
- x2iedn.*
243283
- x2iezn.*
284+
- x8g.*
244285

245286
resources:
246287
- "arn:aws:ec2:*:*:instance/*"

0 commit comments

Comments
 (0)