This message was deleted.
# general
s
This message was deleted.
a
Doesn't
pulumi preview --diff
work for this case?
I understand I'm not answering your precise question, but I thought that maybe you're looking for something simpler.
n
pulumi preview --diff
compares current pulumi program against the current state of the stack. This is useful and necessary, but I additionally want to have something else:
Copy code
git checkput sunnyday
pulumi dumptostack -o /tmp/sunnyday.stack
git checkput rainyday
pulumi dumptostack -o /tmp/rainyday.stack
pulumi diffstacks /tmp/sunnyday.stack /tmp/rainyday.stack
or (which would probably fit into pulumi model more realistically):
Copy code
pulumi stack init fake-rainyday
git checkput rainyday
pulumi fake-up --yes
git checkput sunnyday
pulumi preview -s fake-rainyday --diff
Rationale for this feature is to introduce policies / automatic checks on changes made to the pulumi programs, and have them validated enforced in pull requests which modify pulumi programs. I view policy decision making as a function of a change in the goal state not a function of a difference between goal state and a current state of the system.
here's my hacky attempt to do it, but I'd like something cleaner and prettier in terms of output:
Copy code
pulumi stack init empty-stack
git checkout rainyday
pulimi preview --diff -s empty-stack > /tmp/rainy.txt
git checkout sunnyday
pulimi preview --diff -s empty-stack > /tmp/sunny.txt
diff -p /tmp/{rainy,sunny}.txt
a
But are you storing your stacks inside git, too?
Actually, nevermind. I've just noticed you're creating an empty stack just for diffing.