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

feat: Add vpc_lattice_configuration for service #250

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
@@ -82,6 +82,7 @@ module "service" {
propagate_tags = try(each.value.propagate_tags, null)
scheduling_strategy = try(each.value.scheduling_strategy, null)
service_connect_configuration = lookup(each.value, "service_connect_configuration", {})
vpc_lattice_configuration = lookup(each.value, "vpc_lattice_configuration", {})
service_registries = lookup(each.value, "service_registries", {})
timeouts = try(each.value.timeouts, {})
triggers = try(each.value.triggers, {})
1 change: 1 addition & 0 deletions modules/service/README.md
Original file line number Diff line number Diff line change
@@ -320,6 +320,7 @@ module "ecs_service" {
| <a name="input_timeouts"></a> [timeouts](#input\_timeouts) | Create, update, and delete timeout configurations for the service | `map(string)` | `{}` | no |
| <a name="input_triggers"></a> [triggers](#input\_triggers) | Map of arbitrary keys and values that, when changed, will trigger an in-place update (redeployment). Useful with `timestamp()` | `any` | `{}` | no |
| <a name="input_volume"></a> [volume](#input\_volume) | Configuration block for volumes that containers in your task may use | `any` | `{}` | no |
| <a name="input_vpc_lattice_configuration"></a> [vpc\_lattice\_configuration](#input\_vpc\_lattice\_configuration) | The VPC Lattice configuration for your service that allows Lattice to connect, secure, and monitor your service across multiple accounts and VPCs | `any` | `{}` | no |
| <a name="input_wait_for_steady_state"></a> [wait\_for\_steady\_state](#input\_wait\_for\_steady\_state) | If true, Terraform will wait for the service to reach a steady state before continuing. Default is `false` | `bool` | `null` | no |
| <a name="input_wait_until_stable"></a> [wait\_until\_stable](#input\_wait\_until\_stable) | Whether terraform should wait until the task set has reached `STEADY_STATE` | `bool` | `null` | no |
| <a name="input_wait_until_stable_timeout"></a> [wait\_until\_stable\_timeout](#input\_wait\_until\_stable\_timeout) | Wait timeout for task set to reach `STEADY_STATE`. Valid time units include `ns`, `us` (or µs), `ms`, `s`, `m`, and `h`. Default `10m` | `string` | `null` | no |
10 changes: 10 additions & 0 deletions modules/service/main.tf
Original file line number Diff line number Diff line change
@@ -188,6 +188,16 @@ resource "aws_ecs_service" "this" {
}
}

dynamic "vpc_lattice_configurations" {
for_each = length(var.vpc_lattice_configuration) > 0 ? [var.vpc_lattice_configuration] : []

content {
role_arn = try(vpc_lattice_configurations.value.role_arn, null)
target_group_arn = try(vpc_lattice_configurations.value.target_group_arn, null)
port_name = try(vpc_lattice_configurations.value.port_name, null)
}
}

task_definition = local.task_definition
triggers = var.triggers
wait_for_steady_state = var.wait_for_steady_state
6 changes: 6 additions & 0 deletions modules/service/variables.tf
Original file line number Diff line number Diff line change
@@ -176,6 +176,12 @@ variable "service_registries" {
default = {}
}

variable "vpc_lattice_configuration" {
description = "The VPC Lattice configuration for your service that allows Lattice to connect, secure, and monitor your service across multiple accounts and VPCs"
type = any
default = {}
}

variable "timeouts" {
description = "Create, update, and delete timeout configurations for the service"
type = map(string)
1 change: 1 addition & 0 deletions wrappers/service/main.tf
Original file line number Diff line number Diff line change
@@ -124,6 +124,7 @@ module "wrapper" {
timeouts = try(each.value.timeouts, var.defaults.timeouts, {})
triggers = try(each.value.triggers, var.defaults.triggers, {})
volume = try(each.value.volume, var.defaults.volume, {})
vpc_lattice_configuration = try(each.value.vpc_lattice_configuration, var.defaults.vpc_lattice_configuration, {})
wait_for_steady_state = try(each.value.wait_for_steady_state, var.defaults.wait_for_steady_state, null)
wait_until_stable = try(each.value.wait_until_stable, var.defaults.wait_until_stable, null)
wait_until_stable_timeout = try(each.value.wait_until_stable_timeout, var.defaults.wait_until_stable_timeout, null)