Skip to content

Commit

Permalink
fix(cicd): replace dash in env name for TestCommands build project (a…
Browse files Browse the repository at this point in the history
…ws#2439)

Fixes aws#2437

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
  • Loading branch information
efekarakus committed Jun 10, 2021
1 parent 7c3358c commit 28a1737
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func TestCC_Pipeline_Template(t *testing.T) {
Stages: []deploy.PipelineStage{
{
AssociatedEnvironment: &deploy.AssociatedEnvironment{
Name: "test",
Name: "staging-test",
Region: "us-west-2",
AccountID: "1111",
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Resources:
Version: '2012-10-17'
Statement:
- Effect: Allow
Resource: 'arn:aws:iam::1111:role/phonetool-test-EnvManagerRole'
Resource: 'arn:aws:iam::1111:role/phonetool-staging-test-EnvManagerRole'
Action:
- sts:AssumeRole
BuildProjectPolicy:
Expand Down Expand Up @@ -190,10 +190,10 @@ Resources:
Action:
- sts:AssumeRole
Resource:
- arn:aws:iam::1111:role/phonetool-test-EnvManagerRole
- arn:aws:iam::1111:role/phonetool-staging-test-EnvManagerRole
Roles:
- !Ref PipelineRole
BuildTestCommandstest:
BuildTestCommandsstagingDASHtest:
Type: AWS::CodeBuild::Project
Properties:
EncryptionKey: !ImportValue phonetool-ArtifactKey
Expand Down Expand Up @@ -262,9 +262,9 @@ Resources:
- Name: SCCheckoutArtifact
OutputArtifacts:
- Name: BuildOutput
- Name: DeployTo-test
- Name: DeployTo-staging-test
Actions:
- Name: CreateOrUpdate-api-test
- Name: CreateOrUpdate-api-staging-test
Region: us-west-2
ActionTypeId:
Category: Deploy
Expand All @@ -273,31 +273,31 @@ Resources:
Provider: CloudFormation
Configuration:
# https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/continuous-delivery-codepipeline-action-reference.html
ChangeSetName: phonetool-test-api
ChangeSetName: phonetool-staging-test-api
ActionMode: CREATE_UPDATE
StackName: phonetool-test-api
StackName: phonetool-staging-test-api
Capabilities: CAPABILITY_IAM,CAPABILITY_NAMED_IAM,CAPABILITY_AUTO_EXPAND
TemplatePath: BuildOutput::infrastructure/api-test.stack.yml
TemplateConfiguration: BuildOutput::infrastructure/api-test.params.json
TemplatePath: BuildOutput::infrastructure/api-staging-test.stack.yml
TemplateConfiguration: BuildOutput::infrastructure/api-staging-test.params.json
# The ARN of the IAM role (in the env account) that
# AWS CloudFormation assumes when it operates on resources
# in a stack in an environment account.
RoleArn: arn:aws:iam::1111:role/phonetool-test-CFNExecutionRole
RoleArn: arn:aws:iam::1111:role/phonetool-staging-test-CFNExecutionRole
InputArtifacts:
- Name: BuildOutput
RunOrder: 2
# The ARN of the environment manager IAM role (in the env
# account) that performs the declared action. This is assumed
# through the roleArn for the pipeline.
RoleArn: arn:aws:iam::1111:role/phonetool-test-EnvManagerRole
RoleArn: arn:aws:iam::1111:role/phonetool-staging-test-EnvManagerRole
- Name: TestCommands
ActionTypeId:
Category: Test
Owner: AWS
Version: 1
Provider: CodeBuild
Configuration:
ProjectName: !Ref BuildTestCommandstest
ProjectName: !Ref BuildTestCommandsstagingDASHtest
RunOrder: 3
InputArtifacts:
- Name: SCCheckoutArtifact
4 changes: 2 additions & 2 deletions templates/cicd/pipeline_cfn.yml
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ Resources:
- !Ref PipelineRole
{{- range $index, $stage := .Stages}}
{{- if $stage.TestCommands}}
BuildTestCommands{{$stage.Name}}:
BuildTestCommands{{logicalIDSafe $stage.Name}}:
Type: AWS::CodeBuild::Project
Properties:
EncryptionKey: !ImportValue {{$.AppName}}-ArtifactKey
Expand Down Expand Up @@ -396,7 +396,7 @@ Resources:
Version: 1
Provider: CodeBuild
Configuration:
ProjectName: !Ref BuildTestCommands{{$stage.Name}}
ProjectName: !Ref BuildTestCommands{{logicalIDSafe $stage.Name}}
RunOrder: 3
InputArtifacts:
- Name: SCCheckoutArtifact{{end}}{{end}}{{end}}{{end}}
Expand Down

0 comments on commit 28a1737

Please sign in to comment.