echoing-battery-61643
06/04/2025, 5:26 PMmodule "consul" {
source = "github.com/hashicorp/example?ref=v1.2.0"
}
Is there something similar in pulumi? Does this make sense to do or am i trying to follow too closely to what i have done in Terraform?
I have found Pulumi Components: https://www.pulumi.com/docs/iac/using-pulumi/extending-pulumi/build-a-component/#sharing-via-git. This gets me most of the way there but i still have to run a
pulumi package add <repo_url>@<release-version>
Which means i have to run this command and the CI/CD pipeline has to run it as well. This would mean adding a script that runs this command with the version? So the person updating it would have to update the version here? Not the worst thing but the workflow seems to be just a little off as in it is making the user look into another file that is not a Pulumi file to update a version number.
Other notes:
• i am only using python
• I dont want to publish these publicly. Not that there are any secrets or proprietary things in it. For now, we dont want to spend time to make it publicly consumable.little-cartoon-10569
06/04/2025, 8:42 PMlittle-cartoon-10569
06/04/2025, 8:47 PMWhat is the recommended way to promote code from one environment to another, for example from dev to stage then to prod?There is no single answer to this. A "downside" of Pulumi being built on general purpose languages is that there's no real limit to the ways it can be used. I would caveat that by saying it's not managed in the same way as some SaaS solutions which actually promote environments or the code on them (that is,
dev -> prod
): everything is just code repository -> target environment
. It uses the (more common?) concept of "build once, deploy many times", and therefore, deploying from git tags or something like that is how people usually achieve environment promotion.little-cartoon-10569
06/04/2025, 8:49 PMlittle-cartoon-10569
06/04/2025, 8:51 PMechoing-battery-61643
06/04/2025, 9:43 PMpulumi/aws/eks
├── Pulumi.dev.yaml
├── Pulumi.prod.yaml
├── Pulumi.stage.yaml
├── Pulumi.yaml
├── deploy-dev.sh
├── deploy-prod.sh
└── deploy-stage.sh
Pulumi project file and stack files. Then a script for deployment into the env would contain something like:
#!/bin/bash
GIT_TAG=v0.0.1
# clone out the repo
git clone --branch $GIT_TAG <https://github.com/my-repo/temp1.git>
cd /to/the/path/of/this/deploy
pulumi up --stack prod --yes
Is that what you were thinking about @little-cartoon-10569?famous-ambulance-44173
06/04/2025, 9:52 PMlittle-cartoon-10569
06/04/2025, 9:52 PMlittle-cartoon-10569
06/04/2025, 9:52 PMlittle-cartoon-10569
06/04/2025, 9:53 PMechoing-battery-61643
06/04/2025, 10:09 PMpulumi package add <https://github.com/ManagedKube/temp1.git/vpc@0.0.0>
Which downloads the yaml with more information in it and this is my Pulumi.yaml file for the project:
name: vpc
description: A VPC
runtime: yaml
packages:
vpc: <https://github.com/ManagedKube/temp1.git/vpc@0.0.0>
resources:
vpc:
type: vpc:Vpc
properties:
vpcName: test-test-vpc
cidrBlock: 10.9.0.0/16
igwName: my-igw
tagsAdditional:
github_repository: my-repo
github_repository_path: "infra/aws/40-vpc"
outputs:
vpc_id: ${vpc.vpcId}
• It seems you can only use the packages
key in a Pulumi Project file and not in the stack files
• Even with the package named off in the Pulumi.yaml file, you still have to run pulumi package add ....
to get it to download the package
I am trying to use github actions (similar to any other pipelining CI/CD tool). However with this workflow the official Pulumi action (https://github.com/pulumi/actions) doesnt support the pulumi package add
command. I havent tried it yet, just looking at the docs. If it doesnt "just work", i would have to go and do something custom. Not the worst thing but it would be another thing i would have to maintain.
I was just hoping there was a cleaner solution.famous-ambulance-44173
06/05/2025, 3:00 PMechoing-battery-61643
06/05/2025, 11:03 PMpulumi package add <https://github.com/dmfigol/pulumi-aws-vpc-python@0.0.0-x9bc475e6cbf54f2baa2b0d2575fceee3a80acffb>
famous-ambulance-44173
06/06/2025, 7:05 AMpulumi package add <https://github.com/dmfigol/pulumi-aws-vpc-python>
and resulted in what you saw in yamlechoing-battery-61643
06/06/2025, 5:12 PMfamous-ambulance-44173
06/06/2025, 5:13 PM@ref
at the endechoing-battery-61643
06/06/2025, 5:14 PM