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

Component resources shouldn't have id properties #11462

Closed
danielrbradley opened this issue Nov 23, 2022 · 1 comment · Fixed by #11469
Closed

Component resources shouldn't have id properties #11462

danielrbradley opened this issue Nov 23, 2022 · 1 comment · Fixed by #11469
Assignees
Labels
area/docs Improvements or additions to documentation kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Milestone

Comments

@danielrbradley
Copy link
Member

Problem description

All custom resources have an id output field which is not part of the schema but is added by the SDK (and docs).

However, component resources do not have an id added by the SDK, but the docs do still add the id field.

E.g. https://www.pulumi.com/registry/packages/awsx/api-docs/ec2/vpc/#id_csharp

Suggestions for a fix

We should add an exception to the docs generation process to not add id fields to component resources.

@danielrbradley danielrbradley added the needs-triage Needs attention from the triage team label Nov 23, 2022
@justinvp justinvp transferred this issue from pulumi/docs Nov 24, 2022
@justinvp justinvp added area/docs Improvements or additions to documentation kind/bug Some behavior is incorrect or out of spec and removed needs-triage Needs attention from the triage team labels Nov 24, 2022
@justinvp
Copy link
Member

Here's where this is set:

pulumi/pkg/codegen/docs/gen.go

Lines 1561 to 1566 in 449307d

// All resources have an implicit `id` output property, that we must inject into the docs.
filteredOutputProps = append(filteredOutputProps, &schema.Property{
Name: "id",
Comment: "The provider-assigned unique ID for this managed resource.",
Type: schema.StringType,
})

The fix: if r.IsComponent, then the id property should not be added.

@justinvp justinvp self-assigned this Nov 25, 2022
@justinvp justinvp added this to the 0.81 milestone Nov 25, 2022
@bors bors bot closed this as completed in 4c8b5b7 Nov 25, 2022
@pulumi-bot pulumi-bot added the resolution/fixed This issue was fixed label Nov 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docs Improvements or additions to documentation kind/bug Some behavior is incorrect or out of spec resolution/fixed This issue was fixed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants