forked from moritzzimmer/terraform-aws-lambda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
codedeploy.tf
33 lines (29 loc) · 1.22 KB
/
codedeploy.tf
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
resource "aws_codedeploy_app" "this" {
name = var.function_name
compute_platform = "Lambda"
}
resource "aws_codedeploy_deployment_group" "this" {
app_name = var.function_name
deployment_config_name = var.deployment_config_name
deployment_group_name = var.alias_name
service_role_arn = aws_iam_role.codedeploy.arn
dynamic "alarm_configuration" {
for_each = var.codedeploy_deployment_group_alarm_configuration_enabled ? [true] : []
content {
alarms = var.codedeploy_deployment_group_alarm_configuration_alarms
enabled = var.codedeploy_deployment_group_alarm_configuration_enabled
ignore_poll_alarm_failure = var.codedeploy_deployment_group_alarm_configuration_ignore_poll_alarm_failure
}
}
dynamic "auto_rollback_configuration" {
for_each = var.codedeploy_deployment_group_auto_rollback_configuration_enabled ? [true] : []
content {
enabled = var.codedeploy_deployment_group_auto_rollback_configuration_enabled
events = var.codedeploy_deployment_group_auto_rollback_configuration_events
}
}
deployment_style {
deployment_option = "WITH_TRAFFIC_CONTROL"
deployment_type = "BLUE_GREEN"
}
}