I'm not aware of a test or policy that exists that does that, but there's nothing stopping you from doing that. A policy would be very appropriate, but a unit test might be easier. And it would pick things up sooner, since the policy doesn't get applied until
up
.
r
rough-rain-68282
10/26/2021, 5:44 AM
hi @little-cartoon-10569 , thanks for your suggestion, I was trying out with Policies here, I could see they tend to fail if conditions are not met in pulumi preview, do you think that will not always work? I was more keen in policies as I am looking to make sure the new state would not break before deploying by doing pulumi up.
l
little-cartoon-10569
10/26/2021, 6:30 AM
You can run policies on up only, or on certain stacks only. Some features of policies are only for certain Pulumi paid plans, but I think you can get protection from breaking custom rules in certain stacks on
pulumi up
.
little-cartoon-10569
10/26/2021, 6:31 AM
However the only policy I currently use is the Pulumi-provided AwsGuard. I run it always, and I have forgotten what little I knew about policies, long ago 😞
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.