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.88k stars 9.22k forks source link

Codepipeline wait for build to complete #15719

Open jrobison-sb opened 4 years ago

jrobison-sb commented 4 years ago

Community Note

Description

It's probably pretty common for infrastructure to depend upon the output of whatever CodePipeline is building. Such as if CodePipeline is building a Docker image which will be used by an ECS service.

It would be nice if Terraform was able to not only build a pipeline, but also wait for the pipeline to complete an execution (at least upon creation), similar to the way an aws_autoscaling_group uses wait_for_capacity_timeout to wait for instances inside the ASG to spin up. This would allow us to use depends_on in other resources which might need to consume the Docker image or whatever one is building with CodePipeline. Preferably this would be user-configurable the way that wait_for_capacity_timeout is, where the user can specify a timeout to wait or they can disable waiting altogether.

Currently we accomplish this with aws codepipeline get-pipeline-execution hacky bash scripts run through a provisioner block, but it would be nice not to need those.

New or Affected Resource(s)

Potential Terraform Configuration

resource "aws_codepipeline" "foo" {
  wait_for_succeeded_status = 600 # Wait up to 10 minutes for the initial pipeline execution to reach a status of 'Succeeded'
  ...
}

Or:

resource "aws_codepipeline" "foo" {
  wait_for_succeeded_status = 0 # Don't wait for the pipeline execution. This could maybe be the default.
  ...
}
github-actions[bot] commented 2 years ago

Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.

If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

jrobison-sb commented 2 years ago

.

CRSylar commented 1 year ago

.