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

[stack tag] Using retainOnDelete for stack tag resource in Pulumi Service provider causes you to get stuck. #392

Open
MitchellGerdisch opened this issue Aug 21, 2024 · 3 comments
Labels
kind/bug Some behavior is incorrect or out of spec
Milestone

Comments

@MitchellGerdisch
Copy link

What happened?

Using the code provided below and executing the following steps causes one to get stuck:

  • pulumi up
  • see stack tag
  • pulumi destroy
  • see stack tag is still there due to retainOnDelete option
  • pulumi up
  • Get 400 error about trying to create a tag that is already there.
  • Since there is no way to delete a stack tag in the UI, one is stuck - short of using the API to delete the tag.
import * as pulumi from "@pulumi/pulumi";
import * as pCloud from "@pulumi/pulumiservice"

const stackTag = new pCloud.StackTag("my-stack-tag", {
  organization: pulumi.getOrganization(),
  project: pulumi.getProject(),
  stack: pulumi.getStack(),
  name: "stacktag",
  value: "stacktagvalue"
}, {retainOnDelete: true})

Example

See above

Output of pulumi about

CLI
Version 3.128.0
Go Version go1.22.5
Go Compiler gc

Plugins
KIND NAME VERSION
language nodejs unknown
resource pulumiservice 0.23.2

Host
OS darwin
Version 13.6.9
Arch x86_64

Backend
Name pulumi.com

Dependencies:
NAME VERSION
@pulumi/pulumi 3.129.0
@pulumi/pulumiservice 0.23.2
@types/node 18.19.45
typescript 5.5.4

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@MitchellGerdisch MitchellGerdisch added kind/bug Some behavior is incorrect or out of spec needs-triage Needs attention from the triage team labels Aug 21, 2024
@cleverguy25 cleverguy25 removed the needs-triage Needs attention from the triage team label Aug 23, 2024
@cleverguy25 cleverguy25 added this to the 0.111 milestone Aug 23, 2024
@komalali
Copy link
Member

@MitchellGerdisch can't you import it and the delete it? What is the handling you would expect?

@MitchellGerdisch
Copy link
Author

The use case is I have a stack that configures the stack tag for itself.
The stack is then destroyed, but I want to keep the stack tag on the destroyed stack - and so use the retainOnDelete option.
And, then, later, I run pulumi up to rebuild the stack and I can't because the API is upset about the tag already existing.
So I would prefer that the API accept the request to (re)create the tag even if it already exists.
This is consistent with other pulumi service resources like deployment settings.

Importing and deleting is not really a viable option here given the use-case since the stack may be destroyed and upped multiple times - say due to a schedule that destroys at night and deploys in the morning.

@komalali
Copy link
Member

Unfortunately, I don't think this is possible currently. This sounds like an instance of pulumi/pulumi#3388. Since the tag and value itself is the uniquely identifying property of the StackTag, there is no support in pulumi for this behavior today (but perhaps soon).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

No branches or pull requests

3 participants