You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm wondering if there a pulumi native solution to the following problem:
I have blue/green deployment set up using s3 buckets for a static website green_bucket for green builds and main_bucket for the live app
I have provisioned appropriate long-lived infra for this, Lambda@Edge, certs etc.
Now I want the following behaviour
When i run pulumi up it assumes a green build, and places my app files (/dist/app-green/...) into the green_bucket
When I run BLUE_GREEN_CONTEXT=blue pulumi up I want the files from /dist/app/.. to go into the main_bucket
Now the problem is that because pulumi is essentially using GitOps here, the "state" of my infra is determined by conditional logic in my pulumi files
BLUE_GREEN_CONTEXT=blue will cause my green_bucket files to be deleted
BLUE_GREEN_CONTEXT=green will cause my main_bucket files to be deleted
e.g when I run pulumi up any conditional logic I have in my pulumi file to put the content into the green bucket, will now cause the blue bucket objects to be deleted
if greenBuild
s3.Object(green)
elsse
s3.Oject(blue)
Potential workaround
One pulumi native solution I have considered is having blue and green builds always deployed, so there would be no conditional logic in my pulumi files.
But this is quite hacky and error prone, it would involve storing the last successful blue build artifacts and pulling them down on my CI just to mantain the status quo in the main_bucket while performing a build on the green bucket
What I'm going to do in the meantime
I'm just going to remove all s3.Object calls and deploy using aws s3 CLI
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I'm wondering if there a pulumi native solution to the following problem:
I have blue/green deployment set up using s3 buckets for a static website
green_bucket
for green builds andmain_bucket
for the live appI have provisioned appropriate long-lived infra for this, Lambda@Edge, certs etc.
Now I want the following behaviour
pulumi up
it assumes a green build, and places my app files (/dist/app-green/...
) into the green_bucketBLUE_GREEN_CONTEXT=blue pulumi up
I want the files from/dist/app/..
to go into the main_bucketNow the problem is that because pulumi is essentially using GitOps here, the "state" of my infra is determined by conditional logic in my pulumi files
BLUE_GREEN_CONTEXT=blue
will cause mygreen_bucket
files to be deletedBLUE_GREEN_CONTEXT=green
will cause mymain_bucket
files to be deletede.g when I run
pulumi up
any conditional logic I have in my pulumi file to put the content into the green bucket, will now cause the blue bucket objects to be deletedPotential workaround
One pulumi native solution I have considered is having blue and green builds always deployed, so there would be no conditional logic in my pulumi files.
But this is quite hacky and error prone, it would involve storing the last successful blue build artifacts and pulling them down on my CI just to mantain the status quo in the
main_bucket
while performing a build on the green bucketWhat I'm going to do in the meantime
I'm just going to remove all s3.Object calls and deploy using
aws s3
CLIBeta Was this translation helpful? Give feedback.
All reactions