plain-vegetable-53232
09/24/2024, 4:24 PMvictorious-church-57397
09/24/2024, 8:49 PMpulumi up
has started, so no other invocations of pulumi up
can run against that stack.
as for rollback - you could write a wrapper script around pulumi up
so that it snapshots the state, executes pulumi up
, and if it fails, re-imports the state. you'd then need to execute pulumi up
again either in the script or manually to ensure the resources are configured in their previous stateplain-vegetable-53232
09/24/2024, 9:48 PMFor instance, you will need to manually configure secure access, encryption, and history, and devise your own concurrency control and recovery capabilities.
So I understand that I need to configure secure access, encryption at transit for s3 bucket, and pulumi up histories are stored by pulumi itself.
• So for recovery part, your idea is kinda okey, I need to think about this at ci/cd platform pipelines, like what kind of implementation that I can manage, like what kind of edge cases I can face with, so thanks for the idea though, I will think on it
• however by devise your own concurrency control
, I didn't understand what type of concurrency model they mean under the hood with pulumi cloud
. @victorious-church-57397 Do you have any idea ?victorious-church-57397
09/24/2024, 10:06 PMpulumi up
, but then again I’ve never used pulumi cloudvictorious-church-57397
09/24/2024, 10:07 PMplain-vegetable-53232
09/25/2024, 7:14 AMplain-vegetable-53232
09/25/2024, 7:22 AMpulumi refresh
and then you need to run pulumi up, because pulumi doesn't understand this. Are there any other scenarios like this, and how do you manage those type of scenarios in your CI/CD ?
Do you have a working, advanced work-flow ?victorious-church-57397
09/25/2024, 7:57 AMWhat do you think using pulumi OSS parts in production grade environment. Like since you don't use pulumi esc etc. So I think you lose some advantages,
how do you manage your secrets?i used to manage secrets by either: • storing them in github actions secrets and passing them to the pulumi program using environment variables • storing them in the pulumi stack as secrets • had an application secrets stack which would create entries in secretsmanager
I'm trying to understand where pulumi fall short, so I can handle those parts myself but after it I will directly check CI/CD part for Pulumi OSSin my opinion, pulumi doesn't "fall short" in comparison to any other open source IAC tooling. what specifically are you concerned about? at my last company, we used OSS pulumi for everything from sandbox through to production and the experience was great, and we never had any issues which were directly related to using pulumi
plain-vegetable-53232
09/25/2024, 7:59 AMAWS Classic
or AWS Native
api ?victorious-church-57397
09/25/2024, 7:59 AMFor example let's say if your resources has been manually changed or something happened. I think at those type of scenarios, you need to runyou shouldn't be manually updating your resources in a production environment. you could mitigate behaviours like this by giving engineers ReadOnly permissions in production environments, and have a BreakGlass role you can use if disaster strikes and you have to manually edit any resources. for sandbox/dev environments where things are changed manually frequently, you should just be able to runand then you need to run pulumi up, because pulumi doesn't understand this. Are there any other scenarios like this, and how do you manage those type of scenarios in your CI/CD ?pulumi refresh
pulumi refresh
/ pulumi up
from your local machine to fix up resourcesvictorious-church-57397
09/25/2024, 8:00 AMplain-vegetable-53232
09/25/2024, 8:04 AMplain-vegetable-53232
09/25/2024, 8:04 AMplain-vegetable-53232
09/25/2024, 8:10 AMvictorious-church-57397
09/25/2024, 9:26 AMi will try to implement a custom history and rollback development for our stack with using another s3 bucket, I will basically follow the idea you shared with mehonestly, i think that might be overkill - as long as you have a couple of environments for testing you should be fine, we never required a rollback mechanism. it would be cool to build though 🙂
victorious-church-57397
09/25/2024, 9:27 AMplain-vegetable-53232
09/25/2024, 9:52 AMplain-vegetable-53232
09/25/2024, 9:54 AMvictorious-church-57397
09/25/2024, 10:00 AMplain-vegetable-53232
09/25/2024, 10:17 AMvictorious-church-57397
09/25/2024, 10:19 AMplain-vegetable-53232
09/25/2024, 10:22 AMfierce-xylophone-92490
09/26/2024, 12:29 AMpulumigrunt
tool, the same way terraform had terragrunt
lol. In the early days before terraform supported dynamodb locking, terragrunt added that. Bookmarking state would be simillar.
I also really want to do a personal hackathon where I create a full-stack app that can visualize your pulumi stacks (similar to pulumi cloud) and give you convenience URLs to the various resources. My thinking is you could run it locally to visualize your local state, and make it deployable in your GCP/AWS/Azure account as a serverless function that can read your state bucket and give you the same visuals there. I struggle to leave AWS CDK because CloudFormation gives you a "stack catalog" for free. So this would approximate that.
Either of you down to try and hack a POC together? I was thinking React/TS for the frontend and Python for the backend--but could also do the whole thing in TS.victorious-church-57397
09/26/2024, 8:00 AM• Do you just use CI/CD actions of pulumi, any additional configs perhaps ? And what is your strategy for applying pulumi up, like do you trigger actions before merge(when PR opened) or after merge(when PR merged), and how do you mitigate the side effects(like if you use before merge strategy so you will end up with having different state then main branch so someone can have problem with state if they open a branch before you close merged it and for the after merge apply if your apply fails, how do you rollback, because you have a git state in main branch which is broken.i used github actions, but not the pulumi action. i just wrote a common action which all of our stacks could use (we followed a specific naming convention for stacks of
{env}-{repo-name}
. i had it configured so that when a PR was opened, one of the checks would be a pulumi preview
and you couldn't merge changes if that failed. after it was merged in, one of the steps would be to run pulumi up
to deploy our infrastructure/application changes. nothing should be making changes to your production environment besides CI/CD tooling. the only times we ever saw failures was in lower environments (sandbox, dev) where people had access to change things manually/from their laptops using pulumi. if we did have failures, it would be on the engineer who'd made the changes to fix up the dev environments. the only kind of failures we'd ever see in prod is if we were adding a new dependency on an output from one stack to another, and the dependent stack was attempted to be updated first.
• How do you apply versioning and release management? for example, at terraform, I was versioning my modules, and keeping their change logs and orchestrating to environments with these versions which was really important. So this is my question, like if you version, which part of your stack do you version, do you write custom resources and version only those and use stacks just for orchestrating purpose, or maybe something another strategy ? And how do you promote versions between different environments. Let's say you bring a new change to your eks resource and versioned it from 1.1.2 to 1.2.0 and applied it at dev environment, how do you promote to up to date version at other environments ?you can write pulumi components and publish them as libraries. i had numerous internal libraries published to github actions which we could then use across our estate to ensure consistency for configurations. we didn't version stacks, i'm not entirely sure this is possible out of the box and would likely require writing a specific tool to do this. the way i managed promoting versions was to have the environment deployments chained in a github action, where the later environment depends on the previous one. everything was deployed via CI/CD except from when developing against sandbox/dev
victorious-church-57397
09/26/2024, 8:00 AMvictorious-church-57397
09/26/2024, 8:02 AMplain-vegetable-53232
09/26/2024, 8:28 AMplain-vegetable-53232
09/26/2024, 8:28 AMplain-vegetable-53232
09/26/2024, 8:31 AMafter-merge-apply
, and if it fails in the main branch, then the developer who made the changes will fix it, I think using git revert
manually can help (actually I was thinking rollback mechanism for such cases, btw).
So basically, If I understood it correctly, you check which path has been changed, and depending on its name, you get the environment and repository information in a way that your workflow can parse and use to run in corresponding environment. Good idea!
2- I was thinking using pulumi components as well, actually I have a plan to do that and I want to ask you a couple of questions regarding on this
• How do you package your components (in a different repository such as modules repository like in terraform?)
◦ For the versioning part, actually component resource is the exact codebase I want to version, I think stacks are just for you know, orchestrating and they just provide environment specific information, and I think this is where I'm gonna use versions across different environments( let's say prod has 1.0.2 of eks component but in dev stack it's 1.0.4 etc)
• What kind of hierarchy do you use for this ?
◦ Monorepo or Multi repo
▪︎ I'm planning to use monorepo for convention and best productivity and actually really wonder about your thoughts here, I'm planning to store my public api(components) inside pkg folder like in this example structure -> https://github.com/ugurcancaykara/pulumi-workshop/tree/main/markdowns/large-scale-organization/centralized-example-3-for-go#an-example[…]t-structure
▪︎ There are two problem with this structure:
• How to version each component differently inside pkg folder in a monorepo structure(I was using release-please for monorepo path-based versioning at my terraform modules, it can work here as well)
• I'm not sure yet about how to maintain components for micro-stacks architecture -> this pattern -> https://github.com/ugurcancaykara/pulumi-workshop/tree/main/markdowns/large-scale-organization/centralized-example-2#micro-stacks
◦ For example, my core devops team can maintain the core services such as networking etc. but I may provide to developers another stack(which has more change ratio etc) and since they feel comfortable with Typescript, they may use this kind of structure, so I'm planning to work on this structure and wonder your thoughts about how to maintain multi-lang components together(it ok for just golang stack).plain-vegetable-53232
09/26/2024, 8:32 AMplain-vegetable-53232
10/02/2024, 7:15 AMvictorious-church-57397
10/02/2024, 7:47 AMfierce-xylophone-92490
10/02/2024, 9:05 AMAWS_PROFILE=xxx pulumi-ui up --state-uri <s3://bucket/>
(or point at ~/local/path/to/.pulumi-state
) now lets it actually browse the files.victorious-church-57397
10/02/2024, 9:06 AMfierce-xylophone-92490
10/02/2024, 9:07 AMvictorious-church-57397
10/02/2024, 9:07 AMfierce-xylophone-92490
10/02/2024, 9:07 AMvictorious-church-57397
10/02/2024, 9:07 AM