'use strict' const pulumi = require('@pulumi/pulum...
# getting-started
'use strict' const pulumi = require('@pulumi/pulumi') const aws = require('@pulumi/aws') const awsx = require('@pulumi/awsx') // Create an AWS resource (S3 Bucket) const bucket = new aws.s3.Bucket('my-bucket', { tags: { Name: 'My bucket', Environment: 'Dev', }, }). I am new to pulumi from Terraform. I have above code to create a S3 bucket once after created the bucket with pulumi up, I've manually changes the configurations of S3 in the console like enabling versioning and enable the public access. After make the changes in the console when I give pulumi up again it showing no changes made, but it should disable the versioning and public access as we don't have any configuration code to enable versioning and public access in the pulumi code. State file also won't have the configurations related to enabling public access and versioning so it should show two changes to made and should disable both option but why it is not showing as no changes made.
Pulumi doesn't know about changes to its managed resources unless you tell it to go look for them. Use
pulumi up --refresh
pulumi refresh
won't pulumi refresh the state for every pulumi up command like terraform refreshing it state on each terraform apply and terraform plan commands.
In terraform if I modify the versioning through console and give terraform apply without modify the terraform configuration as per the changes that we done through console it will revert the change that we have done in the console to match the configuration defined in the terraform. Won't this behaviour applicable to Pulumi
You can make it that way by adding the
parameter, but in general, that's not what people want. We want to be able to see what the difference between source and state is, without worrying about cloud. When it comes time to check against cloud, we can do that.
Understood. So we can take this as one of the difference from terraform right.
One of the differences, yes. Not as big a difference as plans (and the lack thereof). Both are improvements, at least from my point of view! :)
I dislike this default so I always add
refresh: always
in my
project files to make sure the state is refreshed. This will of course slow down Pulumi operations but that's a price I'm willing to pay.
Copy code
  refresh: always