codepipeline (#30)

* codepipeline
This commit is contained in:
Edward Viaene
2020-02-20 21:43:59 +01:00
committed by GitHub
parent cc37d59c87
commit 04cc267e86
12 changed files with 293 additions and 39 deletions
+27 -6
View File
@@ -1,7 +1,8 @@
resource "aws_lb" "demo" {
name = "demo"
subnets = module.vpc.public_subnets
load_balancer_type = "network"
name = "demo"
subnets = module.vpc.public_subnets
load_balancer_type = "network"
enable_cross_zone_load_balancing = true
}
resource "aws_lb_listener" "demo" {
@@ -10,13 +11,33 @@ resource "aws_lb_listener" "demo" {
protocol = "TCP"
default_action {
target_group_arn = aws_lb_target_group.demo.id
target_group_arn = aws_lb_target_group.demo-blue.id
type = "forward"
}
lifecycle {
ignore_changes = [
default_action,
]
}
}
resource "aws_lb_target_group" "demo" {
name = "demo-http"
resource "aws_lb_target_group" "demo-blue" {
name = "demo-http-blue"
port = "3000"
protocol = "TCP"
target_type = "ip"
vpc_id = module.vpc.vpc_id
deregistration_delay = "30"
health_check {
healthy_threshold = 2
unhealthy_threshold = 2
protocol = "TCP"
interval = 30
}
}
resource "aws_lb_target_group" "demo-green" {
name = "demo-http-green"
port = "3000"
protocol = "TCP"
target_type = "ip"