Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Unable to have more than one profile in fargate_profiles #1245

Closed
1 of 4 tasks
brunoyb opened this issue Feb 16, 2021 · 6 comments · Fixed by #1583
Closed
1 of 4 tasks

Unable to have more than one profile in fargate_profiles #1245

brunoyb opened this issue Feb 16, 2021 · 6 comments · Fixed by #1583

Comments

@brunoyb
Copy link

brunoyb commented Feb 16, 2021

I have issues

I'm using Terraform v0.14.6. When I try to add a new item to fargate_profiles I get an error during terraform plan.

I'm submitting a...

  • bug report
  • feature request
  • support request - read the FAQ first!
  • kudos, thank you, warm fuzzy

What is the current behavior?

terraform plan shows this:

Error: Inconsistent conditional result types

  on .terraform/modules/my_eks/modules/fargate/fargate.tf line 17, in resource "aws_eks_fargate_profile" "this":
  17:   for_each               = local.create_eks ? local.fargate_profiles_expanded : {}
    |----------------
    | local.create_eks is true
    | local.fargate_profiles_expanded is object with 4 attributes

The true and false result expressions must have consistent types. The given
expressions are object and object, respectively.

If this is a bug, how to reproduce? Please include a code sample if relevant.

Have an instance of this module with fargate_profiles, after a successful terraform apply try to add a new item to fargate_profiles and run terraform plan.

EDIT: Looks like this happens whenever you have more than one fargate profile, not only when adding a new one (see comments below).

What's the expected behavior?

terraform plan should work and show the new aws_eks_fargate_profile resources being created.

Are you able to fix this problem and submit a PR? Link here if you have already.

I don't have a PR because I'm not sure what is correct solution for this, but I made a copy of this module locally and changed this:

resource "aws_eks_fargate_profile" "this" {
  for_each               = local.create_eks ? local.fargate_profiles_expanded : {}

With this:

resource "aws_eks_fargate_profile" "this" {
  for_each               = local.create_eks ? local.fargate_profiles_expanded : null

To workaround the issue for now.

In other words, I changed {} with null. Not even sure how for_each works with null, but since it didn't complain, I decided to leave it like this until we find the correct fix.

Environment details

  • Affected module version: 14.0.0
  • OS: Some recent version of Amazon Linux I believe
  • Terraform version: 0.14.6

Thanks!

@stale
Copy link

stale bot commented May 18, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label May 18, 2021
@stale stale bot removed the stale label Jun 8, 2021
@signaleleven
Copy link

I haven't tried the suggested solution yet (to be honest, I'd rather not cloning the module in the project I need it for), but I confirm that this happens not only when you try to add a profile to an existing cluster, but even attempting to create a cluster with more than one fargate profile.
Therefore the issue could be renamed to reflect the fact that - currently - the module does not support more than one fargate profile.

@brunoyb brunoyb changed the title Unable to add new fargate_profiles Unable to have more than one profile in fargate_profiles Jun 14, 2021
@brunoyb
Copy link
Author

brunoyb commented Jun 14, 2021

Thanks! I adjusted the title and added an EDIT to the original report.

I could just make a pull request for this and see what happens. I'm mostly concerned about backwards compatibility/breaking changes. But I guess they could just bump the major version and be safe.

@stale
Copy link

stale bot commented Sep 14, 2021

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@antonbabenko
Copy link
Member

v17.19.0 has been just released with this fix. See examples/fargate for more information.

@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 Nov 18, 2022
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Labels
None yet
Projects
None yet
3 participants