<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0"><channel><title>Pulumi Blog: Open source</title><link>https://www.pulumi.com/blog/tag/open-source/</link><description>Pulumi blog posts: Open source.</description><language>en-us</language><pubDate>Thu, 23 May 2024 18:48:50 +0000</pubDate><item><title>Celebrating 20,000 Stars: A Milestone for the Pulumi Community</title><link>https://www.pulumi.com/blog/celebrating-20k-stars/</link><pubDate>Thu, 23 May 2024 18:48:50 +0000</pubDate><guid>https://www.pulumi.com/blog/celebrating-20k-stars/</guid><description>
&lt;img src="https://www.pulumi.com/images/generated/blog/celebrating-20k-stars/index.png" /&gt;
&lt;p&gt;Today, we&amp;rsquo;re excited to announce that the &lt;a href="https://github.com/pulumi/pulumi"&gt;Pulumi open source project&lt;/a&gt; has crossed the incredible milestone of 20,000 stars on GitHub. 🎉 This is a huge achievement, and it wouldn&amp;rsquo;t have been possible without y&amp;rsquo;all - our incredible global community of developers.&lt;/p&gt;
&lt;p&gt;Since its inception, Pulumi&amp;rsquo;s vision has been rooted in enabling teams to build and manage modern cloud infrastructure using familiar languages and tools. Over the years, your feedback, contributions, and passion have been invaluable in shaping Pulumi into what it is today. Seeing so many developers embrace our modern approach to cloud infrastructure management is really exciting. We are deeply grateful for the trust y&amp;rsquo;all have placed in us, and we will continue to push the boundaries in how teams manage cloud infrastructure.&lt;/p&gt;
&lt;h2 id="fueled-by-community-contributions"&gt;Fueled by Community Contributions&lt;/h2&gt;
&lt;p&gt;Over the past 7 years, the Pulumi project has had 4,400+ contributors that made 75,000+ pull requests. Pulumi is depended upon by 6,600+ GitHub projects and supports over 160+ packages in the registry. It has been downloaded more than 100 million times by 170,000+ developers. In just the last month, Pulumi has been the most active Infrastructure as Code (IaC) open-source project compared to Terraform or OpenTofu. Pulumi has had 117 merged pull requests (67 TF, 83 OpenTofu), 82 closed issues (49 TF, 54 OpenTofu), and 53 new issues (27 TF, 29, OpenTofu).&lt;/p&gt;
&lt;h2 id="notable-features-and-milestones"&gt;Notable Features and Milestones&lt;/h2&gt;
&lt;p&gt;We also want to take this time to reflect on some of the notable features we shipped that got us here. The &lt;a href="https://github.com/orgs/pulumi/projects/44/views/1"&gt;Pulumi roadmap&lt;/a&gt; is public so we can be transparent about the features being worked on and to encourage deeper collaboration with the community. Here are some of the most popular features that were added to Pulumi over the last 7 years.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Mar 2017 - Pulumi founded&lt;/li&gt;
&lt;li&gt;Jun 2018 - &lt;a href="https://www.pulumi.com/blog/introducing-pulumi-a-cloud-development-platform/"&gt;Pulumi open source project&lt;/a&gt; launched&lt;/li&gt;
&lt;li&gt;Aug 2018 - Kubernetes native provider&lt;/li&gt;
&lt;li&gt;Oct 2018 - Series A fundraise&lt;/li&gt;
&lt;li&gt;Oct 2018 - Pulumi Cloud launched&lt;/li&gt;
&lt;li&gt;Nov 2018 - &lt;a href="https://github.com/pulumi/pulumi/issues/109"&gt;Stack Reference&lt;/a&gt; to allow access of outputs of one stack from another&lt;/li&gt;
&lt;li&gt;Jun 2019 - &lt;a href="https://www.pulumi.com/blog/introducing-pulumi-crosswalk-for-aws-the-easiest-way-to-aws/"&gt;AWSX&lt;/a&gt; as higher-level components for the AWS platform&lt;/li&gt;
&lt;li&gt;Sep 2019 - &lt;a href="https://www.pulumi.com/blog/pulumi-1-0/"&gt;Pulumi 1.0&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Sep 2019 - &lt;a href="https://github.com/pulumi/pulumi/commit/9374c374c3d3a96fc2ae1e715da511b4125b6628"&gt;Transformations&lt;/a&gt; to modify the properties and resource options for child resource of a component or stack&lt;/li&gt;
&lt;li&gt;Nov 2019 - .&lt;a href="https://github.com/pulumi/pulumi/pull/3399"&gt;NET support&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Dec 2019 - &lt;a href="https://www.pulumi.com/blog/announcing-crossguard-preview/"&gt;CrossGuard&lt;/a&gt; for policy as code&lt;/li&gt;
&lt;li&gt;Apr 2020 - &lt;a href="https://www.pulumi.com/blog/pulumi-2-0/"&gt;Pulumi 2.0&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;May 2020 - &lt;a href="https://www.pulumi.com/blog/go-support-pulumi-2-0/"&gt;Golang support&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Sep 2020 - &lt;a href="https://www.pulumi.com/blog/announcing-nextgen-azure-provider/"&gt;Azure Native Provider&lt;/a&gt; for same day access to new Azure features&lt;/li&gt;
&lt;li&gt;Oct 2020 - Series B fundraise&lt;/li&gt;
&lt;li&gt;Oct 2020 - &lt;a href="https://github.com/pulumi/pulumi/issues/3901#issuecomment-685803282"&gt;Automation API&lt;/a&gt; exposes IaC through a programmatic interface&lt;/li&gt;
&lt;li&gt;Oct 2020 - &lt;a href="https://github.com/pulumi/pulumi/pull/4765"&gt;Import command&lt;/a&gt; to import resources not managed by Pulumi into a stack&lt;/li&gt;
&lt;li&gt;Apr 2021 - First PulumiUP&lt;/li&gt;
&lt;li&gt;Apr 2021 - &lt;a href="https://www.pulumi.com/blog/pulumi-3-0/"&gt;Pulumi 3.0&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Apr 2021 - &lt;a href="https://www.pulumi.com/blog/pulumiup-pulumi-packages-multi-language-components/"&gt;Pulumi Packages&lt;/a&gt; to provide multi-language support for components and providers&lt;/li&gt;
&lt;li&gt;Oct 2021 - &lt;a href="https://github.com/pulumi/pulumi-kubernetes-operator/issues/215"&gt;Pulumi Kubernetes Operator&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;May 2022 - &lt;a href="https://github.com/pulumi/pulumi/issues/1539"&gt;Java support&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Nov 2022 - &lt;a href="https://www.pulumi.com/blog/nov-2022-launches/"&gt;Pulumi Deployments&lt;/a&gt; to automate infrastructure deployments&lt;/li&gt;
&lt;li&gt;Nov 2022 - &lt;a href="https://www.pulumi.com/blog/pulumi-yaml-ga/"&gt;YAML support&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Dec 2022 - &lt;a href="https://github.com/pulumi/pulumi/issues/2307"&gt;Hierarchical config&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Apr 2023 - &lt;a href="https://www.pulumi.com/blog/pulumi-insights/"&gt;Pulumi Insights&lt;/a&gt; for intelligence, search, and analytics over any infrastructure&lt;/li&gt;
&lt;li&gt;Apr 2023 - First Pulumi User Group (PUG)&lt;/li&gt;
&lt;li&gt;Jul 2023 - &lt;a href="https://github.com/pulumi/pulumi-terraform-bridge/issues/1273"&gt;Terraform conversion&lt;/a&gt; improvement as an easy way to migrate TF to Pulumi&lt;/li&gt;
&lt;li&gt;Sep 2023 - &lt;a href="https://www.pulumi.com/blog/pulumi-insights-ai-cli/"&gt;Pulumi AI&lt;/a&gt; added to &lt;code&gt;pulumi&lt;/code&gt; CLI&lt;/li&gt;
&lt;li&gt;Sep 2023 - &lt;a href="https://www.pulumi.com/blog/go-generics-preview/"&gt;Go generics&lt;/a&gt; support added&lt;/li&gt;
&lt;li&gt;Oct 2023 - Series C fundraise&lt;/li&gt;
&lt;li&gt;Oct 2023 - &lt;a href="https://www.pulumi.com/blog/environments-secrets-configurations-management/"&gt;Pulumi ESC&lt;/a&gt; to manage secrets and configuration complexity&lt;/li&gt;
&lt;li&gt;Oct 2023 - &lt;a href="https://www.pulumi.com/blog/developer-portal-platform-teams/"&gt;Pulumi for Platform Teams&lt;/a&gt; through developer portals and more&lt;/li&gt;
&lt;li&gt;Apr 2024 - &lt;a href="https://www.pulumi.com/blog/infrastructure-lifecycle-management/"&gt;Drift detection, TTL stacks, and scheduled deployments&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We also shipped many other features that didn’t make this post, so please see our &lt;a href="https://www.pulumi.com/blog/"&gt;blog&lt;/a&gt; for all those details.&lt;/p&gt;
&lt;h2 id="a-heartfelt-thank-you"&gt;A Heartfelt Thank You&lt;/h2&gt;
&lt;p&gt;We are immensely grateful to our community for helping us reach this incredible milestone and making Pulumi a thriving ecosystem. Your contributions, feedback, and support have been invaluable in shaping Pulumi&amp;rsquo;s journey. We also want to thank the &lt;a href="https://www.pulumi.com/community/puluminaries/"&gt;Puluminaries&lt;/a&gt; - our community leaders and advocates whose contributions have been pivotal to our success.&lt;/p&gt;
&lt;p&gt;If you&amp;rsquo;re passionate about cloud infrastructure, consider &lt;a href="mailto:da@pulumi.com"&gt;joining the Puluminaries&lt;/a&gt;. As a Puluminary, you’ll gain direct access to our engineering team, preview roadmaps, and help contribute to code, content, and community support.&lt;/p&gt;
&lt;p&gt;We look forward to continuing our innovations to democratize the cloud and empower developers worldwide. We encourage you to join our &lt;a href="https://slack.pulumi.com/"&gt;Slack community&lt;/a&gt; to engage with fellow developers and be part of the ongoing conversation about the future of how teams manage cloud infrastructure.&lt;/p&gt;
&lt;p&gt;Thank y&amp;rsquo;all for being part of this journey. Here’s to the next 20,000 stars and beyond!&lt;/p&gt;</description><author>Aaron Kao</author><category>announcements</category><category>open-source</category></item><item><title>Pulumi adoption made easy with the new Migration Hub</title><link>https://www.pulumi.com/blog/migration-hub/</link><pubDate>Tue, 22 Aug 2023 00:00:00 +0000</pubDate><guid>https://www.pulumi.com/blog/migration-hub/</guid><description>
&lt;img src="https://www.pulumi.com/images/generated/blog/migration-hub/index.png" /&gt;
&lt;p&gt;Today we are launching Pulumi&amp;rsquo;s new &lt;a href="https://www.pulumi.com/migrate"&gt;Migration Hub&lt;/a&gt;, a comprehensive guide to help you
seamlessly adopt Pulumi no matter where you are coming from, whether that&amp;rsquo;s Terraform, CloudFormation, &amp;hellip; or even
manually provisioned resources not yet governed by an infrastructure as code solution. Our new Expert Services group is
ready to roll up their sleeves to help you adopt Pulumi faster. The Migration Hub also features many commercial offers
for open source foundations, startups, and complementary migration, to minimize switching costs and risks. It&amp;rsquo;s never
been easier to adopt Pulumi.&lt;/p&gt;
&lt;h2 id="why-pulumi"&gt;Why Pulumi?&lt;/h2&gt;
&lt;p&gt;Nearly 2,000 customers and over 130,000 practitioners have chosen Pulumi for their infrastructure as code needs. About
half the time, these end users have an existing infrastructure as code solution that has stopped meeting their needs.
The other half of the time, infrastructure may have been created in the cloud console (&amp;ldquo;click-ops&amp;rdquo;), using a cloud CLI,
or some other manual provisioning tool, but now needs to become repeatable and scalable using infrastructure as code.&lt;/p&gt;
&lt;p&gt;The most common reasons teams prefer Pulumi include:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Best-in-class productivity&lt;/li&gt;
&lt;li&gt;Accessible to the entire organization, thanks to industry standard languages&lt;/li&gt;
&lt;li&gt;Ability to deal with complexity at scale, thanks to stacks, config, sharing and reuse, and more&lt;/li&gt;
&lt;li&gt;Perfect confidence thanks to policies and testing&lt;/li&gt;
&lt;li&gt;Secure by-default, with built-in support for secrets&lt;/li&gt;
&lt;li&gt;Highly programmable engine can be embedded anywhere, to build custom platforms and tools&lt;/li&gt;
&lt;li&gt;Instant collaborative bridge between developers and infrastructure experts&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Thanks to Pulumi, teams are able to do more with less, ship faster with confidence, tackle very challenging cloud
infrastructure projects and scale with them, empower more of the team to be self-serve and collaborate more closely,
and ultimately turn the cloud into a competitive advantage.&lt;/p&gt;
&lt;p&gt;Pulumi is also &lt;a href="https://www.pulumi.com/blog/pulumi-hearts-opensource"&gt;true Apache 2.0 open source&lt;/a&gt; and we welcome anyone who
wishes to build atop it.&lt;/p&gt;
&lt;h2 id="migration"&gt;Migration&lt;/h2&gt;
&lt;p&gt;Of course, it&amp;rsquo;s one thing to choose Pulumi, but another thing entirely to adopt it and get all of your infrastructure
under its management, especially if you have existing infrastructure. That might include converting existing code, or
even just importing existing manually provisioned cloud resources.&lt;/p&gt;
&lt;p&gt;There are two major approaches to this challenge.&lt;/p&gt;
&lt;h3 id="self-serve-migration"&gt;Self-Serve Migration&lt;/h3&gt;
&lt;p&gt;Pulumi offers many tools and techniques should you want to perform a migration on your own.&lt;/p&gt;
&lt;p&gt;In the most general form, Pulumi provides &lt;a href="https://www.pulumi.com/docs/iac/adopting-pulumi/import"&gt;an import command&lt;/a&gt;
which can import any existing infrastructure no matter how it was originally created, click-ops included.&lt;/p&gt;
&lt;p&gt;Pulumi also offers conversion tools for other popular infrastructure as code solutions, including
&lt;a href="https://www.pulumi.com/docs/iac/adopting-pulumi/migrating-to-pulumi/from-terraform"&gt;HashiCorp Terraform&lt;/a&gt;,
&lt;a href="https://www.pulumi.com/docs/iac/adopting-pulumi/migrating-to-pulumi/from-cloudformation"&gt;AWS CloudFormation&lt;/a&gt;,
&lt;a href="https://www.pulumi.com/docs/iac/adopting-pulumi/migrating-to-pulumi/from-arm"&gt;Azure Resource Manager (ARM)&lt;/a&gt;, or
&lt;a href="https://www.pulumi.com/docs/iac/adopting-pulumi/migrating-to-pulumi/from-kubernetes"&gt;Kubernetes YAML&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Although the time to migrate existing infrastructure varies wildly based on the size and complexity of your scenario,
migrating a single cloud environment can often take as little as a few hours. And thanks to Pulumi being multi-language
at its core, these tools will support you the same no matter which language you choose, JavaScript, TypeScript, Python,
Go, C#, Java, and YAML alike.&lt;/p&gt;
&lt;p&gt;To learn more about performing your own migration, please
&lt;a href="https://www.pulumi.com/docs/iac/adopting-pulumi"&gt;read this user guide&lt;/a&gt;.&lt;/p&gt;
&lt;h3 id="let-us-help-you-out-with-expert-services"&gt;Let Us Help You Out with Expert Services!&lt;/h3&gt;
&lt;p&gt;Although self-serve is an option, there can often still be uncertainty around this approach.&lt;/p&gt;
&lt;p&gt;It may not be clear how much time a full migration will take, leaving the possibility that you&amp;rsquo;ll be left with multiple
infrastructure as code solutions &amp;ndash; either temporarily or even permanently. Although the tools are a huge help, they
don&amp;rsquo;t always get you 100% of the way there. We also often hear that skilling yourself up on a one-time migration
activity takes away from critical time spent on business initiatives.&lt;/p&gt;
&lt;p&gt;All of this adds friction, risk, and uncertainty to the Pulumi adoption decision. The last thing we want is for the
one-time migration to prevent you from adopting Pulumi. Thankfully, we are here to help!&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Today we are announcing the formation of Pulumi&amp;rsquo;s &lt;strong&gt;Expert Services&lt;/strong&gt; group&lt;/em&gt;. This team of industry and
infrastructure as code experts is on standby and ready to roll up their sleeves to help you with migration,
training, and other services efforts. No project is too small: we are currently working with customers with
100KLOCs of legacy infrastructure as code that needs to be migrated, for example.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Today we are also announcing an extension to
&lt;a href="https://www.pulumi.com/blog/tf-migration-offer/"&gt;our &lt;strong&gt;Terraform Migration Offer&lt;/strong&gt;&lt;/a&gt;&lt;/em&gt;, in which we will bundle migration of
your Terraform projects with your &lt;a href="https://www.pulumi.com/pricing"&gt;Pulumi Enterprise or Business Critical&lt;/a&gt; subscription.
Today we are excited to announce that this same package is now available for all migration efforts, including AWS
CloudFormation, Azure Resource Manager (ARM), &amp;hellip;, or even infrastructure that was manually provisioned. We are also prepared
to scale up from there depending on your needs.&lt;/p&gt;
&lt;h2 id="success-stories"&gt;Success Stories&lt;/h2&gt;
&lt;p&gt;Over time, Pulumi is becoming a more comprehensive platform, with new services like
&lt;a href="https://www.pulumi.com/blog/pulumi-deployments"&gt;Pulumi Deployments&lt;/a&gt; for multi-cloud deployment workflows and
&lt;a href="https://www.pulumi.com/blog/pulumi-insights"&gt;Pulumi Insights&lt;/a&gt; for search, analytics, and AI for your cloud infrastructure.
Pulumi also offers &lt;a href="https://www.pulumi.com/crossguard"&gt;policies&lt;/a&gt; and &lt;a href="https://www.pulumi.com/docs/iac/concepts/secrets"&gt;secrets&lt;/a&gt; as
core features of the platform. &lt;a href="https://www.pulumi.com/enterprise"&gt;Enterprises&lt;/a&gt; are increasingly betting on Pulumi for
their entire cloud management and platform needs.&lt;/p&gt;
&lt;p&gt;By moving to Pulumi&amp;rsquo;s platform, many customers have seen considerable benefits:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;a href="https://www.pulumi.com/case-studies/atlassian"&gt;Atlassian &lt;strong&gt;significantly increased developer velocity&lt;/strong&gt;&lt;/a&gt;&lt;/em&gt;, increasing
productivity by more than 2x and substantially decreasing the amount of time spent on maintenance tasks.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;a href="https://www.pulumi.com/case-studies/mercedes-benz"&gt;Mercedes-Benz &lt;strong&gt;got the whole team shipping faster and with more confidence&lt;/strong&gt;&lt;/a&gt;&lt;/em&gt; by building a platform that helped developers be self-serve with
infrastructure while scaling up to 100s of Kubernetes clusters worldwide.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;a href="https://www.pulumi.com/case-studies/snowflake"&gt;Snowflake &lt;strong&gt;rapidly improved time to market&lt;/strong&gt;&lt;/a&gt;&lt;/em&gt; by betting on Pulumi,
empowering their engineers, and delivering the Data Cloud. Snowflake ultimately beat their IPO deadlines and knew legacy
infrastructure as code wouldn&amp;rsquo;t do it.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;a href="https://www.pulumi.com/blog/how-a-bank-modernized-its-software-engineering-with-infrastructure-as-code-automation"&gt;Washington Trust Bank &lt;strong&gt;modernized their cloud infrastructure and practices&lt;/strong&gt;&lt;/a&gt;&lt;/em&gt;,
speeding up internal delivery, while also increasing their confidence thanks to policy as code guardrails.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;a href="https://www.pulumi.com/case-studies/fauna"&gt;Fauna &lt;strong&gt;adopted a born in the cloud mindset&lt;/strong&gt;&lt;/a&gt;&lt;/em&gt; and was able to build a
multi-cloud, highly scalable, modern SaaS application, actually increasing reliability even in the face of growing
complexity.&lt;/p&gt;
&lt;p&gt;In each of these cases, the customer evaluated Pulumi against alternative infrastructure as code solutions, but
ultimately chose Pulumi due to the aforementioned benefits.&lt;/p&gt;
&lt;h2 id="special-offers"&gt;Special Offers&lt;/h2&gt;
&lt;p&gt;In addition to migration services, Pulumi offers two programs to help get up and running quickly:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.pulumi.com/pricing/open-source-free-tier"&gt;Open Source&lt;/a&gt;: Any open source foundation or project can use
Pulumi Team Edition free of charge.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;a href="https://www.pulumi.com/pulumi-for-startups"&gt;Startup Discount&lt;/a&gt;: Any early stage startup gets $10,000 free credits and
access to Pulumi Enterprise.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="calling-all-partners"&gt;Calling All Partners!&lt;/h2&gt;
&lt;p&gt;As Pulumi&amp;rsquo;s market adoption has skyrocketed, we&amp;rsquo;ve begun to build out our official partner program. Although
we don&amp;rsquo;t have anything major to announce (yet), we&amp;rsquo;d love to talk to you if infrastructure as code is an important
part of your own customers&amp;rsquo; needs. That includes ISV product integrations, global and regional systems integrators and
consultants, and more. Note that Pulumi is already available in the
&lt;a href="https://aws.amazon.com/marketplace/pp/prodview-dwn22batkhsyg"&gt;AWS&lt;/a&gt; and
&lt;a href="https://azuremarketplace.microsoft.com/en-us/marketplace/apps/pulumicorporation1618431130005.pulumi_e1"&gt;Azure&lt;/a&gt;
marketplaces. If you are interested in discussing a partnership, please &lt;a href="https://www.pulumi.com/contact"&gt;contact us&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="get-started-today"&gt;Get Started Today&lt;/h2&gt;
&lt;p&gt;Migrating from an existing solution can seem like a daunting task, but with Pulumi&amp;rsquo;s new Migration Hub and Expert
Services, it has never been easier to adopt Pulumi than it is today. To learn more, visit the
&lt;a href="https://www.pulumi.com/migrate"&gt;Migration Hub&lt;/a&gt; or simply &lt;a href="https://www.pulumi.com/contact"&gt;contact us&lt;/a&gt; &amp;ndash; we would love to hear
from you.&lt;/p&gt;</description><author>Joe Duffy</author><category>open-source</category><category>migration</category><category>import</category></item><item><title>Pulumi 💜's Open Source</title><link>https://www.pulumi.com/blog/pulumi-hearts-opensource/</link><pubDate>Fri, 11 Aug 2023 00:00:00 +0000</pubDate><guid>https://www.pulumi.com/blog/pulumi-hearts-opensource/</guid><description>
&lt;img src="https://www.pulumi.com/images/generated/blog/pulumi-hearts-opensource/index.png" /&gt;
&lt;p&gt;Pulumi stands with the open source community.&lt;/p&gt;
&lt;p&gt;We are unaffected by HashiCorp relicensing their software yesterday, and express profound support for many of our cloud friends who have been affected.&lt;/p&gt;
&lt;p&gt;Pulumi is &lt;a href="https://github.com/pulumi/pulumi"&gt;true open source&lt;/a&gt;, uses the Apache 2.0 license, and does not and never will depend on BSL-licensed software in any way, HashiCorp owned or otherwise.&lt;/p&gt;
&lt;p&gt;We look forward to continuing to serve our &lt;a href="https://app.pulumi.com/signup"&gt;new&lt;/a&gt; and loyal customers, always with open source and our amazing, fast-growing community at our core.&lt;/p&gt;</description><author>Joe Duffy</author><category>open-source</category><category>license</category><category>apache</category><category>bsl</category></item><item><title>How Webiny Built a Serverless Application Framework</title><link>https://www.pulumi.com/blog/how-webiny-built-a-serverless-application-framework/</link><pubDate>Thu, 03 Jun 2021 00:00:00 +0000</pubDate><guid>https://www.pulumi.com/blog/how-webiny-built-a-serverless-application-framework/</guid><description>
&lt;img src="https://www.pulumi.com/images/generated/blog/how-webiny-built-a-serverless-application-framework/index.png" /&gt;
&lt;p&gt;Building an open-source framework for building serverless applications has many challenges, one of which is deploying cloud infrastructure resources. In this article, learn how Webiny uses Pulumi to enable its users to easily deploy and develop applications built on top of serverless cloud technologies.&lt;/p&gt;
&lt;h2 id="what-is-webiny"&gt;What is Webiny?&lt;/h2&gt;
&lt;p&gt;&lt;a href="https://www.webiny.com?utm_source=Pulumi&amp;amp;utm_medium=blog-post&amp;amp;utm_campaign=webiny-blog-promotion&amp;amp;utm_content=how-webiny-built-framework-with-pulumi&amp;amp;utm_term=W00646"&gt;Webiny&lt;/a&gt; is an open-source framework for building serverless applications, completely written in TypeScript.&lt;/p&gt;
&lt;p&gt;In other words, it is a framework that enables developers to architect, build, and deploy solutions on top of the serverless cloud infrastructure, like &lt;a href="https://aws.amazon.com/lambda/"&gt;AWS Lambda&lt;/a&gt;, &lt;a href="https://aws.amazon.com/dynamodb/"&gt;Amazon DynamoDB&lt;/a&gt;, &lt;a href="https://aws.amazon.com/s3/"&gt;Amazon S3&lt;/a&gt;, and others. Some examples of what you can build with Webiny today are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;full-stack applications&lt;/li&gt;
&lt;li&gt;websites&lt;/li&gt;
&lt;li&gt;REST and GraphQL APIs&lt;/li&gt;
&lt;li&gt;microservices&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;With the framework, Webiny also built a content management system called the &lt;a href="https://www.webiny.com/docs/infrastructure/pulumi-iac/iac-with-pulumi"&gt;Webiny Serverless CMS&lt;/a&gt;. It is free, open-source, and by default, included with every new Webiny project.&lt;/p&gt;
&lt;p&gt;Finally, it’s worth mentioning that, at the moment, Webiny exclusively works with &lt;a href="https://aws.amazon.com/"&gt;AWS&lt;/a&gt;. But, bringing Webiny to other cloud providers like &lt;a href="https://azure.microsoft.com/en-us/"&gt;Microsoft Azure&lt;/a&gt; and &lt;a href="https://cloud.google.com/"&gt;Google Cloud Platform (GCP)&lt;/a&gt; is definitely something we’ll be looking at in the future.&lt;/p&gt;
&lt;h2 id="building-the-framework---the-challenge"&gt;Building the Framework - The Challenge&lt;/h2&gt;
&lt;p&gt;Building a serverless framework certainly has its challenges. One of which is the deployment of cloud infrastructure, which, in the world of serverless, is one of the fundamental operations developers need to do, even while the application is still in development.&lt;/p&gt;
&lt;p&gt;Before the &lt;a href="https://www.webiny.com/blog/webiny-v5-the-big-update?utm_source=Pulumi&amp;amp;utm_medium=blog-post&amp;amp;utm_campaign=webiny-blog-promotion&amp;amp;utm_content=how-webiny-built-framework-with-pulumi&amp;amp;utm_term=W00648"&gt;version 5 release&lt;/a&gt;, Webiny relied on an infrastructure provisioning technology called Serverless Components (not to be confused with &lt;a href="https://www.serverless.com/"&gt;Serverless Framework&lt;/a&gt;). Using a concept of components, it is a system that enables developers to deploy ready-made blocks of cloud infrastructure resources configured for a specific use-case. Some examples of components are Website, REST API, a Full Stack Application, and more.&lt;/p&gt;
&lt;p&gt;At the time, it seemed that the overall developer experience and the simplicity of the Serverless Components product was the right choice for our users. So, we decided to go with it.&lt;/p&gt;
&lt;p&gt;But, over time, we noticed several things that, unfortunately, made us question our decision. And if I were to choose the top four, I’d mention the following.&lt;/p&gt;
&lt;h3 id="1-hard-to-customize"&gt;1. Hard to Customize&lt;/h3&gt;
&lt;p&gt;While the idea around components for different use-cases certainly sounded interesting, ultimately, it was not ideal for Webiny. We frequently received questions regarding further component configuration and customization, which was not easy to perform.&lt;/p&gt;
&lt;p&gt;“How do I configure a different database?”, “How do I set a VPC?”, “How do I set up a specific configuration parameter for my S3 bucket?” were just some of the questions we received. The answer almost always included us having to implement support for a particular feature. To some degree, this worked, but it was really us patching the holes, which we knew would only get us so far.&lt;/p&gt;
&lt;h3 id="2-using-yaml-instead-of-code"&gt;2. Using YAML Instead of Code&lt;/h3&gt;
&lt;p&gt;At Webiny, we believe &lt;a href="https://www.pulumi.com/cloud-engineering/"&gt;cloud engineering&lt;/a&gt; and infrastructure-as-code is the future, so, naturally, we wanted our users to use familiar code (ideally TypeScript) and development tools to define their cloud infrastructure. Within Serverless Components, the components are configured via YAML files, of which we were never really big fans, simply because of the fact that writing code instead of configurations gives more flexibility to developers.&lt;/p&gt;
&lt;h3 id="3-vendor-lock-in"&gt;3. Vendor Lock-In&lt;/h3&gt;
&lt;p&gt;Vendor lock-in was introduced at a later stage of the Serverless Components product development. Essentially, to deploy a component, the user is now forced to use a proprietary service that comes with it. And while, among other things, the service enables much faster deployments, from our perspective, we saw this as an additional point of friction for our users. Ideally, users should be able to set up Webiny with only an AWS account.&lt;/p&gt;
&lt;h3 id="4-lack-of-support-for-other-cloud-providers"&gt;4. Lack of Support for Other Cloud Providers&lt;/h3&gt;
&lt;p&gt;At the time, Serverless Components’ support for different cloud providers just wasn’t there. This would be a major roadblock for us as we get to multi-cloud integration.&lt;/p&gt;
&lt;h2 id="discovering-pulumi"&gt;Discovering Pulumi&lt;/h2&gt;
&lt;p&gt;Once we realized Serverless Components wasn’t an ideal solution for Webiny, we started looking for an alternative.&lt;/p&gt;
&lt;p&gt;The key features that we were looking for were the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;open-source&lt;/li&gt;
&lt;li&gt;use code (preferably TypeScript) to create cloud infrastructure resources&lt;/li&gt;
&lt;li&gt;cloud infrastructure code should be flexible, meaning, users should be able to make adjustments to it&lt;/li&gt;
&lt;li&gt;support for multiple cloud providers is a must&lt;/li&gt;
&lt;li&gt;no vendor lock-in&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So, the search began, and soon enough, we discovered Pulumi. And as it turned out, it not only checked all the boxes we had initially listed but much more:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;different options when it comes to storing cloud infrastructure state files: a managed SaaS (&lt;a href="https://app.pulumi.com/signin"&gt;pulumi.com&lt;/a&gt;) with a console and self-hosted, (for example &lt;a href="https://aws.amazon.com/s3/"&gt;Amazon S3&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;ability to deploy cloud infrastructure into multiple environments using its concept of &lt;a href="https://www.pulumi.com/docs/concepts/stack/"&gt;stacks&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;advanced features like &lt;a href="https://www.pulumi.com/docs/using-pulumi/crossguard/get-started/"&gt;Policy as Code&lt;/a&gt; and &lt;a href="https://www.pulumi.com/docs/iac/cli/commands/pulumi_watch/"&gt;watch mode&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;great documentation&lt;/li&gt;
&lt;li&gt;a vibrant community of developers and a responsive team behind the product&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I probably forgot to mention a thing or two here, but most certainly, at this point, we were ready to make a move and start experimenting with Pulumi.&lt;/p&gt;
&lt;h2 id="integrating-pulumi-with-webiny"&gt;Integrating Pulumi with Webiny&lt;/h2&gt;
&lt;p&gt;For us, the integration of Pulumi with Webiny consisted of three steps:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;figure out how to integrate Pulumi&amp;rsquo;s programming model with Webiny&lt;/li&gt;
&lt;li&gt;integrate Pulumi CLI into Webiny CLI&lt;/li&gt;
&lt;li&gt;figure out the optimal way of handling cloud infrastructure state files&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Let&amp;rsquo;s see how we tackled each of these three steps.&lt;/p&gt;
&lt;h3 id="integrating-pulumis-programming-model-with-webiny"&gt;Integrating Pulumi&amp;rsquo;s Programming Model With Webiny&lt;/h3&gt;
&lt;p&gt;In terms of &lt;a href="https://www.webiny.com/docs/key-topics/project-organization/project-applications-and-packages?utm_source=Pulumi&amp;amp;utm_medium=blog-post&amp;amp;utm_campaign=webiny-blog-promotion&amp;amp;utm_content=how-webiny-built-framework-with-pulumi&amp;amp;utm_term=W00649"&gt;project organization&lt;/a&gt;, every Webiny project consists of two key concepts: packages and project applications (or just applications).&lt;/p&gt;
&lt;p&gt;Packages are just regular NPM packages, or in other words, folders with a &lt;code&gt;package.json&lt;/code&gt; manifest file and some code. On the other hand, project applications are higher-level organizational units formed from one or more packages that form applications, as the name itself suggests. Applications consist of both application code and cloud infrastructure needed to run them.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://www.pulumi.com/blog/how-webiny-built-a-serverless-application-framework/project-organization.png" alt="Webiny Project Organization"&gt;&lt;/p&gt;
&lt;p&gt;A single Webiny project can contain multiple project applications, where each one has its own independent set of necessary cloud infrastructure resources that need to be deployed.&lt;/p&gt;
&lt;p&gt;As an example, a default Webiny project includes three project applications:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;API&lt;/strong&gt; - essentially, represents your GraphQL HTTP API&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Admin Area&lt;/strong&gt; - the Admin Area (React) application&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Website&lt;/strong&gt; - the public website, a (React) application with static site generation (SSG) in the cloud&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If we were to compare these by the complexity of the necessary cloud infrastructure to deploy, the Admin Area is the simplest. It only relies on a single &lt;a href="https://aws.amazon.com/s3/"&gt;Amazon S3&lt;/a&gt; bucket and an &lt;a href="https://aws.amazon.com/cloudfront/"&gt;Amazon Cloudfront&lt;/a&gt; distribution. On the other hand, the API project application is the most complex one as it needs to deploy multiple &lt;a href="https://aws.amazon.com/lambda/"&gt;AWS Lambda&lt;/a&gt; functions, &lt;a href="https://aws.amazon.com/dynamodb/"&gt;Amazon DynamoDB&lt;/a&gt; tables, Amazon S3 buckets, and more.&lt;/p&gt;
&lt;p&gt;Ultimately, we decided that each project application should be a &lt;a href="https://www.pulumi.com/docs/concepts/projects/#projects"&gt;Pulumi project&lt;/a&gt;. With this approach, we gave developers the ability to both define and deploy respective cloud infrastructures independently. And, with the concept of &lt;a href="https://www.pulumi.com/docs/concepts/stack/"&gt;stacks&lt;/a&gt;, they are also able to deploy them into multiple environments, which we’ll show in a moment.&lt;/p&gt;
&lt;h3 id="pulumi-cli-and-webiny-cli"&gt;Pulumi CLI and Webiny CLI&lt;/h3&gt;
&lt;p&gt;Once we understood how to use Pulumi concepts with Webiny&amp;rsquo;s project organization, the next step was integrating the &lt;a href="https://www.pulumi.com/docs/cli/"&gt;Pulumi CLI&lt;/a&gt; with the &lt;a href="https://www.webiny.com/docs/key-topics/webiny-cli?utm_source=Pulumi&amp;amp;utm_medium=blog-post&amp;amp;utm_campaign=webiny-blog-promotion&amp;amp;utm_content=how-webiny-built-framework-with-pulumi&amp;amp;utm_term=W00650"&gt;Webiny CLI&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;And although the Pulumi CLI is great, we still wanted to keep it super simple for the user and make the overall developer experience as straightforward and unified as possible. For starters, we didn’t want our users to install the Pulumi CLI manually. We wanted it to happen automatically.&lt;/p&gt;
&lt;p&gt;We’ve created our version of the &lt;a href="https://github.com/webiny/webiny-js/tree/v5.28.0/packages/pulumi-sdk"&gt;Pulumi SDK&lt;/a&gt;, which lets us use the Pulumi CLI more programmatically. It also enables us to make the Pulumi CLI download experience as smooth as possible. Essentially, whenever a user runs a deployment-related command, all of the necessary Pulumi CLI binaries and plugins are downloaded and stored inside the project’s node_modules folder.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Although we could’ve saved us some time by using Pulumi’s &lt;a href="https://www.pulumi.com/docs/using-pulumi/automation-api/"&gt;Automation API&lt;/a&gt; (instead of creating the mentioned Pulumi SDK), at the time, the Automation API was still in preview and not generally available. And since the setup we already had was working well, we decided to keep it and hopefully revisit the Automation API integration in the future.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Once we had that in place, we were ready for the next step, exposing a couple of fundamental deployment-related commands via the Webiny CLI. The following examples show us some of the commands users can use:&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;&lt;span class="c1"&gt;# Deploys a project application (internally runs &amp;#34;pulumi up&amp;#34;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;webiny deploy &lt;span class="o"&gt;{&lt;/span&gt;PROJECT_APPLICATION_FOLDER&lt;span class="o"&gt;}&lt;/span&gt; --env &lt;span class="o"&gt;{&lt;/span&gt;ENVIRONMENT&lt;span class="o"&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="c1"&gt;# Previews a project application deployment (internally runs &amp;#34;pulumi preview&amp;#34;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;webiny deploy &lt;span class="o"&gt;{&lt;/span&gt;PROJECT_APPLICATION_FOLDER&lt;span class="o"&gt;}&lt;/span&gt; --env dev --&lt;span class="o"&gt;{&lt;/span&gt;ENVIRONMENT&lt;span class="o"&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="c1"&gt;# Destroys cloud infrastructure resources previously deployed within&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# the specified project application (internally runs &amp;#34;pulumi destroy&amp;#34;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;webiny destroy &lt;span class="o"&gt;{&lt;/span&gt;PROJECT_APPLICATION_FOLDER&lt;span class="o"&gt;}&lt;/span&gt; --env &lt;span class="o"&gt;{&lt;/span&gt;ENVIRONMENT&lt;span class="o"&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="c1"&gt;# Starts watching specified project application and continuously deploys&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="c1"&gt;# changes to the cloud (internally runs &amp;#34;pulumi watch&amp;#34;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;webiny watch &lt;span class="o"&gt;{&lt;/span&gt;PROJECT_APPLICATION_FOLDER&lt;span class="o"&gt;}&lt;/span&gt; --env &lt;span class="o"&gt;{&lt;/span&gt;ENVIRONMENT&lt;span class="o"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Note the &lt;code&gt;--env&lt;/code&gt; argument appended to each command. With it and Pulumi’s concept of stacks, users can easily deploy their project applications into multiple environments.&lt;/p&gt;
&lt;h3 id="cloud-infrastructure-state-files"&gt;Cloud Infrastructure State Files&lt;/h3&gt;
&lt;p&gt;The last piece of the puzzle was storing cloud infrastructure state files. Here we went with the following approach.&lt;/p&gt;
&lt;p&gt;For local development, users’ cloud infrastructure state files are stored locally within their Webiny project using the &lt;a href="https://www.pulumi.com/docs/iac/concepts/state-and-backends/#logging-into-the-local-filesystem-backend"&gt;Local Filesystem Backend&lt;/a&gt;, which we’ve seen worked great for developers.&lt;/p&gt;
&lt;p&gt;On the other hand, for ephemeral environments spawned in CI/CD or long-lived environments like staging or production, through our &lt;a href="https://www.webiny.com/docs/key-topics/ci-cd/cloud-infrastructure-state-files#using-different-backends"&gt;documentation&lt;/a&gt;, we advise our users to use centralized and remote storage by using backends like &lt;a href="https://www.pulumi.com/docs/iac/concepts/state-and-backends/#aws-s3"&gt;Amazon S3&lt;/a&gt; and even &lt;a href="https://www.pulumi.com/docs/iac/concepts/state-and-backends/#logging-into-the-pulumi-service-backend"&gt;Pulumi Cloud (pulumi.com)&lt;/a&gt;. Both backends have their pros and cons, and we let the users choose the one they want to use.&lt;/p&gt;
&lt;h2 id="show-me-the-code"&gt;Show Me the Code&lt;/h2&gt;
&lt;p&gt;Let’s take a look at how it all works in the actual code.&lt;/p&gt;
&lt;p&gt;As mentioned, by default, every Webiny project comes with three project applications: API, Admin Area, and Website, which are located in the &lt;code&gt;api&lt;/code&gt;, &lt;code&gt;apps/admin&lt;/code&gt;, and &lt;code&gt;apps/website&lt;/code&gt; folders, respectively:&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;.
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── api &lt;span class="c1"&gt;# API&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│ ├── code
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│ ├── pulumi
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│ ├── Pulumi.yaml
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│ ├── tsconfig.json
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│ └── webiny.application.ts
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;├── apps
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│ ├── admin &lt;span class="c1"&gt;# Admin Area&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│ │ ├── code
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│ │ ├── pulumi
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│ │ ├── Pulumi.yaml
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│ │ ├── tsconfig.json
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│ │ └── webiny.application.ts
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│ └── website &lt;span class="c1"&gt;# Website&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│ ├── code
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│ ├── pulumi
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│ ├── Pulumi.yaml
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│ ├── tsconfig.json
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;│ └── webiny.application.ts
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;└── &lt;span class="o"&gt;(&lt;/span&gt;...&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;As we can see, every project application follows the same general organization. The two folders in each project are:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;code&lt;/code&gt; - contains application code (one or more packages)&lt;/li&gt;
&lt;li&gt;&lt;code&gt;pulumi&lt;/code&gt; - contains cloud infrastructure (Pulumi) code&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Furthermore, if we opened each of these &lt;code&gt;pulumi&lt;/code&gt; folders, we’d see different cloud infrastructure resources clearly defined via multiple TypeScript classes. As a simple example, if we were to open the &lt;a href="https://github.com/webiny/webiny-js/tree/v5.28.0/packages/cwp-template-aws/template/common/apps/admin/pulumi"&gt;&lt;code&gt;apps/admin/pulumi&lt;/code&gt;&lt;/a&gt; (Admin Area) folder, we’d find the following three files:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/webiny/webiny-js/blob/v5.28.0/packages/cwp-template-aws/template/common/apps/admin/pulumi/app.ts"&gt;&lt;code&gt;app.ts&lt;/code&gt;&lt;/a&gt; - deploys an &lt;a href="https://aws.amazon.com/s3/"&gt;Amazon S3&lt;/a&gt; bucket that hosts the Admin Area (React) application&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/webiny/webiny-js/blob/v5.28.0/packages/cwp-template-aws/template/common/apps/admin/pulumi/cloudfront.ts"&gt;&lt;code&gt;cloudfront.ts&lt;/code&gt;&lt;/a&gt; - deploys an &lt;a href="https://aws.amazon.com/cloudfront/"&gt;Amazon CloudFront&lt;/a&gt; distribution for improved availability&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/webiny/webiny-js/blob/v5.28.0/packages/cwp-template-aws/template/common/apps/admin/pulumi/index.ts"&gt;&lt;code&gt;index.ts&lt;/code&gt;&lt;/a&gt; - the Pulumi entrypoint file, imports classes defined within separate files&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This code organization makes it much easier for developers to grasp the overall cloud infrastructure. It also makes it easier for them to adjust the code to their needs eventually.&lt;/p&gt;
&lt;p&gt;A more complex example is the cloud infrastructure code in the API project application (&lt;a href="https://github.com/webiny/webiny-js/tree/v5.28.0/packages/cwp-template-aws/template/common/api"&gt;&lt;code&gt;api/pulumi&lt;/code&gt;&lt;/a&gt;), which deploys many different cloud infrastructure resources, like &lt;a href="https://www.pulumi.com/registry/packages/aws/api-docs/lambda/"&gt;AWS Lambda functions&lt;/a&gt;, &lt;a href="https://www.pulumi.com/registry/packages/aws/api-docs/lambda/"&gt;DynamoDB tables&lt;/a&gt;, &lt;a href="https://www.pulumi.com/registry/packages/aws/api-docs/elasticsearch/"&gt;ElasticSearch clusters&lt;/a&gt;, &lt;a href="https://www.pulumi.com/registry/packages/aws/api-docs/ec2/"&gt;VPCs&lt;/a&gt;, and more.&lt;/p&gt;
&lt;p&gt;But I will leave this up to you to check out, as pasting multiple chunks of code here might not be that productive.&lt;/p&gt;
&lt;p&gt;Instead, I wanted to focus on a couple of other interesting and useful features that Pulumi and the infrastructure-as-code approach enabled us to create.&lt;/p&gt;
&lt;h3 id="api-project-application---different-dev-and-prod-stacks"&gt;&lt;strong&gt;API&lt;/strong&gt; Project Application - Different &lt;code&gt;dev&lt;/code&gt; and &lt;code&gt;prod&lt;/code&gt; Stacks&lt;/h3&gt;
&lt;p&gt;As mentioned, the API project application contains many different cloud infrastructure resources. But, as it turns out, when it comes to active development, we don’t have to unleash the full potential of the cloud, like we’re doing in staging and production environments.&lt;/p&gt;
&lt;p&gt;For example, it probably makes no sense to deploy an &lt;a href="https://aws.amazon.com/elasticsearch-service/"&gt;Amazon ElasticSearch&lt;/a&gt; cluster into multiple availability zones (AZs) in most cases. A single AZ is enough for development purposes.&lt;/p&gt;
&lt;p&gt;Another good example are &lt;a href="https://aws.amazon.com/vpc/"&gt;VPCs&lt;/a&gt; and potentially &lt;a href="https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html"&gt;NAT Gateways&lt;/a&gt;. Again, for development purposes, in most cases, we could probably get away without these too.&lt;/p&gt;
&lt;p&gt;These extra resources make it slower to perform deployments from developers&amp;rsquo; machines and incur extra costs for an organization because developers are deploying more resources, some of which are charged hourly.&lt;/p&gt;
&lt;p&gt;So, with that in mind, we split the API project application’s cloud infrastructure into two stacks - the &lt;code&gt;dev&lt;/code&gt; and &lt;code&gt;prod&lt;/code&gt;. And, as you might’ve already guessed, only the &lt;code&gt;prod&lt;/code&gt; variant will deploy absolutely all necessary cloud infrastructure resources.&lt;/p&gt;
&lt;p&gt;What is even more interesting is the fact that this can be achieved with a simple if statement, which we placed in the &lt;a href="https://github.com/webiny/webiny-js/blob/v5.28.0/packages/cwp-template-aws/template/ddb-es/api/pulumi/index.ts#L19-L25"&gt;&lt;code&gt;index.ts&lt;/code&gt;&lt;/a&gt; entrypoint file:&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="c1"&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;export&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kr"&gt;async&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;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="c1"&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="c1"&gt;// WEBINY_ENV represents the environment which was passed upon running
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;// the `webiny deploy` command. This is inserted automatically by the
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="c1"&gt;// Webiny CLI.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;WEBINY_ENV&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;prod&amp;#34;&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;WEBINY_ENV&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;staging&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="c1"&gt;// Import &amp;#34;prod&amp;#34; resources config and initialize resources.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="kr"&gt;import&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;./prod&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;module&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;default&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="c1"&gt;// Import &amp;#34;dev&amp;#34; resources config and initialize resources.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="kr"&gt;import&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;./dev&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;module&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="k"&gt;default&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;h4 id="automatic-tagging-of-cloud-infrastructure-resources"&gt;Automatic Tagging of Cloud Infrastructure Resources&lt;/h4&gt;
&lt;p&gt;Another useful feature is the automatic tagging of the deployed cloud infrastructure resources. In other words, every &lt;em&gt;taggable&lt;/em&gt; cloud infrastructure resource will be tagged with &lt;code&gt;WbyProjectName&lt;/code&gt; and &lt;code&gt;WbyEnvironment&lt;/code&gt; tags. For developers, this makes it much easier to see all of the deployed resources within their Webiny project.&lt;/p&gt;
&lt;p&gt;We created a &lt;code&gt;tagResources&lt;/code&gt; function, which essentially registers a global stack transformation via &lt;a href="https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/pulumi/runtime/#registerStackTransformation"&gt;&lt;code&gt;pulumi.runtime.registerStackTransformation&lt;/code&gt;&lt;/a&gt; function to achieve this.&lt;/p&gt;
&lt;p&gt;It is also applied in the same &lt;a href="https://github.com/webiny/webiny-js/blob/v5.28.0/packages/cwp-template-aws/template/common/apps/admin/pulumi/index.ts#L6-L11"&gt;&lt;code&gt;index.ts&lt;/code&gt;&lt;/a&gt; entrypoint file we saw in the previous section:&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;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;tagResources&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="kr"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;@webiny/cli-plugin-deploy-pulumi/utils&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;export&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kr"&gt;async&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;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="c1"&gt;// Add tags to all resources that support tagging.
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;tagResources&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;WbyProjectName&lt;/span&gt;: &lt;span class="kt"&gt;process.env.WEBINY_PROJECT_NAME&lt;/span&gt; &lt;span class="kr"&gt;as&lt;/span&gt; &lt;span class="kt"&gt;string&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;WbyEnvironment&lt;/span&gt;: &lt;span class="kt"&gt;process.env.WEBINY_ENV&lt;/span&gt; &lt;span class="kr"&gt;as&lt;/span&gt; &lt;span class="kt"&gt;string&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="c1"&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;h4 id="protect-feature"&gt;Protect Feature&lt;/h4&gt;
&lt;p&gt;Finally, to protect our users from accidental deletions of mission-critical cloud infrastructure resources, we’ve used Pulumi’s &lt;a href="https://www.pulumi.com/docs/concepts/resources/#protect"&gt;protect&lt;/a&gt; feature:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;The protect option marks a resource as protected. A protected resource cannot be deleted directly. Instead, you must first set &lt;code&gt;protect: false&lt;/code&gt; and run &lt;code&gt;pulumi up&lt;/code&gt;. Then you can delete the resource by removing the line of code or by running &lt;code&gt;pulumi destroy&lt;/code&gt;. The default is to inherit this value from the parent resource and &lt;code&gt;false&lt;/code&gt; for resources without a parent.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;So, for Webiny users, we’ve made sure that this feature is automatically enabled for resources like &lt;a href="https://github.com/webiny/webiny-js/blob/v5.28.0/packages/cwp-template-aws/template/ddb/api/pulumi/prod/dynamoDb.ts#L27"&gt;DynamoDB tables&lt;/a&gt;, &lt;a href="https://github.com/webiny/webiny-js/blob/v5.28.0/packages/cwp-template-aws/template/ddb/api/pulumi/prod/cognito.ts#L70"&gt;Cognito User Pools&lt;/a&gt;, &lt;a href="https://github.com/webiny/webiny-js/blob/v5.28.0/packages/cwp-template-aws/template/ddb-es/api/pulumi/prod/elasticSearch.ts#L42"&gt;Elasticsearch Cluster&lt;/a&gt;, and similar.&lt;/p&gt;
&lt;h2 id="future-plans"&gt;Future Plans&lt;/h2&gt;
&lt;p&gt;With the &lt;a href="https://www.webiny.com/blog/webiny-v5-the-big-update?utm_source=Pulumi&amp;amp;utm_medium=blog-post&amp;amp;utm_campaign=webiny-blog-promotion&amp;amp;utm_content=how-webiny-built-framework-with-pulumi&amp;amp;utm_term=W00648"&gt;Webiny v5&lt;/a&gt;, we managed to introduce many significant improvements to both the Webiny Serverless Application Framework and Webiny Serverless CMS. However, we still have a lot of new cool things to unravel.&lt;/p&gt;
&lt;p&gt;Webiny aims to be a multi-cloud compatible solution, and this is something Pulumi will significantly assist us with because deploying to multiple cloud providers is supported.&lt;/p&gt;
&lt;p&gt;With that, we would also like to create various project templates, which would, for example, enable users to quickly start working on a new GraphQL or REST HTTP API, a simple React application, a microservice, and more. All of these require specific cloud infrastructure resources to be deployed, and again, this is where Pulumi will make our users&amp;rsquo; lives much easier.&lt;/p&gt;
&lt;p&gt;Finally, I already mentioned the &lt;a href="https://www.pulumi.com/automation/"&gt;Automation API&lt;/a&gt; as something that we might look into in the future, as it seems it’s something that can be seamlessly integrated with Webiny.&lt;/p&gt;
&lt;h2 id="conclusion"&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;For Webiny, choosing Pulumi as the default &lt;a href="https://www.pulumi.com/what-is/what-is-infrastructure-as-code/"&gt;infrastructure as code&lt;/a&gt; framework was certainly a big leap in the right direction.&lt;/p&gt;
&lt;p&gt;It enabled us to leave the complexities of cloud infrastructure deployments to a product and company whose primary focus is exactly that. And this is what ultimately helped us completely focus on what we care about the most - creating an awesome serverless application framework.&lt;/p&gt;</description><author>Adrian Smijulj</author><category>open-source</category><category>serverless</category><category>frameworks</category></item></channel></rss>