@@ -136,6 +136,9 @@ Resources:
136136 - ' kms:GenerateDataKey*'
137137 - ' kms:Describe*'
138138 Resource : ' *'
139+ Tags :
140+ - Key : Project
141+ Value : UID2
139142 SSMKEYAlias :
140143 Type : AWS::KMS::Alias
141144 Properties :
@@ -164,6 +167,9 @@ Resources:
164167 - Ref : DeployToEnvironment
165168 - ' "'
166169 - ' }'
170+ Tags :
171+ - Key : Project
172+ Value : UID2
167173 WorkerRole :
168174 Type : ' AWS::IAM::Role'
169175 Properties :
@@ -190,14 +196,46 @@ Resources:
190196 - Effect : Allow
191197 Action : ' secretsmanager:GetSecretValue'
192198 Resource : !Sub 'arn:aws:secretsmanager:${AWS::Region}:${AWS::AccountId}:secret:uid2-config-stack-${AWS::StackName}*'
199+ - Sid : EC2LaunchTemplateWrite
200+ Effect : Allow
201+ Action :
202+ - ' ec2:CreateLaunchTemplateVersion'
203+ Resource :
204+ - ' arn:aws:ec2:*:*:launch-template/*'
205+ Condition :
206+ StringEquals :
207+ ' aws:ResourceTag/Project ' : ' UID2'
208+ - Sid : AutoScalingReadPermissions
209+ Effect : Allow
210+ Action :
211+ - ' autoscaling:DescribeAutoScalingInstances'
212+ - ' autoscaling:DescribeAutoScalingGroups'
213+ - ' autoscaling:DescribeInstanceRefreshes'
214+ Resource : ' *'
215+ - Sid : AutoScalingWritePermissions
216+ Effect : Allow
217+ Action :
218+ - ' autoscaling:UpdateAutoScalingGroup'
219+ - ' autoscaling:StartInstanceRefresh'
220+ Resource :
221+ - ' arn:aws:autoscaling:*:*:autoScalingGroup:*:autoScalingGroupName/*'
222+ Condition :
223+ StringEquals :
224+ ' aws:ResourceTag/Project ' : ' UID2'
193225 ManagedPolicyArns :
194226 - ' arn:aws:iam::aws:policy/CloudWatchAgentServerPolicy'
227+ Tags :
228+ - Key : Project
229+ Value : UID2
195230 WorkerInstanceProfile :
196231 Type : ' AWS::IAM::InstanceProfile'
197232 Properties :
198233 Path : /
199234 Roles :
200235 - !Ref WorkerRole
236+ Tags :
237+ - Key : Project
238+ Value : UID2
201239 SecurityGroup :
202240 Type : ' AWS::EC2::SecurityGroup'
203241 Properties :
@@ -230,6 +268,9 @@ Resources:
230268 CidrIp : 0.0.0.0/0
231269 Description : " Allow Outbound DNS"
232270 VpcId : !Ref VpcId
271+ Tags :
272+ - Key : Project
273+ Value : UID2
233274 LaunchTemplate :
234275 Type : AWS::EC2::LaunchTemplate
235276 Properties :
@@ -261,6 +302,18 @@ Resources:
261302 HttpTokens : required # Enforces IMDSv2
262303 HttpPutResponseHopLimit : 1
263304 InstanceMetadataTags : enabled
305+ TagSpecifications :
306+ - ResourceType : instance
307+ Tags :
308+ - Key : Project
309+ Value : UID2
310+ - ResourceType : volume
311+ Tags :
312+ - Key : Project
313+ Value : UID2
314+ Tags :
315+ - Key : Project
316+ Value : UID2
264317 AutoScalingGroup :
265318 Type : AWS::AutoScaling::AutoScalingGroup
266319 DependsOn :
@@ -283,6 +336,9 @@ Resources:
283336 - Key : Name
284337 Value : ' UID2 Instance'
285338 PropagateAtLaunch : true
339+ - Key : Project
340+ Value : UID2
341+ PropagateAtLaunch : true
286342 CreationPolicy :
287343 ResourceSignal :
288344 Count : 1
0 commit comments