Skip to content

Commit

Permalink
Merge pull request #28813 from mattburgess/fix-ecs-service-connect-co…
Browse files Browse the repository at this point in the history
…nfigurations

Align aws_ecs_service security_connect_configuration schema with API
  • Loading branch information
gdavison authored Feb 10, 2023
2 parents 5e85d6d + 57aea96 commit 468259f
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 8 deletions.
11 changes: 11 additions & 0 deletions .changelog/28813.txt
Original file line number Diff line number Diff line change
@@ -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
```
10 changes: 5 additions & 5 deletions internal/service/ecs/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,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": {
Expand Down Expand Up @@ -373,12 +373,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": {
Expand All @@ -388,7 +388,7 @@ func ResourceService() *schema.Resource {
"port": {
Type: schema.TypeInt,
Required: true,
ValidateFunc: validation.IntBetween(1, 65535),
ValidateFunc: validation.IntBetween(0, 65535),
},
},
},
Expand All @@ -400,7 +400,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,
Expand Down
6 changes: 3 additions & 3 deletions website/docs/r/ecs_service.html.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -245,16 +245,16 @@ 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.

### secret_option

`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

Expand Down

0 comments on commit 468259f

Please sign in to comment.