Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding approval stage #117

Open
wants to merge 16 commits into
base: main
Choose a base branch
from
20 changes: 20 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,26 @@ resource "aws_codepipeline" "default" {
}
}

dynamic "stage" {
for_each = var.approve_sns_arn != "" && var.approve_sns_arn != "" ? ["true"] : []

content {
name = "Approval"
action {
name = "Approval"
category = "Approval"
owner = "AWS"
provider = "Manual"
version = "1"

configuration = {
NotificationArn = "${var.approve_sns_arn}"
CustomData = "${var.approve_comment}"
}
}
}
}

stage {
name = "Build"

Expand Down
10 changes: 10 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,13 @@ variable "website_bucket_acl" {
default = "public-read"
description = "Canned ACL of the S3 bucket objects that get served as a website, can be private if using CloudFront with OAI"
}

variable "approve_comment" {
type = string
default = "Approval needed for deployment"
}

variable "approve_sns_arn" {
type = string
default = ""
}