https://pulumi.com logo
#getting-started
Title
# getting-started
m

magnificent-soccer-44287

02/24/2024, 6:24 PM
Hey again everyone šŸ¤© throughout our continued adoption of Pulumi, we've ran into something that may be a desired feature for many: ā€¢ Additional custom resource option 'changeset' (name up for grabs, obvi) ā—¦ In essence, users could specify "pulumi up --changeset awsNetworking" or "pulumi up --changeset kubernetes" or "pulumi up --changeset fargate", etc. ā—¦ This would update only the resources tagged with that changeset name in the custom resource options, for example:
Copy code
const dockerImage = new docker.Image('pulumiDockerImage', { build: {}, ... }, { dependsOn: [someNetworkingResource], changeset: ['fargate'] }
ā€¢ This could be made, for example, to only update the resources tagged in current changeset as well as their downstream and upstream chain of "dependsOn" related resources. We've gotten into a pattern of splitting stacks in often logically/architecturally sub-optimal ways to manage our individual deployment scope, speed, complexity. This may involve notable design consideration/rigor to pull of in a safe manner but I do think it would be a feature valuable to MANY customers. Especially if it was coupled with a folder and file based 'checksum' resource to control what changesets should be automatically applied. For example:
Copy code
const fargateRelatedGitRepoFiles = new pulumi.Changeset('pulumiChangeset', { name: 'fargate', includedFiles: [WHITELIST], excludedFiles: [BLACKLIST] })
Additional food for thought implementation pattern: ā€¢ Create pulumi.Changeset resource -> only update things that list it in their 'dependsOn' as well as their upstream and downstream 'dependsOn' chains (eliminate CLI flags entirely) ā—¦ For example, if no defined changeset is active, we could just fall back to deploying everything (once again consideration/rigor design choice to be fleshed out)
l

little-cartoon-10569

02/25/2024, 1:00 AM
I think projects are used for exactly that purpose. If you want to deploy "awsNetworking", then you have an "awsNetworking" project. The only thing this doesn't handle is when one resource might fit into multiple changesets. But that's probably a good thing, since that would mean that one resource could be destroyed via multiple different changesets, which would each have different resources dependent on that resource, which would lead to different results depending on what command you used to delete that one resource. Which would be bad šŸ™‚
m

magnificent-soccer-44287

02/25/2024, 6:22 AM
Maybe I'm missing something; how do projects help manage this?
We have cases where we have 2/3/4/5+ projects per repo (domain driven design) and it is a massive PITA because we had to write our own CICD hash checks to see which ones should be triggered based on a merge.
To your point, it's definitely not pulumi's responsibility to address this pain point šŸ˜‚ it would be a really nice add-on though