Hi everyone, transitioning to pulumi and need a li...
# general
m
Hi everyone, transitioning to pulumi and need a little help.. Whenever I do pulumi preview, in preview it show that it wants to delete the resources previously provisioned like a few mins back. When actually there's no change or drift in state of the resources. Any idea why this would be happening?
q
You should be able to see the changes it intends to make by passing
--diff
to the preview
m
@quaint-eye-38036 Tried this but this basically print out the same but show resources along with it's attributes. It also says "Preview failed: unable to delete resource" - since it's protected.
Not understanding why does it want to delete the previous resources..
q
May I know what resource it is?
m
RDS Cluster, it says that it's protected
q
Will you share the preview output?
m
Copy code
Type                                 Name                                Plan       Info
     pulumi:pulumi:Stack                  fc-pulumi-nodejs-playground-nodejs             1 error; 2 messages
 +   ├─ aws:alb:LoadBalancer              fc-shardul-prod-int-alb-01          create
 +   ├─ aws:alb:TargetGroup               fc-shardul-prod-int-tg-01           create
 +   ├─ aws:route53:Record                fc-shardul-alb                      create
 +   ├─ aws:alb:Listener                  fc-shardul-prod-int-listener        create
 -   ├─ aws:route53:Record                fc-shardul-rds-reader               delete
 -   ├─ aws:rds:ClusterInstance           fc-shardul-prod-int-node-0          delete
 -   ├─ aws:route53:Record                fc-shardul-rds-master               delete
 -   ├─ aws:route53:Record                fc-shardul-cache                    delete
 -   ├─ aws:elasticache:ReplicationGroup  fc-shardul-prod-int-cache           delete
 -   └─ aws:rds:Cluster                   fc-shardul-prod-int-rds             delete     1 error


Diagnostics:
  pulumi:pulumi:Stack (fc-pulumi-nodejs-playground-nodejs):
    Running for resource -> AWSALB
    [class AWSALB]

    error: preview failed

  aws:rds:Cluster (fc-shardul-prod-int-rds):
    error: Preview failed: unable to delete resource "urn:pulumi:playground-nodejs::fc-pulumi-nodejs::aws:rds/cluster:Cluster::fc-shardul-prod-int-rds"
    as it is currently marked for protection. To unprotect the resource, either remove the `protect` flag from the resource in your Pulumi program and run `pulumi up` or use the command:
    `pulumi state unprotect 'urn:pulumi:playground-nodejs::fc-pulumi-nodejs::aws:rds/cluster:Cluster::fc-shardul-prod-int-rds'`
q
I know you answered it but I see a combination of creation and deletion. Just to confirm, nothing has changed in the code, rit?
m
no nothing
q
Do these resource still exist?
m
the ones it's trying to delete are existing
Also if we make any changes to code.. it should not affect the state right?
it will always check the diff between actual and the state it stores, right?
q
Also if we make any changes to code.. it should not affect the state right?
That depends on the change.
it will always check the diff between actual and the state it stores, right?
It compares it with the state file. To update the state file, either run
pulumi refresh
or run preview with the
-r
option
What's the version of the CLI?
m
v3.50.2
I see mutiple plugin versions but -
Copy code
aws     resource  5.25.0   499 MB  1 week ago    6 days ago
aws     resource  5.20.0   442 MB  1 month ago   1 month ago
aws     resource  5.19.0   430 MB  2 months ago  2 months ago
docker  resource  3.6.1    39 MB   1 week ago    2 days ago
docker  resource  3.6.0    37 MB   1 month ago   1 month ago
docker  resource  3.5.0    37 MB   1 month ago   1 month ago
q
Did you start seeing this issue after updating the CLI?
m
not sure
testing things out with simple code now