This message was deleted.
# general
s
This message was deleted.
l
Two rules for deploying infra resources from IaC: 1. Always preview it manually or in your pull request. Ensure that resource changes are considered part of the review. Don't click Accept until you're happy with the resources that are changing. 2. Protect (opt
protect: true
, https://www.pulumi.com/docs/intro/concepts/resources/options/protect/) DB instances and anything else that must not be deleted without triple-checking.
r
Thanks for the info. The question is more about how I can keep my same database when deploying
deploying a stack with a new database is not going to be useful
l
These rules are what you use to prevent accidentally deleting the database. Once you detect that, you can figure out why it's being deleted.
In this case, there are two possible reasons, and likely both are true: 1. The name/db_name property may be marked as "force replace". That is, any change here cannot be supported by the provider, and it has to delete the resource and recreate it. 2. In addition to changing the property, you also changed the Pulumi name (1st parameter). This is interpreted by Pulumi as being an entirely new resource: you have removed the old resource from your code and added a new one (that happens to be identical). So Pulumi is just carrying out your wishes.
r
Yes, I understand that I should not change the name, but the "name" field was deprecated.
said to use "db_name"
which caused the issue
regarding #1, I have been deploying without this problem until the "name" was deprecated in favor of "db_name"
Here are some more logs to show the problem
This is if I have both "name" and "db_name"
error: awsrds/instanceInstance resource 'grafana-svc-persistence-rds' has a problem: Conflicting configuration arguments: "name": conflicts with db_name. Examine values at 'Instance.Name'. error: awsrds/instanceInstance resource 'grafana-svc-persistence-rds' has a problem: Conflicting configuration arguments: "db_name": conflicts with name. Examine values at 'Instance.DbName'.
If i use just "name"
warning: name is deprecated: Use db_name instead
if I use just db_name
database and data see you in the next life
l
At a guess, you're going to have to live with the deprecated field warning for now, if you want to avoid destroying the resource. You could try adding the
ignoreChanges
opt to see if it works (using
pulumi preview
), but I'm not optimistic: I'd bet this is a provider-level (AWS/RDS) change, not within Pulumi's ability to influence...
b
hey @rapid-eve-24229 - really sorry for the issues you experienced here. I just sent an email to follow up as well. This deprecation is indeed a frustrating (it’s actually driven by an upstream API we have no control over) and we’re sorry you ended up losing data. @little-cartoon-10569 is indeed correct, you can set the property correctly and then use
ignoreChanges
to remove the deprecation warning one question: did you get any feedback from the CLI that it was going to replace your database? Is there anything we could have done to improve that to make it clear your database was going to be removed?