This message was deleted.
# aws
s
This message was deleted.
s
Do you mean “pulumi destroy”? Without knowing more, i could say that “pulumi stack rm -f” will destroy the stack without changing/deleting the resources. But to better answer your question, what’s your use case?
a
Each user in my system will have own stack in Pulumi, which will translate to EC2 instance, Route 53 sub-domain setup and database schema in RDS. Once, I create user stack, user will have own database schema. And here comes the catch - user says that he is no longer willing to use my product, but after a week says -
Sorry I was wrong, I will keep use your product
. Due to cost savings I might do
pulumi down -s <user_stack>
, but would like to keep database schema and user untouched. With current usage, it removes everything from DBS as well. Example of current implementation
Copy code
database = mysql.Database(
    "user_database",
    name=data.get("db_name"),
)

user = mysql.User(
    "database_user",
    user=data.get("db_user"),
    host="%",
    plaintext_password=data.get("db_password"),
)

mysql.Grant(
    "database_user_privileges",
    user=user.user,
    host=user.host,
    database=database.name,
    privileges=[
        "CREATE",
        "SELECT",
        "UPDATE",
        "REFERENCES",
        "DELETE",
        "INSERT",
    ],
)
s
There's the `RetainOnDelete` option but keep in mind that:
If a retained resource is deleted by Pulumi and you later want to actually delete it from the backing cloud provider you will either need to use your provider’s manual interface to find and delete the resource, or import the resource back into Pulumi to unset
retainOnDelete
and delete it again fully.
Similarly, you'll also have to import the resource into Pulumi if the customer changes their mind
a
Thanks for input. Will look into it 🙂
p 1