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

Pulumi should automatically deleteBeforeReplace when it is required #190

Open
nesl247 opened this issue Jul 31, 2019 · 7 comments
Open

Pulumi should automatically deleteBeforeReplace when it is required #190

nesl247 opened this issue Jul 31, 2019 · 7 comments
Assignees
Labels
kind/enhancement Improvements or new features resolution/fixed This issue was fixed

Comments

@nesl247
Copy link

nesl247 commented Jul 31, 2019

There are certain resources, such as GlobalAddress, VPNTunnel, etc. that have certain properties that require them to be replaced rather than updated. When this occurs, Pulumi should automatically deleteBeforeReplace rather than requiring the user to add deleteBeforeReplace: true. This is because it is the job of Pulumi to automatically handle all of this, and should not be on the user to know which properties cause which resources to need this, and then have to remove the flag after.

My suggestion would be to introduce a warning when this occurs as I am pretty sure the reason this isn't done today is that it could cause downtime. However, if the user is accepting the changes, it should execute as expected rather than breaking and requiring manual intervention.

@lukehoban
Copy link
Contributor

Could you share an example of a specific resource and change to that resource where you think we should default to delete-before-replace?

@lukehoban lukehoban self-assigned this Aug 1, 2019
@lukehoban lukehoban added the kind/enhancement Improvements or new features label Aug 1, 2019
@nesl247
Copy link
Author

nesl247 commented Aug 1, 2019

With the VPNTunnel the localTrafficSelectors property should cause delete-before-replace.

@NinoFloris
Copy link

With GKE private clusters the cluster gets into a terminal state if you don't do delete before replace.
That's because it'll notice a peering range overlap for the master ip cidr range.

@hermanbanken
Copy link

Same for IAM members. I'm seeing those getting "import-replace", where they are first replaced in the stack and then "delete-original" runs, which effectively deletes it from the Project IAM 🤦 , leaving you with a stack where they exist. Only way to fix that is refresh + up again.

@lukehoban
Copy link
Contributor

I'm seeing those getting "import-replace",

Are these resources you brought in via pulumi import?

Same for IAM members.

Do you mean specifically UserGroupMembership or GroupMembership? A few other IAM resources are already marked as DeleteBeforeReplace: true by default, and I suspect you are right that these should be as well.

@hermanbanken
Copy link

We import them via importId because we are talking about around 30 resources (per stack instance, of which we currently have 4) and don't want to do this by hand.

Both the resource urn format and the import id are not easily guessable, so writing that in code (where it can be documented) is much preferred over telling users to do it using the cli.

I was talking about project.IAMMember. As it is giving us much headaches I'm gonna try to use IAMPolicy instead tomorrow.

Downside of that is that we need to load the existing user roles (vs the SA roles we're trying to manage) and merge them via code. That additional code complexity is much preferable over unexpected / works-on-your-machine-but-not-on-mine bugs. Sadly.

Will try to keep you guys posted whether that fixes our issues or if it has similar issues.

@jcalderin
Copy link

@hermanbanken 3 years later... im suffering this IAMMember. Did you end up using policies? I want to avoid that, but i guess the real problem is that when delete-original of member is deleting everything, could be a bug?

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 resolution/fixed This issue was fixed
Projects
None yet
Development

No branches or pull requests

8 participants