Skip to content

Commit 39711c0

Browse files
committed
Add missing role
1 parent f8d4c55 commit 39711c0

File tree

1 file changed

+76
-2
lines changed

1 file changed

+76
-2
lines changed

aws_sra_examples/solutions/patch_mgmt/patch_mgmt_org/templates/sra-patch_mgmt-configuration-role.yaml

Lines changed: 76 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ Metadata:
3636
default: SSM Automation Role Name
3737
pSRASolutionName:
3838
default: SRA Solution Name
39+
pDefaultHostConfigRoleName:
40+
default: Default Host Config Role Name
3941

4042
Parameters:
4143
pManagementAccountId:
@@ -61,9 +63,15 @@ Parameters:
6163
Default: sra-patch-mgmt-automation
6264
Description: SSM Automation IAM Role Name
6365
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
6472
pSRASolutionName:
65-
AllowedValues: [sra-patch-mgmt-org]
66-
Default: sra-patch-mgmt-org
73+
AllowedValues: [sra-patch-mgmt]
74+
Default: sra-patch-mgmt
6775
Description: The SRA solution name. The default value is the folder name of the solution
6876
Type: String
6977

@@ -225,3 +233,69 @@ Resources:
225233
Tags:
226234
- Key: sra-solution
227235
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

Comments
 (0)