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 an option to elide auto-named properties #262

Open
t0yv0 opened this issue Jan 24, 2025 · 0 comments
Open

Add an option to elide auto-named properties #262

t0yv0 opened this issue Jan 24, 2025 · 0 comments
Labels
kind/enhancement Improvements or new features

Comments

@t0yv0
Copy link
Member

t0yv0 commented Jan 24, 2025

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

Stoo was pointing out today that a lot of our auto-converted examples are not idiomatic as they populate autonamted properties such as bucket/name etc:

https://www.pulumi.com/registry/packages/aws/api-docs/s3/bucketv2/#private-bucket-with-tags

import pulumi
import pulumi_aws as aws

example = aws.s3.BucketV2("example",
    bucket="my-tf-test-bucket",
    tags={
        "Name": "My bucket",
        "Environment": "Dev",
    })

This is at odds with what we recommend to users as for most purposes bucket can be omitted and picked automatically. It is not clear that it is right for the converter to always drop these properties, but for the purposes of generating AWS examples this could actually be a better default to just elide these properties and generate this instead:

import pulumi
import pulumi_aws as aws

example = aws.s3.BucketV2("example",
    tags={
        "Name": "My bucket",
        "Environment": "Dev",
    })

Affected area/feature

@t0yv0 t0yv0 added kind/enhancement Improvements or new features needs-triage Needs attention from the triage team labels Jan 24, 2025
@justinvp justinvp removed the needs-triage Needs attention from the triage team label Jan 24, 2025
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