-
Notifications
You must be signed in to change notification settings - Fork 37
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
Specify custom API version on resources #2467
Comments
resolves #1877 |
@danielrbradley the "resource doesn't exist in the SDK" case is covered by #68. Whereas #1877 is explicitly about API versions - although the semantics of the use case may differ. We should clarify this. |
@thomas11 ah yes your right - custom resource providers meaning API versions we don't support. |
Discussion points with @mikhailshilkov
|
Added to epic https://github.com/pulumi/home/issues/3552 |
I would advocate for closing this ticket in favor of: #68 Is anyone able to provide a use case that would really be solved by adding an override api version? |
TODO: Re-spec this as a hidden escape hatch accessible via transforms. |
Updated designOne of the selling points of our Azure Native provider in v1 was to give complete access to the Azure API surface - including every API version. In v2 we had to remove some of these explicit versions due to the SDK size being too large. However, there is still need for users to be able to access all API versions even if the version is not specifically listed in the SDK. We are considering adding an output-only property for In addition to the API version being customised, occasionally the schema for fields is incorrect or incomplete either due to a schema generation bug, an aspect of OpenAPI not being expressible in Pulumi Schema or the specifications being wrong or incomplete. In these scenarios it would be benificial for the user to be able to manually tweak the fields via use of the Example issuesTherefore, we are proposing leveraging transforms for an 'escape hatch' for users needing to customise the request being sent to Azure's APIs. Technical details
ExampleCreate a Dataset, but use a specific version and specify the const vpc = new Dataset("vpc", {...}, {
transforms: [args => {
return {
props: {
...args.props,
apiVersion: "2018-06-01",
typeProperties: {
schema: {
value: "@dataset().SchemaName",
type: "Expression"
},
table: {
value: "@dataset().TableName",
type: "Expression"
}
}
},
opts: pulumi.mergeOptions(args.opts, { ignoreChanges: ["tags"] })
}
}],
}); |
Hello!
Issue details
In version 2 of the provider we're removing selected resources to reduce SDK size where the next version of the resource is compatible with the previous verion. In theory API behaviour can vary between versions and a user might want to use a specific version.
To ensure that the provider allows a user to interact with the full Azure surface area, we could add a string
ApiVersion
field to all resources which would allow the same SDK class to be used with other versions.Initially this could be just a string field but could also be implemented to include an enum of known versions for that resource.
If the user specifies an invalid API version or a version that's incompatible with the resources shape of the SDK resource class then errors would just be propegated by the Azure API - we would not validate this. We could also consider disabling validation of properties if the version is specified in case transformations are also being used to manipulate the shape of the payload.
Affected area/feature
Use cases
The text was updated successfully, but these errors were encountered: