Skip to content

Instantly share code, notes, and snippets.

@atheiman
Last active November 1, 2024 14:22
Show Gist options
  • Save atheiman/8a9824bccc4724a50ec9f4a13e1ab8cc to your computer and use it in GitHub Desktop.
Save atheiman/8a9824bccc4724a50ec9f4a13e1ab8cc to your computer and use it in GitHub Desktop.
CloudFormation template creating a cross account role assumable by a source arn with permission to submit Config evaluations. Can be deployed as a stackset.
Parameters:
RoleName:
Description: Name of role to be created - this will be suffixed with the region name
Type: String
SourceRoleArn:
Description: Source IAM role ARN to assume the role
Type: String
Resources:
ConfigCrossAcctEvaluationRole:
Type: 'AWS::IAM::Role'
Properties:
RoleName:
Fn::Sub: "${RoleName}-${AWS::Region}"
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Principal:
AWS:
- Ref: SourceRoleArn
Action: 'sts:AssumeRole'
Policies:
- PolicyName: Inline
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action:
- 'config:PutEvaluations'
Resource: '*'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment