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

Support toset #137

Open
t0yv0 opened this issue Apr 5, 2024 · 0 comments
Open

Support toset #137

t0yv0 opened this issue Apr 5, 2024 · 0 comments
Labels
kind/enhancement Improvements or new features

Comments

@t0yv0
Copy link
Member

t0yv0 commented Apr 5, 2024

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

Issue details

Lack of toset function support blocks a handful (4) AWS examples. The most prominent one is:

    resource "aws_eks_node_group" "example" {
      cluster_name    = "example"
      node_group_name = "example"

      # ... other configuration ...
    }

    resource "aws_autoscaling_group_tag" "example" {
      for_each = toset(
        [for asg in flatten(
          [for resources in aws_eks_node_group.example.resources : resources.autoscaling_groups]
        ) : asg.name]
      )

      autoscaling_group_name = each.value

      tag {
        key   = "k8s.io/cluster-autoscaler/node-template/label/eks.amazonaws.com/capacityType"
        value = "SPOT"

        propagate_at_launch = false
      }
    }

Sets are represented as lists in Pulumi but this function deduplicates at runtime. Perhaps we can get by with a non-deduplicating implementation for starters, since the provider will deduplicate anyway.

Affected area/feature

@t0yv0 t0yv0 added kind/enhancement Improvements or new features needs-triage Needs attention from the triage team labels Apr 5, 2024
@justinvp justinvp removed the needs-triage Needs attention from the triage team label Apr 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement Improvements or new features
Projects
None yet
Development

No branches or pull requests

2 participants