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

Implement autonaming configuration protocol #1901

Closed
Tracked by #16188
mikhailshilkov opened this issue Dec 11, 2024 · 0 comments · Fixed by #1919
Closed
Tracked by #16188

Implement autonaming configuration protocol #1901

mikhailshilkov opened this issue Dec 11, 2024 · 0 comments · Fixed by #1919
Assignees
Labels
kind/enhancement Improvements or new features resolution/fixed This issue was fixed

Comments

@mikhailshilkov
Copy link
Member

mikhailshilkov commented Dec 11, 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

Implement the AWS Native part of pulumi/pulumi#1518. See pulumi/pulumi#17592 for the full design.

In short, pulumi/pulumi#17810 introduced the protobuf changes required for the provider-side implementation. With those, a provider can:

  • Declare that it supports autonaming configurations with a response flag in Configure
  • Accept two extra properties in CheckRequest: a proposed name and a mode to apply it

We need to implement autonaming configuration for AWS Native.

@mikhailshilkov mikhailshilkov added kind/enhancement Improvements or new features needs-triage Needs attention from the triage team labels Dec 11, 2024
@mikhailshilkov mikhailshilkov self-assigned this Dec 11, 2024
@mikhailshilkov mikhailshilkov removed the needs-triage Needs attention from the triage team label Dec 11, 2024
mikhailshilkov added a commit that referenced this issue Jan 7, 2025
This PR implement the AWS Native part of
pulumi/pulumi#1518. See
pulumi/pulumi#17592 for the full design.

In short, pulumi/pulumi#17810 introduced the
protobuf changes required for the provider-side implementation. With
those, a provider can:

- Declare that it supports autonaming configurations with a response
flag in Configure
- Accept two extra properties in CheckRequest: a proposed name and a
mode to apply it

This PR applies those parameters to auto-name calculation if they are
specified:

- In Disabled mode, we don't calculate auto-names and let the resource
validation fail if an explicit name is not specified. For that, I had to
thread an extra `bool` flag through autonaming machinery.
- In Enforce mode, we use whatever ProposedName is supplied by the
engine
- In Propose mode, we take the ProposedName but can also apply trivia
(e.g. add a suffix, as in the e2e test), or check the max/min length

I added unit tests to cover most autonaming cases. Also, added an
end-to-end test in YAML. Apparently, end-2-end tests had no AWS
credentials configured, so I added those. Let me know if that's against
the intention.

Resolves #1901
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Jan 7, 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 resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants