@@ -36,6 +36,8 @@ Metadata:
36
36
default : SSM Automation Role Name
37
37
pSRASolutionName :
38
38
default : SRA Solution Name
39
+ pDefaultHostConfigRoleName :
40
+ default : Default Host Config Role Name
39
41
40
42
Parameters :
41
43
pManagementAccountId :
@@ -61,9 +63,15 @@ Parameters:
61
63
Default : sra-patch-mgmt-automation
62
64
Description : SSM Automation IAM Role Name
63
65
Type : String
66
+ pDefaultHostConfigRoleName :
67
+ AllowedPattern : ' ^[\w+=,.@-]{1,64}$'
68
+ ConstraintDescription : Max 64 alphanumeric characters. Also special characters supported [+, =, ., @, -]
69
+ Default : AWSSystemsManagerDefaultEC2InstanceManagementRole
70
+ Description : Default Host Config IAM Role Name
71
+ Type : String
64
72
pSRASolutionName :
65
- AllowedValues : [sra-patch-mgmt-org ]
66
- Default : sra-patch-mgmt-org
73
+ AllowedValues : [sra-patch-mgmt]
74
+ Default : sra-patch-mgmt
67
75
Description : The SRA solution name. The default value is the folder name of the solution
68
76
Type : String
69
77
@@ -225,3 +233,69 @@ Resources:
225
233
Tags :
226
234
- Key : sra-solution
227
235
Value : !Ref pSRASolutionName
236
+
237
+ rDefaultHostConfigRoleName :
238
+ Type : AWS::IAM::Role
239
+ Metadata :
240
+ cfn_nag :
241
+ rules_to_suppress :
242
+ - id : F3
243
+ reason : Actions require * in permissions policy
244
+ - id : W11
245
+ reason : Actions require * in resource
246
+ - id : W28
247
+ reason : Explicit role name provided
248
+ Properties :
249
+ RoleName : !Ref pDefaultHostConfigRoleName
250
+ AssumeRolePolicyDocument :
251
+ Version : 2012-10-17
252
+ Statement :
253
+ - Action : sts:AssumeRole
254
+ Effect : Allow
255
+ Principal :
256
+ Service :
257
+ - ssm.amazonaws.com
258
+ Path : " /"
259
+ Policies :
260
+ - PolicyName : sra-amazon-ssm-managed-ec2-instance-default-policy-passrole
261
+ PolicyDocument :
262
+ Version : 2012-10-17
263
+ Statement :
264
+ - Sid : AllowPassRoleSimple
265
+ Effect : Allow
266
+ Action : iam:PassRole
267
+ Resource :
268
+ - !Sub arn:${AWS::Partition}:iam::${AWS::AccountId}:role/AWSSystemsManagerDefaultEC2InstanceManagementRole
269
+ - PolicyName : sra-amazon-ssm-managed-ec2-instance-default-policy
270
+ PolicyDocument :
271
+ Version : 2012-10-17
272
+ Statement :
273
+ Effect : Allow
274
+ Action :
275
+ - ssm:DescribeAssociation
276
+ - ssm:GetDeployablePatchSnapshotForInstance
277
+ - ssm:GetDocument
278
+ - ssm:DescribeDocument
279
+ - ssm:GetManifest
280
+ - ssm:ListAssociations
281
+ - ssm:ListInstanceAssociations
282
+ - ssm:PutInventory
283
+ - ssm:PutComplianceItems
284
+ - ssm:PutConfigurePackageResult
285
+ - ssm:UpdateAssociationStatus
286
+ - ssm:UpdateInstanceAssociationStatus
287
+ - ssm:UpdateInstanceInformation
288
+ - ssmmessages:CreateControlChannel
289
+ - ssmmessages:CreateDataChannel
290
+ - ssmmessages:OpenControlChannel
291
+ - ssmmessages:OpenDataChannel
292
+ - ec2messages:AcknowledgeMessage
293
+ - ec2messages:DeleteMessage
294
+ - ec2messages:FailMessage
295
+ - ec2messages:GetEndpoint
296
+ - ec2messages:GetMessages
297
+ - ec2messages:SendReply
298
+ Resource : " *"
299
+ Tags :
300
+ - Key : sra-solution
301
+ Value : !Ref pSRASolutionName
0 commit comments