forked from valentinc94/aws-ecs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test
73 lines (62 loc) · 1.55 KB
/
test
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
resource "aws_iam_role" "codedeploy" {
name = "atua-codedeploy"
assume_role_policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "",
"Effect": "Allow",
"Principal": {
"Service": "codedeploy.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
EOF
}
resource "aws_codedeploy_app" "atua" {
compute_platform = "ECS"
name = "atua"
}
resource "aws_codedeploy_deployment_group" "atua" {
app_name = aws_codedeploy_app.atua.name
deployment_config_name = "CodeDeployDefault.ECSAllAtOnce"
deployment_group_name = "atua"
service_role_arn = aws_iam_role.codedeploy.arn
auto_rollback_configuration {
enabled = true
events = ["DEPLOYMENT_FAILURE"]
}
blue_green_deployment_config {
deployment_ready_option {
action_on_timeout = "CONTINUE_DEPLOYMENT"
}
terminate_blue_instances_on_deployment_success {
action = "TERMINATE"
termination_wait_time_in_minutes = 5
}
}
deployment_style {
deployment_option = "WITH_TRAFFIC_CONTROL"
deployment_type = "BLUE_GREEN"
}
ecs_service {
cluster_name = aws_ecs_cluster.main.name
service_name = aws_ecs_service.main.name
}
load_balancer_info {
target_group_pair_info {
prod_traffic_route {
listener_arns = [aws_alb_listener.front_end.arn]
}
target_group {
name = aws_alb_target_group.app.name
}
target_group {
name = aws_alb_target_group.app.name
}
}
}
}