From 3e33cbd3be30a81a90a4505e562a597c4f2222f7 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Thu, 27 May 2021 13:49:39 -0700 Subject: [PATCH 1/4] Uses `LaunchType_Values()` to get full list of ECS launch types, including `EXTERNAL` --- aws/resource_aws_ecs_service.go | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/aws/resource_aws_ecs_service.go b/aws/resource_aws_ecs_service.go index 359a5a283d4..c6f3914d0c4 100644 --- a/aws/resource_aws_ecs_service.go +++ b/aws/resource_aws_ecs_service.go @@ -179,14 +179,11 @@ func resourceAwsEcsService() *schema.Resource { Computed: true, }, "launch_type": { - Type: schema.TypeString, - ForceNew: true, - Optional: true, - Computed: true, - ValidateFunc: validation.StringInSlice([]string{ - ecs.LaunchTypeEc2, - ecs.LaunchTypeFargate, - }, false), + Type: schema.TypeString, + ForceNew: true, + Optional: true, + Computed: true, + ValidateFunc: validation.StringInSlice(ecs.LaunchType_Values(), false), }, "load_balancer": { Type: schema.TypeSet, From 03fdb5ae5b54e17ba5e9a2ea4febd1dc1a36ed34 Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Thu, 27 May 2021 13:51:50 -0700 Subject: [PATCH 2/4] Updates documentation --- website/docs/r/ecs_service.html.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/docs/r/ecs_service.html.markdown b/website/docs/r/ecs_service.html.markdown index e7c2e988a47..6d2d448391c 100644 --- a/website/docs/r/ecs_service.html.markdown +++ b/website/docs/r/ecs_service.html.markdown @@ -105,7 +105,7 @@ The following arguments are optional: * `force_new_deployment` - (Optional) Enable to force a new task deployment of the service. This can be used to update tasks to use a newer Docker image with same image/tag combination (e.g. `myimage:latest`), roll Fargate tasks onto a newer platform version, or immediately deploy `ordered_placement_strategy` and `placement_constraints` updates. * `health_check_grace_period_seconds` - (Optional) Seconds to ignore failing load balancer health checks on newly instantiated tasks to prevent premature shutdown, up to 2147483647. Only valid for services configured to use load balancers. * `iam_role` - (Optional) ARN of the IAM role that allows Amazon ECS to make calls to your load balancer on your behalf. This parameter is required if you are using a load balancer with your service, but only if your task definition does not use the `awsvpc` network mode. If using `awsvpc` network mode, do not specify this role. If your account has already created the Amazon ECS service-linked role, that role is used by default for your service unless you specify a role here. -* `launch_type` - (Optional) Launch type on which to run your service. The valid values are `EC2` and `FARGATE`. Defaults to `EC2`. +* `launch_type` - (Optional) Launch type on which to run your service. The valid values are `EC2`, `FARGATE`, and `EXTERNAL`. Defaults to `EC2`. * `load_balancer` - (Optional) Configuration block for load balancers. Detailed below. * `network_configuration` - (Optional) Network configuration for the service. This parameter is required for task definitions that use the `awsvpc` network mode to receive their own Elastic Network Interface, and it is not supported for other network modes. Detailed below. * `ordered_placement_strategy` - (Optional) Service level strategy rules that are taken into consideration during task placement. List from top to bottom in order of precedence. Updates to this configuration will take effect next task deployment unless `force_new_deployment` is enabled. The maximum number of `ordered_placement_strategy` blocks is `5`. Detailed below. From fd489b80812a0bb761bfe34afec5104bdc10f8fb Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Thu, 27 May 2021 13:59:32 -0700 Subject: [PATCH 3/4] Adds CHANGELOG entry --- .changelog/19557.txt | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .changelog/19557.txt diff --git a/.changelog/19557.txt b/.changelog/19557.txt new file mode 100644 index 00000000000..d02ac1af1ee --- /dev/null +++ b/.changelog/19557.txt @@ -0,0 +1,3 @@ +```release-note:enhancement +resource/aws_ecs_service: Add support for AWS Anywhere with the `launch_type` `EXTERNAL` +``` From e859df5b7ffe25fdbe174b26cd13bd086db84abd Mon Sep 17 00:00:00 2001 From: Graham Davison Date: Thu, 27 May 2021 14:55:12 -0700 Subject: [PATCH 4/4] Fixes naming error --- .changelog/19557.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changelog/19557.txt b/.changelog/19557.txt index d02ac1af1ee..f5d4696408b 100644 --- a/.changelog/19557.txt +++ b/.changelog/19557.txt @@ -1,3 +1,3 @@ ```release-note:enhancement -resource/aws_ecs_service: Add support for AWS Anywhere with the `launch_type` `EXTERNAL` +resource/aws_ecs_service: Add support for ECS Anywhere with the `launch_type` `EXTERNAL` ```