hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.87k stars 9.21k forks source link

[Enhancement]: Support CodePipeline stage level conditions #39284

Open egoaty opened 2 months ago

egoaty commented 2 months ago

Description

AWS recently announced stage level conditions to implement pipeline gates for CodePipeline.

Announcement: https://aws.amazon.com/about-aws/whats-new/2024/08/aws-codepipeline-stage-level-conditions-implement-pipeline-gates/

Documentation: https://docs.aws.amazon.com/codepipeline/latest/userguide/stage-conditions.html

Affected Resource(s) and/or Data Source(s)

aws_codepipeline

Potential Terraform Configuration

resource "aws_codepipeline" "pipeline" {
  name = "my-pipeline"
  ...
  stage {
    name       = "Deploy"
    ...
    before_entry {
      condition {
        result = "FAIL"
        rule {
          name = "DeploymentWindow"
          rule_type_id = {
            category = "Rule"
            owner = "AWS"
            provider = "DeploymentWindow"
            version = "1"
          }
          configuration = {
            Cron = "* * 9-17 ? * MON-FRI *"
            TimeZone = "UTC"
          }
          ...
        }
      }
    }
  }
}

References

https://aws.amazon.com/about-aws/whats-new/2024/08/aws-codepipeline-stage-level-conditions-implement-pipeline-gates/ https://docs.aws.amazon.com/codepipeline/latest/userguide/stage-conditions.html https://awsapichanges.com/archive/changes/021533-codepipeline.html

Would you like to implement a fix?

None

github-actions[bot] commented 2 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

gwrite commented 2 weeks ago

Very useful this enhancement!!