Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 11 additions & 9 deletions api/infrastructure/parallelcluster-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ Globals:
- CreateApiUserRoleCondition
- !Sub
- arn:${AWS::Partition}:*::${AWS::AccountId}:*/ParallelClusterApiUserRole-${StackIdSuffix}*
- { StackIdSuffix: !Select [2, !Split ['/', !Ref AWS::StackId]] }
- { StackIdSuffix: !Select [2, !Split ['/', !Ref 'AWS::StackId']] }
- '*'
TracingEnabled: True
EndpointConfiguration:
Expand Down Expand Up @@ -244,7 +244,7 @@ Resources:
Properties:
RoleName: !Sub
- ParallelClusterApiUserRole-${StackIdSuffix}
- { StackIdSuffix: !Select [2, !Split ['/', !Ref AWS::StackId]] }
- { StackIdSuffix: !Select [2, !Split ['/', !Ref 'AWS::StackId']] }
AssumeRolePolicyDocument:
Statement:
- Effect: Allow
Expand Down Expand Up @@ -581,7 +581,8 @@ Resources:
StringEqualsIfExists:
iam:PassedToService:
- lambda.amazonaws.com
- !Sub ec2.${AWS::URLSuffix}
- ec2.amazonaws.com
- ec2.amazonaws.com.cn
- spotfleet.amazonaws.com
Sid: IamPassRole
- Action:
Expand Down Expand Up @@ -700,7 +701,8 @@ Resources:
StringEquals:
iam:PassedToService:
- lambda.amazonaws.com
- !Sub 'ec2.${AWS::URLSuffix}'
- ec2.amazonaws.com
- ec2.amazonaws.com.cn
- Sid: CloudWatch
Effect: Allow
Action:
Expand Down Expand Up @@ -957,7 +959,7 @@ Resources:
Properties:
Name: !Sub
- ParallelClusterImageBuilderInfrastructureConfiguration-${Version}-${StackIdSuffix}
- { Version: !Join ['_', !Split ['.', !FindInMap [ParallelCluster, Constants, Version]]], StackIdSuffix: !Select [2, !Split ['/', !Ref AWS::StackId]] }
- { Version: !Join ['_', !Split ['.', !FindInMap [ParallelCluster, Constants, Version]]], StackIdSuffix: !Select [2, !Split ['/', !Ref 'AWS::StackId']] }
InstanceProfileName: !Ref ImageBuilderInstanceProfile
TerminateInstanceOnFailure: true
SnsTopicArn: !Ref EcrImageBuilderSNSTopic
Expand All @@ -968,7 +970,7 @@ Resources:
Properties:
RepositoryName: !Sub
- 'aws-parallelcluster-${StackIdSuffix}'
- { StackIdSuffix: !Select [2, !Split ['/', !Ref AWS::StackId]] }
- { StackIdSuffix: !Select [2, !Split ['/', !Ref 'AWS::StackId']] }
Tags:
- Key: 'parallelcluster:version'
Value: !FindInMap [ParallelCluster, Constants, Version]
Expand All @@ -982,7 +984,7 @@ Resources:
ContainerType: DOCKER
Name: !Sub
- 'ImportPublicEcrImage-${Version}-${StackIdSuffix}'
- { Version: !Join ['_', !Split ['.', !FindInMap [ParallelCluster, Constants, Version]]], StackIdSuffix: !Select [2, !Split ['/', !Ref AWS::StackId]] }
- { Version: !Join ['_', !Split ['.', !FindInMap [ParallelCluster, Constants, Version]]], StackIdSuffix: !Select [2, !Split ['/', !Ref 'AWS::StackId']] }
Version: !FindInMap [ParallelCluster, Constants, Version]
ParentImage: !Ref PublicEcrImageUri
PlatformOverride: Linux
Expand All @@ -1008,7 +1010,7 @@ Resources:
Properties:
Name: !Sub
- 'EcrImagePipeline-${Version}-${StackIdSuffix}'
- { Version: !Join ['_', !Split ['.', !FindInMap [ParallelCluster, Constants, Version]]], StackIdSuffix: !Select [2, !Split ['/', !Ref AWS::StackId]] }
- { Version: !Join ['_', !Split ['.', !FindInMap [ParallelCluster, Constants, Version]]], StackIdSuffix: !Select [2, !Split ['/', !Ref 'AWS::StackId']] }
Status: ENABLED
ContainerRecipeArn: !Ref EcrImageRecipe
InfrastructureConfigurationArn: !Ref InfrastructureConfiguration
Expand Down Expand Up @@ -1220,7 +1222,7 @@ Resources:
- imagebuilder:DeleteImage
Resource: !Sub
- arn:${AWS::Partition}:imagebuilder:${Region}:${AWS::AccountId}:image/*${StackIdSuffix}*
- { StackIdSuffix: !Select [2, !Split ['/', !Ref AWS::StackId]] }
- { StackIdSuffix: !Select [2, !Split ['/', !Ref 'AWS::StackId']] }

EcrImagesRemover:
Condition: DoNotUseCustomEcrImageUri
Expand Down
9 changes: 6 additions & 3 deletions tests/iam_policies/user-role.cfn.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@ Resources:
StringEqualsIfExists:
iam:PassedToService:
- lambda.amazonaws.com
- !Sub ec2.${AWS::URLSuffix}
- ec2.amazonaws.com
- ec2.amazonaws.com.cn
- spotfleet.amazonaws.com
Sid: IamPassRole
- Action:
Expand Down Expand Up @@ -456,7 +457,8 @@ Resources:
StringEquals:
iam:PassedToService:
- lambda.amazonaws.com
- !Sub 'ec2.${AWS::URLSuffix}'
- ec2.amazonaws.com
- ec2.amazonaws.com.cn
- Sid: CloudWatch
Effect: Allow
Action:
Expand Down Expand Up @@ -764,7 +766,8 @@ Resources:
Condition:
StringEquals:
iam:PassedToService:
- !Sub ec2.${AWS::URLSuffix}
- ec2.amazonaws.com
- ec2.amazonaws.com.cn
- Action:
- ec2:DescribeInstances
- ec2:DescribeInstanceStatus
Expand Down
2 changes: 1 addition & 1 deletion tests/integration-tests/cfn_stacks_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def create_stack(self, stack):
raise ValueError("Stack {0} already exists in region {1}".format(name, region))

logging.info("Creating stack {0} in region {1}".format(name, region))
is_template_url = stack.template.startswith("s3://")
is_template_url = stack.template.startswith("https://")
with aws_credential_provider(region, self.__credentials):
try:
cfn_client = boto3.client("cloudformation", region_name=region)
Expand Down