Skip to content

Commit

Permalink
Using Pseudo Function to get Service URL Domain (#6632)
Browse files Browse the repository at this point in the history
Co-authored-by: Himani Anil Deshpande <himanidp@amazon.com>
  • Loading branch information
himani2411 and Himani Anil Deshpande authored Jan 3, 2025
1 parent b4402b4 commit 28330be
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cloudformation/ad/ad-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ Resources:
- Action: sts:AssumeRole
Effect: Allow
Principal:
Service: ec2.amazonaws.com
Service: !Sub ec2.${AWS::URLSuffix}
Version: "2012-10-17"
ManagedPolicyArns:
- !Sub arn:${AWS::Partition}:iam::aws:policy/AmazonSSMManagedInstanceCore
Expand Down
4 changes: 2 additions & 2 deletions cloudformation/proxy/proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Resources:
- Action: sts:AssumeRole
Effect: Allow
Principal:
Service: ec2.amazonaws.com
Service: !Sub ec2.${AWS::URLSuffix}
Version: 2012-10-17
ManagedPolicyArns:
- arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore
Expand All @@ -189,7 +189,7 @@ Resources:
- Action: sts:AssumeRole
Effect: Allow
Principal:
Service: ec2.amazonaws.com
Service: !Sub ec2.${AWS::URLSuffix}
Version: 2012-10-17
ManagedPolicyArns:
- arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore
Expand Down
8 changes: 4 additions & 4 deletions tests/iam_policies/cluster-roles.cfn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ Resources:
- Action: sts:AssumeRole
Effect: Allow
Principal:
Service: !If [ GovCloud, 'ec2.amazonaws-us-gov.com', !If [ China, 'ec2.amazonaws.cn', 'ec2.amazonaws.com']]
Service: !Sub ec2.${AWS::URLSuffix}
Version: '2012-10-17'
Path: /parallelcluster/
ManagedPolicyArns:
Expand Down Expand Up @@ -105,7 +105,7 @@ Resources:
Condition:
StringEquals:
iam:PassedToService:
- !If [ GovCloud, 'ec2.amazonaws-us-gov.com', !If [ China, 'ec2.amazonaws.cn', 'ec2.amazonaws.com']]
- !Sub ec2.${AWS::URLSuffix}
- Action:
- ec2:DescribeInstances
- ec2:DescribeInstanceStatus
Expand Down Expand Up @@ -147,7 +147,7 @@ Resources:
- Action: sts:AssumeRole
Effect: Allow
Principal:
Service: !If [ GovCloud, 'ec2.amazonaws-us-gov.com', !If [ China, 'ec2.amazonaws.cn', 'ec2.amazonaws.com']]
Service: !Sub ec2.${AWS::URLSuffix}
Version: '2012-10-17'
Path: /parallelcluster/
ManagedPolicyArns:
Expand Down Expand Up @@ -235,7 +235,7 @@ Resources:
- Action: sts:AssumeRole
Effect: Allow
Principal:
Service: !If [ GovCloud, 'ec2.amazonaws-us-gov.com', !If [ China, 'ec2.amazonaws.cn', 'ec2.amazonaws.com']]
Service: !Sub ec2.${AWS::URLSuffix}
Version: '2012-10-17'
Path: /parallelcluster/
ManagedPolicyArns:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Resources:
- Action: sts:AssumeRole
Effect: Allow
Principal:
Service: ec2.amazonaws.com
Service: !Sub ec2.${AWS::URLSuffix}
Version: "2012-10-17"
ManagedPolicyArns:
- !Sub arn:${AWS::Partition}:iam::aws:policy/AmazonSSMManagedInstanceCore
Expand Down

0 comments on commit 28330be

Please sign in to comment.