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

Auto-generate per-language dependencies for referenced schema types #279

Open
danielrbradley opened this issue Sep 25, 2024 · 0 comments
Open
Labels
kind/enhancement Improvements or new features

Comments

@danielrbradley
Copy link
Member

When using a type from an external SDK, dependencies must be manually added via the Metadata.LanguageMap for each language in order for the SDKs to be buildable.

Adding a resource property such as:

	Password *random.RandomPassword `pulumi:"password" provider:"[email protected]:index/randomPassword:RandomPassword"`

Generates a schema property such as:

        "password": {
          "$ref": "/random/v4.8.1/schema.json#/resources/random:index%2FrandomPassword:RandomPassword"
        }

There is no "language" section present to the schema.

Each SDK is missing a reference to the Random package:

  • dotnet should reference Pulumi.Random
  • nodejs should reference @pulumi/random
  • python should reference pulumi-random

This might also be implementable directly in each language instead by collecting all external references.

Workaround

Within the infer.Provider call, add Metadata. E.g. for dotnet, we could add:

		Metadata: schema.Metadata{
			LanguageMap: map[string]any{
				"dotnet": map[string]any{
					"packageReferences": map[string]string{
						"Pulumi.Random": "4.8.1",
					},
				},
			},
		},
@danielrbradley danielrbradley added the kind/enhancement Improvements or new features label Sep 25, 2024
@pulumi-bot pulumi-bot added the needs-triage Needs attention from the triage team label Sep 25, 2024
@danielrbradley danielrbradley removed the needs-triage Needs attention from the triage team label Sep 25, 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