-
Notifications
You must be signed in to change notification settings - Fork 14
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
Zero Trust resources renaming #985
Comments
Hey @notdodo. Thanks for the question. If I understand you correctly, you'd like to change your existing resources, which are now deprecated, like https://www.pulumi.com/registry/packages/cloudflare/api-docs/accesspolicy/ to the new resources like https://www.pulumi.com/registry/packages/cloudflare/api-docs/zerotrustaccesspolicy/. I think your best bet would be to delete the existing resources and import them as the new resource type. Hope that helps, let me know if you need any more help here! |
Yes, exactly.
That's what I feared. What about big projects with already lots of resources? |
Thanks for flagging this up @notdodo. I'll discuss with the team how we can help with the migration |
@notdodo The best way to migrate now is with aliases: Old: name: dev-yaml
runtime: yaml
resources:
network:
type: cloudflare:AccessPolicy
properties:
decision: allow
name: my-policy
accountId: ******************
includes:
- everyone: true New: name: dev-yaml
runtime: yaml
resources:
network:
type: cloudflare:ZeroTrustAccessPolicy
properties:
decision: allow
name: my-policy
accountId: ******************
includes:
- everyone: true
options:
aliases:
- "urn:pulumi:dev::dev-yaml::cloudflare:index/accessPolicy:AccessPolicy::network" Languages besides YAML allow type level aliases, so you don't need to worry about the full URN: cloudflare.ZeroTrustAccessPolicy("network",
decision="allow",
name="my-policy",
account_id="*******************",
includes=[{"everyone": true}],
opts=pulumi.ResourceOptions(aliases=[pulumi.Alias(type_="cloudflare:index/accessPolicy:AccessPolicy")])) The best option to migrate eventually is with provider level type aliases. We have the ability to add type aliases (like in the python example) at the provider level, so you don't need to bother. You can just change the resource type and it will work. |
If cloudflare has changed the arguments to these resources or their semantics, then migration will be trickier. |
Hey @iwahbe thank you! didn't know was possible to alias also a resource type; we'll look into it 🙏 |
Let's leave it open to track #986. |
Hi,
Cloudflare TF provider deprecated the Zero Trust resources (e.g. AccessPolicy, AccessServiceToken, AccessApplication) with a new ZeroTrust prefix.
Obviously when changing the resource on a Pulumi project the outcomes are to recreate the resources.
What do you suggest for avoiding the delete and create of these resources?
The text was updated successfully, but these errors were encountered: