Major Pulumi Deployments update shipped today, com...
# pulumi-deployments
l
Major Pulumi Deployments update shipped today, complete with overhauled documentation. Happy to answer any questions ya'll may have! https://pulumi-community.slack.com/archives/CB36DSVSA/p1680103635675449
d
Amazing! Thank you! Question: if I’ve already set up Pulumi Deployments via the UI, is there a smooth way to transition to the Pulumi Service Provider in code? Or do I just need to recreate the settings, delete them manually from the UI, and then
pulumi up
the new stack with the deployment settings?
(Just following up here)
And is this available in the python
pulumi_pulumiservice
package yet?
or is it only TS?
l
@dry-journalist-60579 the provider update did not end up making it in before the blog post went out yesterday. Our apologies for that! The provider should be ready next week. You can follow this PR https://github.com/pulumi/pulumi-pulumiservice/pull/122 and this issue https://github.com/pulumi/pulumi-pulumiservice/issues/97 to get notifications.
We expect that you should be able to run
pulumi import
to import existing stack settings that have been configured through the UI.
d
ah, amazing, thank you!!
will keep an eye out
c
Woo! We just started using deployments last week.
r
@dry-journalist-60579 we just shipped the ability to define deployment settings in code in the latest version of the pulumiservice provider. Here's an example in python: https://github.com/pulumi/pulumi-pulumiservice/blob/main/examples/py-deployment-settings/__main__.py It's also possible to import existing settings using
pulumi import pulumiservice:index:DeploymentSettings my_settings [org]/[project]/[stack]
I need to update the docs still to add the import information but wanted to get this in your hands to take it for a spin.
d
Amazing! I’ll check it out next week. Thank you for the update!
Would you create a separate stack to define all the DeploymentSettings for every other stack or embed the DeploymentSettings within each stack that will be using Pulumi Deployments? CC @red-match-15116
r
You can do either! Internally, we have one stack that manages all deployment settings (including its own).
d
Sweet, thank you!
l
If you'd be interested we could write a blog post about it and open source the template that we created for internal use.
d
That sounds like a good post 🙂
@red-match-15116 I’m trying to figure out how to import the Deployment configuration… Let’s say I have a stack
project-1/stack-1
and I’m trying to import that stack’s deployment configuration into a one-stack-that-manages-all-deployments called
deployments/prod
. What would the import command look like? I’m getting:
Copy code
` error: Preview failed: unknown resource type 'pulumiservice:index:DeploymentSettings'`
Oh, I think I need to install
pulumi-pulumiservice
🙂
(yup, ok, sorry about that!)
r
heh no worries! sounds like you got it working?
d
Yup, like a charm! Thank you again!
@red-match-15116 do you somehow automatically detect all the other projects/stacks in your org and iterate over them to create deployment settings or do you just explicitly define each one? Right now I’m going with the latter, but I’m just curious.
image.png
r
Currently we are explicitly defining each one (we have 1000s of stacks and only a subset are using deployments), but you might be able to use the ListStacks API endpoint to get a list of stacks and iterate over them if you wanted to.
d
1000s of stacks
Daaaaaaaamnnn, I’d be scared to see Pulumi’s Pulumi bill :)