Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add exceptions for resources where the user needs to specify the API …
…version (#3985) Resolves #3524 This PR adds an exception for two resources where the `api-version` query parameter works differently. Here, the endpoints receiving the API version merely pass it on to another service, and it's meant to express the API version the second service should use. Therefore, our usual logic of auto-adding the API version doesn't work. The user must instead specify the API version for the second service. Example: ```go resources.NewResource(ctx, "acc", &resources.ResourceArgs{ ResourceProviderNamespace: pulumi.String("Microsoft.Storage"), ResourceType: pulumi.String("storageAccounts"), ApiVersion: pulumi.String("2022-09-01"), }) ``` The provider will make a request to the `resources` service (RP) here. The `resources` service will then in turn make a request to the Microsoft.Storage service. The API version is meant for the latter to receive, so we cannot use whatever API version we have as default for `resources.Resource`. This PR, specifically fixing `resource.Resource`, unlocks the creation of `GitHub.Network/networkSettings` and other resources that are not in the Azure spec. It will also allow users to use `Resource` as an escape hatch when there are problems with the provider schema. #2467 is closely related - it's just a matter of adding the `ApiVersion` property for _all_ resources, maybe with a different name. Potential improvement: the description _"The API version to use for the operation."_ for `ApiVersion` is not useful, we could replace it.
- Loading branch information