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
Show file tree
Hide file tree
Changes from 1 commit
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
Expand Up @@ -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, {})
Expand Down
1 change: 1 addition & 0 deletions modules/service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ module "ecs_service" {
| <a name="input_security_group_use_name_prefix"></a> [security\_group\_use\_name\_prefix](#input\_security\_group\_use\_name\_prefix) | Determines whether the security group name (`security_group_name`) is used as a prefix | `bool` | `true` | no |
| <a name="input_service_connect_configuration"></a> [service\_connect\_configuration](#input\_service\_connect\_configuration) | The ECS Service Connect configuration for this service to discover and connect to services, and be discovered by, and connected from, other services within a namespace | `any` | `{}` | no |
| <a name="input_service_registries"></a> [service\_registries](#input\_service\_registries) | Service discovery registries for the service | `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_service_tags"></a> [service\_tags](#input\_service\_tags) | A map of additional tags to add to the service | `map(string)` | `{}` | no |
| <a name="input_skip_destroy"></a> [skip\_destroy](#input\_skip\_destroy) | If true, the task is not deleted when the service is deleted | `bool` | `null` | no |
| <a name="input_subnet_ids"></a> [subnet\_ids](#input\_subnet\_ids) | List of subnets to associate with the task or service | `list(string)` | `[]` | no |
Expand Down
10 changes: 10 additions & 0 deletions modules/service/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,16 @@ resource "aws_ecs_service" "this" {
}
}

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

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

task_definition = local.task_definition
triggers = var.triggers
wait_for_steady_state = var.wait_for_steady_state
Expand Down
6 changes: 6 additions & 0 deletions modules/service/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
1 change: 1 addition & 0 deletions wrappers/service/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ module "wrapper" {
security_group_tags = try(each.value.security_group_tags, var.defaults.security_group_tags, {})
security_group_use_name_prefix = try(each.value.security_group_use_name_prefix, var.defaults.security_group_use_name_prefix, true)
service_connect_configuration = try(each.value.service_connect_configuration, var.defaults.service_connect_configuration, {})
vpc_lattice_configuration = try(each.value.vpc_lattice_configuration, var.defaults.vpc_lattice_configuration, {})
service_registries = try(each.value.service_registries, var.defaults.service_registries, {})
service_tags = try(each.value.service_tags, var.defaults.service_tags, {})
skip_destroy = try(each.value.skip_destroy, var.defaults.skip_destroy, null)
Expand Down
Loading