<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0"><channel><title>Pulumi Blog: CLI</title><link>https://www.pulumi.com/blog/tag/cli/</link><description>Pulumi blog posts: CLI.</description><language>en-us</language><pubDate>Fri, 21 Nov 2025 00:00:00 +0000</pubDate><item><title>All Pulumi CLI flags are now supported as environment variables</title><link>https://www.pulumi.com/blog/controlling-the-cli-through-environment-variables/</link><pubDate>Fri, 21 Nov 2025 00:00:00 +0000</pubDate><guid>https://www.pulumi.com/blog/controlling-the-cli-through-environment-variables/</guid><description>
&lt;img src="https://www.pulumi.com/images/generated/blog/controlling-the-cli-through-environment-variables/index.png" /&gt;
&lt;p&gt;With the release of &lt;a href="https://github.com/pulumi/pulumi/releases/tag/v3.208.0"&gt;Pulumi v3.208.0&lt;/a&gt;, all CLI flags can now be configured as environment variables. This addresses a common friction point of having to remember the same flags across multiple commands and of ensuring that your entire team uses consistent CLI options.&lt;/p&gt;
&lt;h2 id="use-cases"&gt;Use cases&lt;/h2&gt;
&lt;p&gt;An example use case might be that you want to always refresh state before operations, or re-run programs during refresh and destroy (using &lt;a href="https://www.pulumi.com/blog/improved-refresh-destroy-experience/"&gt;&lt;code&gt;--run-program&lt;/code&gt;&lt;/a&gt;). But remembering to add &lt;code&gt;--refresh&lt;/code&gt; every time is tedious.&lt;/p&gt;
&lt;p&gt;Another example is you&amp;rsquo;re working on a specific subset of your infrastructure and need to pass the same &lt;code&gt;--target&lt;/code&gt; or &lt;code&gt;--exclude&lt;/code&gt; flags repeatedly across multiple operations.&lt;/p&gt;
&lt;p&gt;You&amp;rsquo;re working in a CI environment where you want to skip interactive prompts and previews. That means adding &lt;code&gt;--yes&lt;/code&gt; and &lt;code&gt;--skip-preview&lt;/code&gt; to every single command in your pipeline.&lt;/p&gt;
&lt;p&gt;The usual workaround, if there is no env var already, is writing wrapper scripts or shell aliases, but these become another thing to maintain and share across your team.&lt;/p&gt;
&lt;h2 id="how-it-works"&gt;How it works&lt;/h2&gt;
&lt;p&gt;Any CLI flag can now be set as an environment variable. The naming convention is straightforward: prefix the flag name with &lt;code&gt;PULUMI_OPTION_&lt;/code&gt;, and convert dashes to underscores.&lt;/p&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;PULUMI_OPTION_REFRESH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Target specific resources without repeating flags:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;PULUMI_OPTION_TARGET&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;foo,bar
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Equivalent to: --target foo --target bar&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This works for any flag the CLI accepts. The environment variable takes precedence if you don&amp;rsquo;t explicitly pass the flag on the command line.&lt;/p&gt;
&lt;h2 id="using-with-direnv-for-project-level-defaults"&gt;Using with direnv for project-level defaults&lt;/h2&gt;
&lt;p&gt;This becomes particularly useful when combined with tools like &lt;a href="https://direnv.net/"&gt;&lt;code&gt;direnv&lt;/code&gt;&lt;/a&gt;. You can define project-specific CLI defaults in a &lt;code&gt;.envrc&lt;/code&gt; file at the root of your project:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Enable very verbose logging for debugging purposes&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;PULUMI_OPTION_VERBOSE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="m"&gt;3&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Always refresh before any Pulumi operation&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;PULUMI_OPTION_REFRESH&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# Skip previews and any dialogs or user prompts&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;PULUMI_OPTION_YES&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nb"&gt;export&lt;/span&gt; &lt;span class="nv"&gt;PULUMI_OPTION_SKIP_PREVIEW&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Now, running &lt;code&gt;direnv allow .&lt;/code&gt; in this directory means that, whenever we access this directory, these options will be automatically applied to all commands that we run until we leave the directory!&lt;/p&gt;
&lt;h2 id="wrapping-up"&gt;Wrapping up&lt;/h2&gt;
&lt;p&gt;We hope that this change makes Pulumi much easier to configure across a range of different environments, and gives you another tool for managing operation defaults across your team. Thanks for reading, and feel free to share any feedback on &lt;a href="https://github.com/pulumi/pulumi"&gt;GitHub&lt;/a&gt;, &lt;a href="https://twitter.com/pulumicorp"&gt;X&lt;/a&gt;, or our &lt;a href="https://slack.pulumi.com/"&gt;Community Slack&lt;/a&gt;.&lt;/p&gt;</description><author>Tom Harding</author><category>features</category><category>infrastructure-as-code</category><category>releases</category><category>cli</category></item><item><title>Pulumi Updates, Explained: AI-Powered Features in Pulumi CLI</title><link>https://www.pulumi.com/blog/cli-ai-extensions/</link><pubDate>Thu, 22 May 2025 00:00:00 +0000</pubDate><guid>https://www.pulumi.com/blog/cli-ai-extensions/</guid><description>
&lt;img src="https://www.pulumi.com/images/generated/blog/cli-ai-extensions/index.png" /&gt;
&lt;div class="note note-info"&gt;
&lt;div class="icon-and-line"&gt;
&lt;svg xmlns="http://www.w3.org/2000/svg" class="ph-icon ph-icon--fill" fill="currentColor" aria-hidden="true" focusable="false"&gt;&lt;use href="https://www.pulumi.com/icons/sprite.fd29ca76b1ea49dbd3f6703cc46ae6138b0ed98cabf8d2c60a23a474880f964d.svg#p-info-fill"/&gt;&lt;/svg&gt;
&lt;div class="line"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div class="content"&gt;Note: This post discusses Pulumi Copilot, which Pulumi Neo has replaced. &lt;a href="https://www.pulumi.com/docs/ai/"&gt;Learn about Neo →&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;We&amp;rsquo;re excited to announce the new AI capabilities for Pulumi CLI powered by Pulumi Copilot that translate complex infrastructure changes into clear, human-readable explanations and help resolve deployment errors with actionable guidance. Enable these preview features with the &lt;code&gt;--copilot&lt;/code&gt; flag.&lt;/p&gt;
&lt;p&gt;At Pulumi, we&amp;rsquo;re committed to helping you deploy infrastructure efficiently and with minimal friction. Anyone who has worked with cloud infrastructure knows the frustration of sifting through large previews with numerous changes and the difficulty of interpreting cryptic error messages from cloud provider APIs when deployments fail.&lt;/p&gt;
&lt;p&gt;There are two key challenges we&amp;rsquo;ve identified:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Understanding Preview Changes&lt;/strong&gt;: Reviewing raw update previews can be overwhelming, especially for complex deployments with many resources. It&amp;rsquo;s difficult to quickly grasp the full scope and impact of pending infrastructure changes.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Interpreting Error Messages&lt;/strong&gt;: When deployments fail, cloud providers often return error messages that, while comprehensive, bury the core issue within extensive diagnostics, requiring specialized expertise to interpret and address.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Our latest CLI update introduces AI capabilities that tackle both issues. Let&amp;rsquo;s explore how these new features improve your infrastructure management workflow.&lt;/p&gt;
&lt;h2 id="update-explanation"&gt;Update Explanation&lt;/h2&gt;
&lt;p&gt;To address the first challenge above, we&amp;rsquo;ve introduced a new &amp;ldquo;explain&amp;rdquo; menu item in the CLI. When running pulumi preview or &lt;code&gt;pulumi up&lt;/code&gt; with the &lt;code&gt;--copilot&lt;/code&gt; flag, you&amp;rsquo;ll see this option in the interactive menu:&lt;/p&gt;
&lt;p&gt;&lt;img src="preview.png" alt="Preview menu with the explain option"&gt;&lt;/p&gt;
&lt;p&gt;In this screenshot, you can see the standard Pulumi update preview showing an AWS VPC with multiple subnets, route tables, and gateways that need to be updated. The interactive menu at the bottom shows the new &amp;ldquo;explain&amp;rdquo; option with a sparkle emoji, indicating the AI-powered feature.
When selected, this tool analyzes and provides a clear summary of all changes in your pending infrastructure update:&lt;/p&gt;
&lt;p&gt;&lt;img src="explain.png" alt="Preview explanation by Pulumi Copilot"&gt;&lt;/p&gt;
&lt;p&gt;In this example, the AI explanation immediately identifies that this is a &amp;ldquo;VPC Renaming Operation - Tag Updates Only&amp;rdquo; and explains that the update is simply changing tags across all components. It clearly states this is a &amp;ldquo;safe, non-disruptive change that only affects resource labels.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;This explanation serves as a valuable sanity check before deployment. It presents a plain-language summary of exactly what changes will occur, helping you verify that the planned modifications align with your intentions. This visibility is particularly valuable when managing complex infrastructure with many resources, as it helps identify unexpected changes or potential drift between your code and deployed resources. The system also proactively flags potential issues such as security vulnerabilities or destructive updates that might impact your production environment.&lt;/p&gt;
&lt;h2 id="diagnostics-summarization"&gt;Diagnostics Summarization&lt;/h2&gt;
&lt;p&gt;For the second challenge, when infrastructure deployments fail, cloud providers often return error messages that are technically accurate but difficult to decipher without specialized knowledge. Consider the following scenario where a Go-based Docker image build fails with vendoring issues:&lt;/p&gt;
&lt;p&gt;&lt;img src="summary.png" alt="Error from the Docker Build provider"&gt;&lt;/p&gt;
&lt;p&gt;In this example, the standard Go build process failed with a cryptic error about inconsistent vendoring. While the raw output does contain the necessary information, it&amp;rsquo;s buried within extensive build logs. Our AI-powered Copilot diagnostics immediately identifies the problem and provides a clear, actionable solution: &amp;ldquo;Docker image update failed due to inconsistent vendoring. Sync vendor with &amp;lsquo;go mod vendor&amp;rsquo;.&amp;rdquo;&lt;/p&gt;
&lt;p&gt;This clear explanation identifies root causes and provides actionable guidance, transforming dense technical output into concise explanations. It reduces time to resolution by pinpointing both the problem and the exact command needed to fix it, eliminating the need to search through documentation or guess.&lt;/p&gt;
&lt;h2 id="getting-started"&gt;Getting Started&lt;/h2&gt;
&lt;p&gt;The AI-powered features are currently in preview. You can enable them by adding the &lt;code&gt;--copilot&lt;/code&gt; flag to your Pulumi CLI commands:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi preview --copilot
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi up --copilot
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;These features require Pulumi CLI version v3.171.0 or greater and the Pulumi Cloud backend. Organization administrators must enable Pulumi Copilot by navigating to &lt;strong&gt;Settings &amp;gt; Access Management &amp;gt; Pulumi Copilot&lt;/strong&gt; in the Pulumi Cloud console.&lt;/p&gt;
&lt;p&gt;During this preview period, we&amp;rsquo;re focused on:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Refining explanations based on user feedback&lt;/li&gt;
&lt;li&gt;Adding new capabilities like suggesting fixes for common errors&lt;/li&gt;
&lt;li&gt;Improving performance to ensure minimal impact on command execution time&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We will continue to monitor usage patterns and incorporate your feedback before enabling these features by default.&lt;/p&gt;
&lt;h2 id="share-your-feedback"&gt;Share Your Feedback&lt;/h2&gt;
&lt;p&gt;We&amp;rsquo;re excited to see how these AI-powered insights enhance your infrastructure deployment workflow! Please share your experiences with us:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Connect with us in the &lt;a href="https://slack.pulumi.com"&gt;Pulumi Community Slack&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Open an issue on &lt;a href="https://github.com/pulumi/pulumi"&gt;GitHub&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Learn more about &lt;a href="http://pulumi.com/copilot"&gt;Pulumi Copilot&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Try this today, &lt;a href="https://pulumi.com/start"&gt;Get Started with Pulumi for free&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Your input will directly influence how we evolve these features from preview to general availability.&lt;/p&gt;</description><author>Artur Laksberg</author><author>Mikhail Shilkov</author><author>Simon Howe</author><category>copilot</category><category>ai</category><category>infrastructure-as-code</category><category>cli</category></item><item><title>Introducing `pulumi state move`: Move Resources Between Stacks or Projects</title><link>https://www.pulumi.com/blog/move-resources-between-stacks/</link><pubDate>Thu, 25 Jul 2024 00:00:00 +0000</pubDate><guid>https://www.pulumi.com/blog/move-resources-between-stacks/</guid><description>
&lt;img src="https://www.pulumi.com/images/generated/blog/move-resources-between-stacks/index.png" /&gt;
&lt;p&gt;Today we&amp;rsquo;re announcing the &lt;a href="https://www.pulumi.com/docs/iac/cli/commands/pulumi_state_move/"&gt;&lt;code&gt;pulumi state move&lt;/code&gt;&lt;/a&gt; command, which can be used to move resources that are managed by Pulumi between different stacks and/or projects. With the &lt;code&gt;pulumi state move&lt;/code&gt; command, you can refactor your Pulumi Infrastructure as Code without any disruption to your deployed cloud infrastructure, enabling you to evolve and scale with confidence.&lt;/p&gt;
&lt;p&gt;When refactoring a Pulumi project from a &lt;a href="https://www.pulumi.com/docs/using-pulumi/organizing-projects-stacks/#monolithic"&gt;monolithic&lt;/a&gt; structure to &lt;a href="https://www.pulumi.com/docs/using-pulumi/organizing-projects-stacks/#micro-stacks"&gt;micro stacks&lt;/a&gt;, you might need to move resources between different projects or stacks, without recreating them. While this has been possible with some significant manual effort to hand-modify Pulumi state files (our users came up with &lt;a href="https://github.com/pulumi/pulumi/issues/3389#issuecomment-679020482"&gt;automated solutions&lt;/a&gt; for this!), doing so can be error prone and time consuming. Having a simpler, integrated solution for this problem was a &lt;a href="https://github.com/pulumi/pulumi/issues/3389"&gt;much requested feature&lt;/a&gt;. The new &lt;code&gt;pulumi state move&lt;/code&gt; command, combined with the &lt;a href="https://www.pulumi.com/docs/concepts/options/aliases/"&gt;&lt;code&gt;aliases&lt;/code&gt;&lt;/a&gt; command for refactoring resources within stacks, offers the richest collection of tools for refactoring IaC at scale available in the industry today.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;pulumi state move&lt;/code&gt; command works as follows:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;$ pulumi state move --help
Move resources from one stack to another
This command can be used to move resources from one stack to another. This can be useful when
splitting a stack into multiple stacks or when merging multiple stacks into one.
Usage:
pulumi state move [flags] &amp;lt;urn&amp;gt;...
Flags:
--dest string The name of the stack to move resources to
-h, --help help for move
--include-parents Include all the parents of the moved resources as well
--source string The name of the stack to move resources from
-y, --yes Automatically approve and perform the move
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Both &lt;code&gt;dest&lt;/code&gt; and &lt;code&gt;source&lt;/code&gt; can be either stacks in the current project, or stacks in a different project, using the fully qualified stack names. Note that this works only for stacks within the same backend, it is currently not possible to move a resource between different backends (though you can &lt;a href="https://www.pulumi.com/docs/iac/concepts/state-and-backends/#migrating-between-state-backends"&gt;move stacks between backends&lt;/a&gt; using other existing tools).&lt;/p&gt;
&lt;p&gt;The resources being moved have to be specified by their full &lt;a href="https://www.pulumi.com/docs/concepts/resources/names/#urns"&gt;URN&lt;/a&gt;, and multiple URNs can be passed at once. For each resource being moved, all the children of that resource will also be moved, and the relationships between all resources being moved is preserved. Resources with other types of dependencies will however not be moved to the target stack by default. The easiest way to get the full URN of the resources is to use &lt;code&gt;pulumi stack --show-urns&lt;/code&gt;. Note that URNs can contain characters that get interpreted by the shell, so it is always a good idea to wrap them in single quotes (&lt;code&gt;'&lt;/code&gt;) when passing them as arguments.&lt;/p&gt;
&lt;p&gt;The &lt;code&gt;pulumi state move&lt;/code&gt; command won&amp;rsquo;t modify the code of your program directly, it will only modify the state of the source and destination stacks. So following running the command, you should ensure that you modify both programs to match the changes you have made. This can typically be accomplished by copy/pasting source code for the resources and/or components between the two codebases. Inputs and outputs of resources that were moved may need to be adjusted as part of this process. This can be done either by using &lt;a href="https://www.pulumi.com/docs/concepts/stack/#stackreferences"&gt;stack references&lt;/a&gt;, or recreating the inputs in the program.&lt;/p&gt;
&lt;h2 id="example"&gt;Example&lt;/h2&gt;
&lt;p&gt;To demonstrate how the command works in practice, let&amp;rsquo;s go through an example. Let&amp;rsquo;s assume we have the following program:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-typescript" data-lang="typescript"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;randomPet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;random&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;RandomPet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;a-random-pet&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;aws&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Bucket&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;b&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;aws&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;BucketObject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;index.html&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;bucket&lt;/span&gt;: &lt;span class="kt"&gt;b.bucket&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Thanks for using Pulumi!&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;parent&lt;/span&gt;: &lt;span class="kt"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;randomSite&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;aws&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;BucketObject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;random.html&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;bucket&lt;/span&gt;: &lt;span class="kt"&gt;b.bucket&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;content&lt;/span&gt;: &lt;span class="kt"&gt;randomPet.id&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;parent&lt;/span&gt;: &lt;span class="kt"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;We create a bucket, and two bucket objects, both of them having the bucket as their parent. One of the objects has a random pet name as its content. At some point we decide we&amp;rsquo;d rather group all the AWS resources in a separate program, because this one grew too large. We can do that using the &lt;code&gt;pulumi state move&lt;/code&gt; command, and then adjusting the code.&lt;/p&gt;
&lt;p&gt;First we can find out which stacks already exist and we can move the resources to:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ pulumi stack ls --all
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;NAME LAST UPDATE RESOURCE COUNT URL
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;v-thomas-pulumi-corp/pulumi-demo-move-aws/dev &lt;span class="m"&gt;23&lt;/span&gt; minutes ago &lt;span class="m"&gt;0&lt;/span&gt; &amp;lt;url&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;v-thomas-pulumi-corp/pulumi-demo-move/dev &lt;span class="m"&gt;6&lt;/span&gt; minutes ago &lt;span class="m"&gt;7&lt;/span&gt; &amp;lt;url&amp;gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Next we can find the URN of the resources using &lt;code&gt;pulumi stack --show-urns&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ pulumi stack --show-urns
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Current stack is dev:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Owner: v-thomas-pulumi-corp
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Last updated: &lt;span class="m"&gt;13&lt;/span&gt; seconds ago &lt;span class="o"&gt;(&lt;/span&gt;2024-07-23 13:52:17.58884965 +0200 CEST&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; Pulumi version used: 3.125.1-dev.0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Current stack resources &lt;span class="o"&gt;(&lt;/span&gt;7&lt;span class="o"&gt;)&lt;/span&gt;:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; TYPE NAME
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; pulumi:pulumi:Stack pulumi-demo-move-dev
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; │ URN: urn:pulumi:dev::pulumi-demo-move::pulumi:pulumi:Stack::pulumi-demo-move-dev
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├─ random:index/randomPet:RandomPet a-random-pet
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; │ URN: urn:pulumi:dev::pulumi-demo-move::random:index/randomPet:RandomPet::a-random-pet
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├─ aws:s3/bucket:Bucket b
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; │ │ URN: urn:pulumi:dev::pulumi-demo-move::aws:s3/bucket:Bucket::b
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; │ ├─ aws:s3/bucketObject:BucketObject random.html
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; │ │ URN: urn:pulumi:dev::pulumi-demo-move::aws:s3/bucket:Bucket&lt;span class="nv"&gt;$aws&lt;/span&gt;:s3/bucketObject:BucketObject::random.html
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; │ └─ aws:s3/bucketObject:BucketObject index.html
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; │ URN: urn:pulumi:dev::pulumi-demo-move::aws:s3/bucket:Bucket&lt;span class="nv"&gt;$aws&lt;/span&gt;:s3/bucketObject:BucketObject::index.html
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; ├─ pulumi:providers:random default_4_16_3
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; │ URN: urn:pulumi:dev::pulumi-demo-move::pulumi:providers:random::default_4_16_3
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; └─ pulumi:providers:aws default_6_45_0
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; URN: urn:pulumi:dev::pulumi-demo-move::pulumi:providers:aws::default_6_45_0
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Next we can actually move the resources. Since we&amp;rsquo;re moving the resources from the currently selected stack, we can omit the &lt;code&gt;--source&lt;/code&gt; argument:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ pulumi state move --dest v-thomas-pulumi-corp/pulumi-demo-move-aws/dev &lt;span class="s1"&gt;&amp;#39;urn:pulumi:dev::pulumi-demo-move::aws:s3/bucket:Bucket::b&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Planning to move the following resources from v-thomas-pulumi-corp/pulumi-demo-move/dev to v-thomas-pulumi-corp/pulumi-demo-move-aws/dev:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; - urn:pulumi:dev::pulumi-demo-move::aws:s3/bucket:Bucket::b
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; - urn:pulumi:dev::pulumi-demo-move::aws:s3/bucket:Bucket&lt;span class="nv"&gt;$aws&lt;/span&gt;:s3/bucketObject:BucketObject::random.html
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; - urn:pulumi:dev::pulumi-demo-move::aws:s3/bucket:Bucket&lt;span class="nv"&gt;$aws&lt;/span&gt;:s3/bucketObject:BucketObject::index.html
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;The following resources being moved to v-thomas-pulumi-corp/pulumi-demo-move-aws/dev have dependencies on resources in v-thomas-pulumi-corp/pulumi-demo-move/dev:
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; - urn:pulumi:dev::pulumi-demo-move::aws:s3/bucket:Bucket&lt;span class="nv"&gt;$aws&lt;/span&gt;:s3/bucketObject:BucketObject::random.html has a dependency on urn:pulumi:dev::pulumi-demo-move::random:index/randomPet:RandomPet::a-random-pet
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; - urn:pulumi:dev::pulumi-demo-move::aws:s3/bucket:Bucket&lt;span class="nv"&gt;$aws&lt;/span&gt;:s3/bucketObject:BucketObject::random.html &lt;span class="o"&gt;(&lt;/span&gt;content&lt;span class="o"&gt;)&lt;/span&gt; has a property dependency on urn:pulumi:dev::pulumi-demo-move::random:index/randomPet:RandomPet::a-random-pet
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;If you go ahead with moving these dependencies, it will be necessary to create the appropriate inputs and outputs in the program &lt;span class="k"&gt;for&lt;/span&gt; the stack the resources are moved to.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Do you want to perform this move? yes
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;Successfully moved resources from v-thomas-pulumi-corp/pulumi-demo-move/dev to v-thomas-pulumi-corp/pulumi-demo-move-aws/dev
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;There&amp;rsquo;s a few things worth explaining above:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;We&amp;rsquo;re moving the resources to a different project, so we need to use the fully qualified stack name. If the resources are being moved between different stacks in the same project, the argument can be only the stack name.&lt;/li&gt;
&lt;li&gt;Before actually moving the resources, the command gives a list of resources that is being moved. Since the bucket objects are children of the bucket, they will be included in the move. However the random pet is not a child resource, so it will not be moved.&lt;/li&gt;
&lt;li&gt;The command also warns us about dependencies that will not be transferred to the destination stack. Since we didn&amp;rsquo;t want to include the pet, but the bucket has a dependency on it, pulumi will warn us about that.&lt;/li&gt;
&lt;li&gt;Before going ahead with the move, we get prompted to confirm whether we want to go ahead with it. In this example we do want to go ahead with the move, so we confirm the move, and the resources will be moved for us.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now that the resources are moved, we need to adjust the program to take advantage of that. The source program will now look as follows:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-typescript" data-lang="typescript"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;randomPet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;random&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;RandomPet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;a-random-pet&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;export&lt;/span&gt; &lt;span class="kr"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;randomPetName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;randomPet&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Only the random pet remains here. We also export its name, so we can continue using it in the destination program. Meanwhile the destination program is mostly just a copy of the original AWS resources, but there is an important change:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-typescript" data-lang="typescript"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;stackRef&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;pulumi&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;StackReference&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sb"&gt;`v-thomas-pulumi-com/pulumi-demo-move/dev`&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;aws&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Bucket&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;b&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;index&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;aws&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;BucketObject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;index.html&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;bucket&lt;/span&gt;: &lt;span class="kt"&gt;b.bucket&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;content&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Thanks for using Pulumi!&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;parent&lt;/span&gt;: &lt;span class="kt"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kr"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;randomSite&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;aws&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;s3&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;BucketObject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;random.html&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;bucket&lt;/span&gt;: &lt;span class="kt"&gt;b.bucket&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;content&lt;/span&gt;: &lt;span class="kt"&gt;stackRef.getOutput&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;randomPetName&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;parent&lt;/span&gt;: &lt;span class="kt"&gt;b&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note how we now need to specify the content of &lt;code&gt;random.html&lt;/code&gt;, since we no longer have the random pet in the same program. In this case we use a &lt;a href="https://www.pulumi.com/learn/building-with-pulumi/stack-references/"&gt;stack reference&lt;/a&gt; to reference the output from the source program. It is of course up to the user how to re-create the output. It could also come from config, or be hardcoded depending on the use-case.&lt;/p&gt;
&lt;div class="rounded-lg bg-violet-50 p-6 my-8"&gt;
&lt;p class="heading-4 m-0 mb-3 flex items-center gap-1.5"&gt;Refactor your infrastructure safely&lt;/p&gt;
&lt;div class="body-base m-0 text-gray-950"&gt;Use &lt;code&gt;pulumi state move&lt;/code&gt; to split a growing project into focused stacks without recreating your cloud resources. Organize your infrastructure as code and manage every stack in Pulumi Cloud.&lt;/div&gt;
&lt;a href="https://www.pulumi.com/tutorials/move-resources-between-stacks/" data-track="blog-body-cta" class="btn btn-primary mt-4"&gt;
Learn more
&lt;svg xmlns="http://www.w3.org/2000/svg" class="ph-icon ph-icon--regular size-4" fill="currentColor" aria-hidden="true" focusable="false"&gt;&lt;use href="https://www.pulumi.com/icons/sprite.fd29ca76b1ea49dbd3f6703cc46ae6138b0ed98cabf8d2c60a23a474880f964d.svg#p-arrow-right-regular"/&gt;&lt;/svg&gt;
&lt;/a&gt;
&lt;/div&gt;
&lt;p&gt;As always, we would love to hear your feedback in the &lt;a href="https://www.pulumi.com/community/"&gt;community slack&lt;/a&gt;. If you encounter any issues with the command, please open an &lt;a href="https://github.com/pulumi/pulumi/issues"&gt;issue&lt;/a&gt;.&lt;/p&gt;</description><author>Thomas Gummerer</author><category>announcements</category><category>cli</category></item><item><title>Introducing Dev Releases for the Pulumi CLI and SDKs</title><link>https://www.pulumi.com/blog/introducing-dev-releases/</link><pubDate>Tue, 02 Apr 2024 00:00:00 +0000</pubDate><guid>https://www.pulumi.com/blog/introducing-dev-releases/</guid><description>
&lt;img src="https://www.pulumi.com/images/generated/blog/introducing-dev-releases/index.png" /&gt;
&lt;p&gt;At Pulumi, the stability of our CLI and SDK releases is critically important. A lot of infrastructure is built and deployed using Pulumi, and any bugs in how that infrastructure is deployed can cause outages. While we put a lot of emphasis on unit and integration testing, we are also constantly investing in new ways to provide additional safeguards to ensure we always deliver stable releases. To that end, we are introducing new dev releases of our CLI and SDKs, which will enable users who want to work with the very latest bits to try them out before they are deployed widely to the entire Pulumi user base. This blog post will walk you through how we are using them internally, and how you can too!&lt;/p&gt;
&lt;h2 id="what-are-dev-releases"&gt;What are dev releases?&lt;/h2&gt;
&lt;p&gt;On every push to the main branch, in other words every time a pull request is merged, we publish a new dev release for both the CLI and the Pulumi core SDKs. For the CLI, we publish the binaries for all supported platforms to S3, while for the SDKs we create pre-release versions in whatever form the various package managers support.&lt;/p&gt;
&lt;p&gt;This means these dev releases always include all the latest features and bug fixes, that will be in the next stable release. And while it was always possible to get the latest CLI or SDKs with some moderate effort depending on the platform and language, having these be proper releases makes for a much more standardized experience on how to install them.&lt;/p&gt;
&lt;p&gt;Dev releases of the CLI can be &lt;a href="https://www.pulumi.com/docs/install/#installing-dev-releases"&gt;installed&lt;/a&gt; on Linux, macOS, and Windows. For example, on Linux or macOS:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ curl -fsSL https://get.pulumi.com &lt;span class="p"&gt;|&lt;/span&gt; sh -s -- --version dev
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Dev SDKs are currently available for &lt;a href="https://www.pulumi.com/docs/languages-sdks/javascript/#dev-versions"&gt;Node.js&lt;/a&gt;, &lt;a href="https://www.pulumi.com/docs/languages-sdks/python/#dev-versions"&gt;Python&lt;/a&gt;, &lt;a href="https://www.pulumi.com/docs/languages-sdks/dotnet/#dev-versions"&gt;.NET&lt;/a&gt;, and &lt;a href="https://www.pulumi.com/docs/languages-sdks/go/#dev-versions"&gt;Go&lt;/a&gt;. For example, installing the dev release of the Node.js SDK with &lt;code&gt;npm&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;$ npm add @pulumi/pulumi@dev
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;h2 id="how-are-we-using-them-internally-at-pulumi"&gt;How are we using them internally at Pulumi?&lt;/h2&gt;
&lt;p&gt;At Pulumi we are not only developers of our product, but we also love using it internally. All deploys for Pulumi Cloud are orchestrated by Pulumi. In addition we use Pulumi for managing other things such as this blog, and even access management to services we are using is partly done with Pulumi. All of these are a great way for us to test our software in real world use cases, before releasing it.&lt;/p&gt;
&lt;p&gt;In addition to that, we also use the dev releases for testing both our &lt;a href="https://github.com/pulumi/templates/"&gt;templates&lt;/a&gt; and &lt;a href="https://github.com/pulumi/examples/"&gt;examples&lt;/a&gt;. This is a huge set of Pulumi programs, that can help figure out problems early.&lt;/p&gt;
&lt;h2 id="how-you-can-leverage-dev-releases"&gt;How you can leverage dev releases&lt;/h2&gt;
&lt;p&gt;In addition to making it easier for us to test new code that gets merged, and making sure we can release the most stable software possible, we also wanted to make it easier for users to use these dev releases. There&amp;rsquo;s a couple reasons why these could help your organization:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A bug fix has been merged, but not yet released? You can get it a few minutes after it is merged via the dev release channel&lt;/li&gt;
&lt;li&gt;You want to make sure your production stacks work well with the latest version of Pulumi? Use dev releases with your dev stacks for some early testing. We&amp;rsquo;d be delighted with any bugs that are reported before they make it into a release.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="how-to-get-started"&gt;How to get started&lt;/h2&gt;
&lt;p&gt;For instructions on how to use the CLI dev releases see the &lt;a href="https://www.pulumi.com/docs/install/#installing-dev-releases"&gt;Install Docs&lt;/a&gt;, and for pre-release versions of dev SDKs see the docs for &lt;a href="https://www.pulumi.com/docs/languages-sdks/javascript/#dev-versions"&gt;Node.js&lt;/a&gt;, &lt;a href="https://www.pulumi.com/docs/languages-sdks/python/#dev-versions"&gt;Python&lt;/a&gt;, &lt;a href="https://www.pulumi.com/docs/languages-sdks/dotnet/#dev-versions"&gt;.NET&lt;/a&gt;, and &lt;a href="https://www.pulumi.com/docs/languages-sdks/go/#dev-versions"&gt;Go&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Happy building!&lt;/p&gt;</description><author>Thomas Gummerer</author><category>cli</category><category>sdk</category><category>pre-release</category></item><item><title>Manage Pulumi Teams in Bulk with the New CLI Teams Flag</title><link>https://www.pulumi.com/blog/stack-init-teams-flag/</link><pubDate>Fri, 31 Mar 2023 00:00:00 +0000</pubDate><guid>https://www.pulumi.com/blog/stack-init-teams-flag/</guid><description>
&lt;img src="https://www.pulumi.com/images/generated/blog/stack-init-teams-flag/index.png" /&gt;
&lt;p&gt;We&amp;rsquo;ve been hearing feedback from our customers that they need ways to manage permissions for their stacks at scale. Today we are announcing a &lt;code&gt;--teams&lt;/code&gt; flag for &lt;a href="https://www.pulumi.com/docs/iac/cli/commands/pulumi_stack_init"&gt;&lt;code&gt;pulumi stack init&lt;/code&gt;&lt;/a&gt;, which allows customers to assign Teams to stacks from the CLI. This flag offers a third programmatic method for assigning permissions, supplementing &lt;a href="https://www.pulumi.com/docs/reference/service-rest-api"&gt;Pulumi Service REST API&lt;/a&gt; or the &lt;a href="https://www.pulumi.com/registry/packages/pulumiservice"&gt;Pulumi Service Provider&lt;/a&gt;. Developers can now initialize their stacks with the right permissions directly from the CLI.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s some background for any Pulumi newcomers. Pulumi projects
consist of stacks, which are separate deployments of the same infrastructure. Stacks may
also be configured with separate inputs. Organization admins can leverage RBAC
to grant access permissions at the organization or Pulumi Teams levels. Pulumi Teams and RBAC are available for Enterprise and Business Critical customers.&lt;/p&gt;
&lt;p&gt;Stacks are often created via the CLI with the &lt;a href="https://www.pulumi.com/docs/iac/cli/commands/pulumi_stack_init/#options"&gt;&lt;code&gt;pulumi stack init&lt;/code&gt; command&lt;/a&gt;.
This command initializes a new stack. If you&amp;rsquo;re using the
&lt;a href="https://www.pulumi.com/docs/iac/concepts/state-and-backends/#pulumi-service-backend"&gt;Pulumi Service&lt;/a&gt; as your backend, you can view your newly created stack in the Pulumi Service console. If your organization uses teams, you will want to give your teammates access to the stack.&lt;/p&gt;
&lt;p&gt;With the release of Pulumi v3.59.0, developers can assign Pulumi Team access during stack creation. To do this, pass in the &lt;code&gt;--teams&lt;/code&gt; flag followed by the team&amp;rsquo;s name. For instance:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi stack init --teams Red
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This saves time by eliminating context switching, allowing users to stay on task. Previously, the Service console was the most direct way to assign team access to a stack, meaning a trip to the browser before your teammates could access the stack. The &lt;code&gt;--teams&lt;/code&gt; flag improves upon the process of managing stack permissions by removing this step.&lt;/p&gt;
&lt;p&gt;Use the flag multiple times to assign access to multiple Pulumi Teams, as in:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;pulumi stack init --teams Red --teams Blue
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Currently, the feature always grants &lt;code&gt;read&lt;/code&gt; and &lt;code&gt;write&lt;/code&gt; access, the most commonly assigned permissions.&lt;/p&gt;
&lt;p&gt;We implemented this feature as a direct result of feedback from daily users.
Context switching can be expensive when you&amp;rsquo;re creating enough stacks.
At Pulumi, we enable our users to squeak out as much productivity from our tooling
as possible. We&amp;rsquo;re always happy to make ergonomic improvements. We look
forward to continuing to raise the bar for cloud productivity.&lt;/p&gt;</description><author>Robbie McKinstry</author><category>cli</category><category>stack-init</category><category>cli-flags</category></item></channel></rss>