Skip to content

Commit

Permalink
Add dyncmaic load_balancer_info block (#18)
Browse files Browse the repository at this point in the history
  • Loading branch information
minniux committed Apr 1, 2020
1 parent 1a9f34c commit 15bf195
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ Creates a deployment group for a CodeDeploy app. This works in a blue/green way
| terminate\_blue\_instances\_on\_deployment\_success | The action to take on instances in the original environment after a successful blue/green deployment | string | `"KEEP_ALIVE"` | no |
| trigger\_events | events that can trigger the notifications | list | `<list>` | no |
| trigger\_target\_arn | ARN of the target group | string | n/a | yes |
| alb\_target\_group | Name of the ALB target group, to be used with blue/green deployment group | null | no

### Outputs

Expand Down
8 changes: 8 additions & 0 deletions deployment-group-blue-green/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,14 @@ resource "aws_codedeploy_deployment_group" "deployment_group" {
enabled = var.rollback_enabled
events = var.rollback_events
}
dynamic "load_balancer_info" {
for_each = var.alb_target_group == null ? [] : [var.alb_target_group]
content {
target_group_info {
name = var.alb_target_group
}
}
}

blue_green_deployment_config {
deployment_ready_option {
Expand Down
6 changes: 6 additions & 0 deletions deployment-group-blue-green/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,9 @@ variable "terminate_blue_instances_on_deployment_success" {
default = "KEEP_ALIVE"
}

variable "alb_target_group" {
description = "Name of the ALB target group, to be used with blue/green deployment group"
default = null
type = string
}

0 comments on commit 15bf195

Please sign in to comment.