Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save antklim/e1170d229f69ba532ad2b4fe4d932e88 to your computer and use it in GitHub Desktop.
Save antklim/e1170d229f69ba532ad2b4fe4d932e88 to your computer and use it in GitHub Desktop.
InstanceRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service:
- ec2.amazonaws.com
Action:
- sts:AssumeRole
Path: '/'
RoleName: !Sub ${Namespace}-${Environment}-ec2-role
Policies:
- PolicyName: !Sub ${Namespace}-${Environment}-ec2-policy
PolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- logs:CreateLogGroup
- logs:CreateLogStream
- logs:PutLogEvents
- logs:DescribeLogStreams
Resource: '*'
InstanceProfile:
Type: AWS::IAM::InstanceProfile
Properties:
Path: /
Roles:
- !Ref InstanceRole
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment