From 0c0f66412f1cd48777a0c2702ec55663364ad35b Mon Sep 17 00:00:00 2001 From: Matt Burgess <549318+mattburgess@users.noreply.github.com> Date: Tue, 10 Jan 2023 23:09:36 +0000 Subject: [PATCH 1/3] Align aws_ecs_service security_connect_configuration schema with API See https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ServiceConnectConfiguration.html and https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_ServiceConnectService.html --- internal/service/ecs/service.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/internal/service/ecs/service.go b/internal/service/ecs/service.go index c5b83277bd36..1762ec02a2bf 100644 --- a/internal/service/ecs/service.go +++ b/internal/service/ecs/service.go @@ -336,7 +336,7 @@ func ResourceService() *schema.Resource { Schema: map[string]*schema.Schema{ "log_driver": { Type: schema.TypeString, - Optional: true, + Required: true, ValidateFunc: validation.StringInSlice(ecs.LogDriver_Values(), false), }, "options": { @@ -371,12 +371,12 @@ func ResourceService() *schema.Resource { "service": { Type: schema.TypeList, Optional: true, - MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "client_alias": { Type: schema.TypeList, - Required: true, + Optional: true, + MaxItems: 1, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "dns_name": { @@ -386,7 +386,7 @@ func ResourceService() *schema.Resource { "port": { Type: schema.TypeInt, Required: true, - ValidateFunc: validation.IntBetween(1, 65535), + ValidateFunc: validation.IntBetween(0, 65535), }, }, }, @@ -398,7 +398,7 @@ func ResourceService() *schema.Resource { "ingress_port_override": { Type: schema.TypeInt, Optional: true, - ValidateFunc: validation.IntBetween(1, 65535), + ValidateFunc: validation.IntBetween(0, 65535), }, "port_name": { Type: schema.TypeString, From 28ab26a8b95dd2d2d0a08f817db68cc8aba7c4d5 Mon Sep 17 00:00:00 2001 From: Matt Burgess <549318+mattburgess@users.noreply.github.com> Date: Fri, 13 Jan 2023 21:21:35 +0000 Subject: [PATCH 2/3] Update docs --- website/docs/r/ecs_service.html.markdown | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/website/docs/r/ecs_service.html.markdown b/website/docs/r/ecs_service.html.markdown index 60c8e7137285..408a3a74c752 100644 --- a/website/docs/r/ecs_service.html.markdown +++ b/website/docs/r/ecs_service.html.markdown @@ -245,7 +245,7 @@ For more information, see [Task Networking](https://docs.aws.amazon.com/AmazonEC `log_configuration` supports the following: -* `log_driver` - (Optional) The log driver to use for the container. +* `log_driver` - (Required) The log driver to use for the container. * `options` - (Optional) The configuration options to send to the log driver. * `secret_option` - (Optional) The secrets to pass to the log configuration. See below. @@ -253,8 +253,8 @@ For more information, see [Task Networking](https://docs.aws.amazon.com/AmazonEC `secret_option` supports the following: -* `name` - (Optional) The name of the secret. -* `value_from` - (Optional) The secret to expose to the container. The supported values are either the full ARN of the AWS Secrets Manager secret or the full ARN of the parameter in the SSM Parameter Store. +* `name` - (Required) The name of the secret. +* `value_from` - (Required) The secret to expose to the container. The supported values are either the full ARN of the AWS Secrets Manager secret or the full ARN of the parameter in the SSM Parameter Store. ### service From 57aea961946038a46a20cdda3e6ce47628b66df7 Mon Sep 17 00:00:00 2001 From: Matt Burgess <549318+mattburgess@users.noreply.github.com> Date: Fri, 13 Jan 2023 21:22:11 +0000 Subject: [PATCH 3/3] Add Changelog --- .changelog/28813.txt | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .changelog/28813.txt diff --git a/.changelog/28813.txt b/.changelog/28813.txt new file mode 100644 index 000000000000..a507ad71b99a --- /dev/null +++ b/.changelog/28813.txt @@ -0,0 +1,11 @@ +```release-note:bug +resource/aws_ecs_service: Allow multiple `service` blocks within `service_connect_configuration` +``` + +```release-note:bug +resource/aws_ecs_service: Require `service_connect_configuration.log_configuration.log_driver` to be provided +``` + +```release-note:bug +resource/aws_ecs_service: Mark `service_connect_configuration.service.client_alias` as optional and ensure that only 1 such block can be provided +```