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

Replace hack with track_latest attribute #164

Open
bryantbiggs opened this issue Feb 12, 2024 · 0 comments
Open

Replace hack with track_latest attribute #164

bryantbiggs opened this issue Feb 12, 2024 · 0 comments
Milestone

Comments

@bryantbiggs
Copy link
Member

Is your request related to a new offering from AWS?

Is this functionality available in the AWS provider for Terraform? See CHANGELOG.md, too.

  • No 🛑: please wait to file a request until the functionality is avaialble in the AWS provider
  • Yes ✅: please list the AWS provider version which introduced this functionality

Is your request related to a problem? Please describe.

  • This ugly hack
    # This allows us to query both the existing as well as Terraform's state and get
    # and get the max version of either source, useful for when external resources
    # update the container definition
    max_task_def_revision = local.create_task_definition ? max(aws_ecs_task_definition.this[0].revision, data.aws_ecs_task_definition.this[0].revision) : 0
    task_definition = local.create_task_definition ? "${aws_ecs_task_definition.this[0].family}:${local.max_task_def_revision}" : var.task_definition_arn
    }
    # This allows us to query both the existing as well as Terraform's state and get
    # and get the max version of either source, useful for when external resources
    # update the container definition
    data "aws_ecs_task_definition" "this" {
    count = local.create_task_definition ? 1 : 0
    task_definition = aws_ecs_task_definition.this[0].family
    depends_on = [
    # Needs to exist first on first deployment
    aws_ecs_task_definition.this
    ]
    }

Describe the solution you'd like.

Describe alternatives you've considered.

Additional context

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant