Conditionally create CodePipeline actions based on CloudFormation conditions

后端 未结 1 1727
你的背包
你的背包 2021-02-07 16:09

Enable / disable sections of a CloudFormation for CodePipeline using Conditionals:

This creates a manual notification action once staging has been built and passed Runsc

相关标签:
1条回答
  • You should be able to accomplish this by conditionally inserting the AWS::CodePipeline::Pipeline Resource's Action into the Actions list using the Fn::If Intrinsic Function referencing your Conditions element, returning the Action when the Condition is true and AWS::NoValue (which removes the property, in this case removing the item from the list) when it is not true:

    - !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
    
    0 讨论(0)
提交回复
热议问题