Skip to content

Commit

Permalink
Add iam role to instance (#409)
Browse files Browse the repository at this point in the history
Signed-off-by: rasel <rasel@appscode.com>
  • Loading branch information
Superm4n97 authored Dec 2, 2024
1 parent 750d652 commit bbcbc6c
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions files/products/appscode/aws-marketplace/ace_payg_cf_amd64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,33 @@ Resources:
Properties:
RouteTableId: !Ref RouteTable
SubnetId: !Ref Subnet
MeterUsageRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Principal:
Service:
- ec2.amazonaws.com
Action:
- 'sts:AssumeRole'
Path: /
Policies:
- PolicyName: MeterUsageFullAccess
PolicyDocument:
Version: "2012-10-17"
Statement:
- Effect: Allow
Action: 'aws-marketplace:MeterUsage'
Resource: '*'
MeterUsageInstanceProfile:
Type: AWS::IAM::InstanceProfile
Properties:
Path: /
Roles:
- Ref: MeterUsageRole
Instance:
Type: AWS::EC2::Instance
Properties:
Expand All @@ -203,6 +230,7 @@ Resources:
- Key: "Name"
Value:
Ref: AWS::StackName
IamInstanceProfile: !Ref MeterUsageInstanceProfile
NetworkInterfaces:
- AssociatePublicIpAddress: "true"
DeviceIndex: "0"
Expand Down

0 comments on commit bbcbc6c

Please sign in to comment.