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

Add Operating system family property for AWS ECS Fargate Services #22033

Closed
georgikoemdzhiev opened this issue Dec 3, 2021 · 7 comments · Fixed by #22016
Closed

Add Operating system family property for AWS ECS Fargate Services #22033

georgikoemdzhiev opened this issue Dec 3, 2021 · 7 comments · Fixed by #22016
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/ecs Issues and PRs that pertain to the ecs service.
Milestone

Comments

@georgikoemdzhiev
Copy link

georgikoemdzhiev commented Dec 3, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

Currently the aws_ecs_service terraform resources does not have the platformFamily property listed on the AWS Service doc page

New or Affected Resource(s)

  • aws_ecs_service

Potential Terraform Configuration

resource "aws_ecs_service" "transform_service" {
  name    = "${var.app_name}-transform-service"
  cluster = aws_ecs_cluster.cluster.id
  task_definition                    = "${aws_ecs_task_definition.transform_service.family}:${max(aws_ecs_task_definition.transform_service.revision, data.aws_ecs_task_definition.tensform_service_td.revision)}"
  desired_count                      = 1
  deployment_minimum_healthy_percent = 50
  deployment_maximum_percent         = 200
  launch_type                        = "FARGATE"
  scheduling_strategy                = "REPLICA"
  runtimePlatform {
    #Valid Values: WINDOWS_SERVER_2019_FULL | WINDOWS_SERVER_2019_CORE | WINDOWS_SERVER_2016_FULL | WINDOWS_SERVER_2004_CORE | WINDOWS_SERVER_2022_CORE | WINDOWS_SERVER_2022_FULL | WINDOWS_SERVER_20H2_CORE | LINUX
    operatingSystemFamily = "WINDOWS_SERVER_2019_CORE"
  
    #Valid Values: X86_64 | ARM64
    cpuArchitecture       = "X86_64"
  }
  network_configuration {
    subnets          = var.subnets
    assign_public_ip = true
    security_groups = [
      aws_security_group.transform_service_sg.id,
    ]
  }
}

References

@georgikoemdzhiev georgikoemdzhiev added the enhancement Requests to existing resources that expand the functionality or scope. label Dec 3, 2021
@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/ecs Issues and PRs that pertain to the ecs service. labels Dec 3, 2021
@georgikoemdzhiev georgikoemdzhiev changed the title Add Operating system family property for AWS ECS Services Add Operating system family property for AWS ECS Fargate Services Dec 3, 2021
@ChrisMcKee
Copy link
Contributor

Duplicates #21706

@ewbankkit ewbankkit removed the needs-triage Waiting for first response or review from a maintainer. label Dec 7, 2021
@github-actions github-actions bot added this to the v3.69.0 milestone Dec 7, 2021
@github-actions
Copy link

This functionality has been released in v3.69.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@kgns
Copy link
Contributor

kgns commented Dec 24, 2021

I don't think this feature was implemented in #22016

This issue was for aws_ecs_service resource, and not for aws_ecs_task_definition resource.
Documentation for the latter can be seen on this page: https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_RegisterTaskDefinition.html#ECS-RegisterTaskDefinition-request-runtimePlatform
Documentation for the former can also be seen on this page: https://docs.aws.amazon.com/AmazonECS/latest/APIReference/API_Service.html#ECS-Type-Service-platformFamily

We still lack a platform_family attribute for aws_ecs_service resource. That attribute should force every task registered on that service to be using the same platform family as set for the service.

@jstehlik-ohpen
Copy link

The feature for aws_ecs_service still seems to be missing in provider version 4.1.0 and the ECS service gets created with the default platform family, i.e. Linux. Would it be possible to reopen this issue?

@jstehlik-ohpen
Copy link

jstehlik-ohpen commented Feb 21, 2022

Update: I've opened a case with AWS Support and experimented with creating a service via Terraform - according to AWS Support, there is a validation for the platformFamily parameter that triggers when you try to create/change the service in the Console, but not in CLI/API (in which it takes the data from the task definition). This is consistent with what I've seen during my experiments with creating an ECS service via Terraform - a Windows task was able to successfully start without me explicitly setting platformFamily. They promised to update the documentation with more details.

@ChrisMcKee
Copy link
Contributor

@jstehlik-ohpen I ran a bunch of fargate windows containers (till I realised just how bloated the pricing is) without issue using the terraform provider. afaik the platform family setting wasn't required by the tasks.
My original change was written before the cpu type was added and the api docs updated so I'd mapped to platformFamily. The change to the docs meant it was remapped to the runtime; the api doesnt seem to care about the platformFamily tag in the case of fargate then 😕

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/ecs Issues and PRs that pertain to the ecs service.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants