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 +``` 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, 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