使用条件启用/禁用CloudFormation for CodePipeline的部分:
一旦构建了分段并通过了Runscope测试,这将创建一个手动通知操作:
- InputArtifacts: [] Name: !Join ["",[!Ref GitHubRepository, "-prd-approval"]] ActionTypeId: Category: Approval Owner: AWS Version: '1' Provider: Manual OutputArtifacts: [] Configuration: NotificationArn: !GetAtt ["SNSApprovalNotification", "Outputs.SNSTopicArn"] ExternalEntityLink: OutputTestUrl RunOrder: 3
如何使用条件启用/禁用其他CloudFormation资源:
操作步骤无法识别条件:参数
我可以制作两个整个管道代码的副本,一个没有,然后切换我创建的管道,但似乎应该有更好的方法.
您应该能够通过使用引用元素的内部函数有条件地将AWS::CodePipeline::Pipeline
Resource的Action插入到Actions
列表中来完成此操作,当Condition为true时返回Action,并且(删除属性,在这种情况下从列表中删除项目)这不是真的:Fn::If
Conditions
AWS::NoValue
- !If - IsProdCondition - InputArtifacts: [] Name: !Join ["",[!Ref GitHubRepository, "-prd-approval"]] ActionTypeId: Category: Approval Owner: AWS Version: '1' Provider: Manual OutputArtifacts: [] Configuration: NotificationArn: !GetAtt ["SNSApprovalNotification", "Outputs.SNSTopicArn"] ExternalEntityLink: OutputTestUrl RunOrder: 3 - !Ref AWS::NoValue