<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0"><channel><title>Pulumi Blog: Sean Holung</title><link>https://www.pulumi.com/blog/author/sean-holung/</link><description>Pulumi blog posts: Sean Holung.</description><language>en-us</language><pubDate>Mon, 12 Jun 2023 00:00:00 +0000</pubDate><item><title>Enhanced search &amp; Navigation: The new Pulumi Docs experience</title><link>https://www.pulumi.com/blog/enhanced-search-intuitive-navigation-new-docs-experience/</link><pubDate>Mon, 12 Jun 2023 00:00:00 +0000</pubDate><guid>https://www.pulumi.com/blog/enhanced-search-intuitive-navigation-new-docs-experience/</guid><description>
&lt;img src="https://www.pulumi.com/images/generated/blog/enhanced-search-intuitive-navigation-new-docs-experience/index.png" /&gt;
&lt;p&gt;Engineers spend a lot of their valuable time searching documentation for answers. At Pulumi, we believe in exceptional documentation experiences that help people using Pulumi find what they need quickly and use it successfully. Today, we are announcing a set of improved Pulumi documentation experiences that collectively make it easier than ever to discover, learn and build cloud infrastructure with Pulumi.&lt;/p&gt;
&lt;p&gt;The improvements we&amp;rsquo;ve introduced to the Pulumi documentation experience focus on three areas - search, navigation and discoverability. Together, they help every user of the Pulumi documentation find the answers they are looking for quickly, so they can solve their infrastructure as code use case and leverage Pulumi effectively in their projects. These changes also introduce new design patterns and user experience elements across previously independent parts of the Pulumi documentation experience, creating a more cohesive developer experience.&lt;/p&gt;
&lt;h2 id="search"&gt;Search&lt;/h2&gt;
&lt;p&gt;As of today, you can quickly and easily search for documentation across all of these types, and we will lead you to the documentation you are looking for to solve your problem. The new search clearly groups documentation by &lt;em&gt;Docs&lt;/em&gt; and &lt;em&gt;Packages&lt;/em&gt; with clear breadcrumbs to quickly get you to the right place.&lt;/p&gt;
&lt;p&gt;&lt;img src="imgs/search.png" alt="Pulumi docs search"&gt;&lt;/p&gt;
&lt;h2 id="unified-navigation"&gt;Unified navigation&lt;/h2&gt;
&lt;p&gt;We have unified navigation across both docs and packages and expect to add more content types to Pulumi Docs over the rest of the year. Enjoy easily switching between documentation types while having your left navigation and table of contents navigation remain consistent.&lt;/p&gt;
&lt;p&gt;&lt;img src="imgs/navigation.png" alt="Pulumi docs navigation"&gt;&lt;/p&gt;
&lt;h2 id="discoverability"&gt;Discoverability&lt;/h2&gt;
&lt;p&gt;In addition to search and navigation, folks must be able to discover new content that will help them even if they don&amp;rsquo;t know that content exists. To that end, let&amp;rsquo;s showcase a few types of Pulumi documentation:&lt;/p&gt;
&lt;h3 id="quickstart-experience"&gt;Quickstart experience&lt;/h3&gt;
&lt;p&gt;The &lt;a href="https://www.pulumi.com/docs/get-started/"&gt;Pulumi quickstart&lt;/a&gt; experience is for people new to Pulumi to get up and running quickly.&lt;/p&gt;
&lt;p&gt;&lt;img src="imgs/quickstart.png" alt="Pulumi docs quickstart experience"&gt;&lt;/p&gt;
&lt;h3 id="cloud-get-started-tutorials"&gt;Cloud get started tutorials&lt;/h3&gt;
&lt;p&gt;The &lt;a href="https://www.pulumi.com/docs/clouds/"&gt;Pulumi cloud get started tutorials&lt;/a&gt; are for people who want a more detailed walkthrough when using Pulumi for the first time.&lt;/p&gt;
&lt;p&gt;&lt;img src="imgs/get-started.png" alt="Pulumi cloud get started tutorials"&gt;&lt;/p&gt;
&lt;h3 id="concept-docs"&gt;Concept docs&lt;/h3&gt;
&lt;p&gt;The &lt;a href="https://www.pulumi.com/docs/concepts/"&gt;Pulumi concept docs&lt;/a&gt; are where you can dive into Pulumi concepts. Learn how they work together and how to effectively use them to ship infrastructure.&lt;/p&gt;
&lt;p&gt;&lt;img src="imgs/concepts.png" alt="Pulumi concept docs"&gt;&lt;/p&gt;
&lt;h3 id="packages"&gt;Packages&lt;/h3&gt;
&lt;p&gt;The &lt;a href="https://www.pulumi.com/registry/"&gt;package documentation&lt;/a&gt; is where to find configuration and API documentation for Pulumi supported clouds, version control systems, databases, infrastructure monitoring, and networking tools. We support 119 providers today, and we add new providers every week!&lt;/p&gt;
&lt;p&gt;&lt;img src="imgs/packages.png" alt="Pulumi api packages"&gt;&lt;/p&gt;
&lt;p&gt;Head to &lt;a href="https://www.pulumi.com/docs/"&gt;Pulumi docs&lt;/a&gt;, learn something new, and send us your feedback!&lt;/p&gt;</description><author>susan evans</author><author>Anita Trimbur</author><author>Sean Holung</author><category>releases</category><category>features</category><category>ux</category></item><item><title>Introducing the Azure Static Website Component</title><link>https://www.pulumi.com/blog/deploy-azure-static-website/</link><pubDate>Tue, 11 Oct 2022 00:00:00 +0000</pubDate><guid>https://www.pulumi.com/blog/deploy-azure-static-website/</guid><description>
&lt;img src="https://www.pulumi.com/images/generated/blog/deploy-azure-static-website/index.png" /&gt;
&lt;p&gt;Deploying a static website often involves provisioning a number of pieces of infrastructure and stitching those pieces together in a way to make the site accessible to your users. A static website typically consists of HTML, CSS, and JavaScript files along with any other static assets the site might need to render such as PNG and SVG files for example. These files are then uploaded to a storage bucket where they can be served from. This post will demonstrate how to easily deploy your static website to Azure and make it available for public access.&lt;/p&gt;
&lt;h2 id="azure-static-website-component"&gt;Azure Static Website Component&lt;/h2&gt;
&lt;p&gt;Pulumi components enable us to create re-usable abstractions that can perform complex tasks all behind a simple interface the user can programmatically interact with. The &lt;a href="https://www.pulumi.com/registry/packages/azure-static-website/"&gt;Azure Static Website component&lt;/a&gt; looks to take all of the complexity of getting a static website deployed to Azure and simplify it down to just consuming a simple component and passing it a few input arguments. This component relieves the complexities of this process by allowing you to simply tell the component where your files are located and it will take care of all the rest.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;This component does the following:&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Provisions an Azure storage account&lt;/li&gt;
&lt;li&gt;Uploads the website contents located in the specified directory&lt;/li&gt;
&lt;li&gt;Optionally can configure a CDN, custom domain, and certs.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="using-the-component-to-deploy-a-static-website"&gt;Using the component to deploy a static website&lt;/h2&gt;
&lt;p&gt;Let’s walk through a simple example of using this component to deploy a static website. Today, we are going to provision a storage account, upload the website contents, and wire it up to an Azure CDN.&lt;/p&gt;
&lt;p&gt;In order to follow along with this example you will need to have the following:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Pulumi CLI installed on your machine&lt;/li&gt;
&lt;li&gt;Access to an Azure account to provision the infrastructure&lt;/li&gt;
&lt;li&gt;Static site to upload&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See our &lt;a href="https://www.pulumi.com/docs/iac/get-started/azure/"&gt;getting started&lt;/a&gt; guide for information on how to configure Pulumi and Azure.&lt;/p&gt;
&lt;p&gt;We will provision a number of pieces of infrastructure in Azure to enable serving our static website. The main ones are a Storage Account to contain all of our website files and a CDN. Let’s start by creating a new Pulumi project. First, create a new directory on your machine where the Pulumi project will live. A common pattern is to include the infrastructure configuration in a directory alongside the website you will be deploying. You can create a directory called &lt;code&gt;infrastructure&lt;/code&gt; to house the Pulumi program or you can use another name if you prefer. This allows us to easily reference the location of the contents of your site as well as keeps your infrastructure code along-side your application. Pulumi supports multiple programming languages such as TypeScript, Python, Go, .NET, and even markup languages like YAML. Once you have created the directory, run the following command for your language of choice inside the directory:&lt;/p&gt;
&lt;div&gt;
&lt;pulumi-chooser type="language" options="typescript,python,csharp,go,yaml" mode=""&gt;
&lt;div&gt;
&lt;pulumi-choosable type="language" values="typescript" mode=""&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 new azure-typescript
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/pulumi-choosable&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;pulumi-choosable type="language" values="python" mode=""&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 new azure-python
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/pulumi-choosable&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;pulumi-choosable type="language" values="csharp" mode=""&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 new azure-csharp
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/pulumi-choosable&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;pulumi-choosable type="language" values="go" mode=""&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 new azure-go
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/pulumi-choosable&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;pulumi-choosable type="language" values="yaml" mode=""&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 new azure-yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/pulumi-choosable&gt;
&lt;/div&gt;
&lt;/pulumi-chooser&gt;
&lt;/div&gt;
&lt;p&gt;There will be some prompts that appear asking you a few questions. Feel free to accept the defaults or change them to your desired preference. This command generated a new project and created a few files for you. You can copy the code examples below for the language you chose to use.&lt;/p&gt;
&lt;div&gt;
&lt;pulumi-chooser type="language" options="typescript,python,csharp,go,yaml" mode=""&gt;
&lt;div&gt;
&lt;pulumi-choosable type="language" values="typescript" mode=""&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="o"&gt;*&lt;/span&gt; &lt;span class="kr"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;pulumi&lt;/span&gt; &lt;span class="kr"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;@pulumi/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="kr"&gt;import&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="kr"&gt;as&lt;/span&gt; &lt;span class="nx"&gt;website&lt;/span&gt; &lt;span class="kr"&gt;from&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;@pulumi/azure-static-website&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;site&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;website&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;Website&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;site&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;sitePath&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;../site&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// replace with path containing website contents
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="nx"&gt;withCDN&lt;/span&gt;: &lt;span class="kt"&gt;true&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;export&lt;/span&gt; &lt;span class="kr"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;cdnURL&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;site&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;/pulumi-choosable&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;pulumi-choosable type="language" values="python" mode=""&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-python" data-lang="python"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;pulumi&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;pulumi_azure_static_website&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nn"&gt;azure_static_website&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="n"&gt;site&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;azure_static_website&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Website&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;site&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="n"&gt;site_path&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;../site&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;# replace with path containing website contents&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; &lt;span class="n"&gt;with_cdn&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="kc"&gt;True&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="n"&gt;pulumi&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;export&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;cdnURL&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;site&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;cdn_url&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;/pulumi-choosable&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;pulumi-choosable type="language" values="csharp" mode=""&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-csharp" data-lang="csharp"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;System.Collections.Generic&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="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;Pulumi&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="k"&gt;using&lt;/span&gt; &lt;span class="nn"&gt;AzureStaticWebsite&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Pulumi&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AzureStaticWebsite&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="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;Deployment&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;RunAsync&lt;/span&gt;&lt;span class="p"&gt;(()&lt;/span&gt; &lt;span class="p"&gt;=&amp;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 class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;web&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;AzureStaticWebsite&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Website&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;web&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;new&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 class="n"&gt;WithCDN&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="kc"&gt;true&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="n"&gt;SitePath&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;../site&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="c1"&gt;// replace with path containing website contents&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="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="n"&gt;Dictionary&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;string&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;object?&lt;/span&gt;&lt;span class="p"&gt;&amp;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 class="na"&gt; [&amp;#34;websiteURL&amp;#34;]&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;web&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CdnURL&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 class="p"&gt;});&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/pulumi-choosable&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;pulumi-choosable type="language" values="go" mode=""&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-go" data-lang="go"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;package&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;main&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kn"&gt;import&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;github.com/pulumi/pulumi-azure-static-website/sdk/go/azure-static-website&amp;#34;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;github.com/pulumi/pulumi/sdk/v3/go/pulumi&amp;#34;&lt;/span&gt;&lt;span class="w"&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="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="kd"&gt;func&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nf"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;pulumi&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;func&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&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;Context&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kt"&gt;error&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;web&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;:=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;azure&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;static&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;website&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;NewWebsite&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;#34;web&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nx"&gt;azure&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;static&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="nx"&gt;website&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;WebsiteArgs&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;WithCDN&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;pulumi&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Bool&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;SitePath&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;pulumi&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;String&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;../site&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="c1"&gt;// replace with path containing website contents&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;!=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;nil&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;ctx&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;Export&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;#34;websiteURL&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nx"&gt;web&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;CdnURL&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;nil&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;&lt;span class="w"&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="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/pulumi-choosable&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;pulumi-choosable type="language" values="yaml" mode=""&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;az-website&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;runtime&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;yaml&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;A static website build with pulumi-azure-static-website.&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;resources&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;web&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;azure-static-website:index:Website&amp;#34;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;properties&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;withCDN&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;sitePath&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;../site&amp;#34;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;outputs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;websiteURL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;${web.cdnURL}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/pulumi-choosable&gt;
&lt;/div&gt;
&lt;/pulumi-chooser&gt;
&lt;/div&gt;
&lt;p&gt;This code creates a new instance of the Website component and sets a couple of properties. &lt;code&gt;sitePath&lt;/code&gt; is the location where your website contents live. The &lt;code&gt;sitePath&lt;/code&gt; specified should be the output location of your website&amp;rsquo;s build not the overall directory where your application lives. For example, if using a framework like React, the build output is usually placed in a directory called &lt;code&gt;build&lt;/code&gt;. In addition, we set &lt;code&gt;withCDN&lt;/code&gt; to true to let the component know that you would like to provision a CDN as well. It also exports the &lt;code&gt;cdnURL&lt;/code&gt; property, which is the URL where the site can be accessed. That’s all that is needed and now we are ready to deploy!&lt;/p&gt;
&lt;p&gt;You can now run &lt;code&gt;pulumi up&lt;/code&gt; to deploy the site to Azure. This will first show a preview of the resources that will be provisioned. You can go ahead and accept by selecting &lt;code&gt;yes&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;img src="cli.png" alt="alt_text" title="pulumi up CLI output"&gt;&lt;/p&gt;
&lt;p&gt;In a few minutes your site will be provisioned and ready to access. Use the &lt;code&gt;cdnURL&lt;/code&gt; that was output at the end of the provisioning to access the site!&lt;/p&gt;
&lt;p&gt;As you can see, the Azure static website component made this task very easy. With just a few lines of code we were able to provision our site.&lt;/p&gt;
&lt;p&gt;If you would like to learn more about Pulumi, here are some links you may find interesting:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Visit our &lt;a href="https://www.pulumi.com/docs/get-started/"&gt;Getting Started&lt;/a&gt; to quickly get up and running with Pulumi.&lt;/li&gt;
&lt;li&gt;View the GitHub repo for the &lt;a href="https://github.com/pulumi/pulumi-aws-static-website"&gt;Azure static website component&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Visit our &lt;a href="https://www.pulumi.com/registry/"&gt;registry page&lt;/a&gt; to more components we have available for you to consume.&lt;/li&gt;
&lt;li&gt;Check out our new &lt;a href="https://www.pulumi.com/templates/"&gt;templates&lt;/a&gt; that make it quick and easy to deploy common cloud architectures.&lt;/li&gt;
&lt;/ul&gt;</description><author>Sean Holung</author><category>azure</category><category>configuration</category><category>components</category><category>static-websites</category></item><item><title>Create an AWS Static Website Fast with Angular and Pulumi</title><link>https://www.pulumi.com/blog/deploy-aws-static-website-with-angular-components/</link><pubDate>Wed, 24 Aug 2022 00:00:00 +0000</pubDate><guid>https://www.pulumi.com/blog/deploy-aws-static-website-with-angular-components/</guid><description>
&lt;img src="https://www.pulumi.com/images/generated/blog/deploy-aws-static-website-with-angular-components/index.png" /&gt;
&lt;p&gt;In this blog post, we’re going to use some Angular framework components to assemble a static website and then use Pulumi and its AWS Static Website component to deploy it to AWS. The website is for a café called the Pulumi Café. It will contain two pages, one an About page and the other a Menu page, as well as some navigational pieces.&lt;/p&gt;
&lt;p&gt;To follow this example, you need to have both Angular and Pulumi installed. (Here’s a link to the &lt;a href="https://www.pulumi.com/docs/iac/get-started/aws/"&gt;Pulumi installation instructions&lt;/a&gt;.) You’ll also need an AWS account.&lt;/p&gt;
&lt;h2 id="what-is-angular"&gt;What is Angular?&lt;/h2&gt;
&lt;p&gt;Angular is an open-source UI framework for building single-page client applications with HTML and TypeScript. Angular itself is written in TypeScript and its architecture follows the Model-View-Controller (MVC) design pattern.&lt;/p&gt;
&lt;h2 id="what-are-components-in-angular"&gt;What are Components in Angular?&lt;/h2&gt;
&lt;p&gt;In Angular, the basic building blocks of a website are called &lt;em&gt;components&lt;/em&gt;. These are reusable structures that contain their own logic and functionality. For example, you could create a button as an Angular component and program it to have a particular look and a particular behavior. Then, you would reuse the button component wherever you need it in the website. The button could also be configurable meaning that, based on different properties, you could change its look and behavior.&lt;/p&gt;
&lt;p&gt;A simple website, like the one we’ll be building in this post, is mainly created from a group of Angular components.&lt;/p&gt;
&lt;h2 id="what-is-the-aws-static-website-component"&gt;What is the AWS Static Website Component?&lt;/h2&gt;
&lt;p&gt;The AWS Static Website component from Pulumi makes it easy to deploy an AWS S3 static website and, optionally, add a CloudFront content distribution network (CDN). While you can use any of the programming languages Pulumi supports (TypeScript, JavaScript, Python, Go, .NET, Java, and YAML), we’ll be using TypeScript, since that is what the Angular framework uses.&lt;/p&gt;
&lt;p&gt;The great advantage of the AWS Static Website component is that you can have a complete, functioning site in a few minutes. The component encapsulates all the complex logic that an AWS static website requires. Without the component, you would need to spend hours or even days writing and debugging code to get the same result.&lt;/p&gt;
&lt;p&gt;If you’re interested in learning more about the component, read &lt;a href="https://www.pulumi.com/blog/deploy-aws-static-website-with-yaml/"&gt;Deploy Static Websites to AWS using 10 lines of YAML&lt;/a&gt;.&lt;/p&gt;
&lt;h2 id="the-angular-components"&gt;The Angular Components&lt;/h2&gt;
&lt;p&gt;All the Angular components you need to build the website are available in the GitHub &lt;a href="https://github.com/sean1588/angular-static-site-pulumi"&gt;repository&lt;/a&gt;. The repository contains:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;A component for the &lt;a href="https://github.com/sean1588/angular-static-site-pulumi/tree/main/src/app/components/shared/leftnav"&gt;left navigation bar&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;A component for the &lt;a href="https://github.com/sean1588/angular-static-site-pulumi/tree/main/src/app/components/shared/topnav"&gt;top navigation bar&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;A component for the &lt;a href="https://github.com/sean1588/angular-static-site-pulumi/tree/main/src/app/components/home"&gt;Home&lt;/a&gt; page.&lt;/li&gt;
&lt;li&gt;A component for the &lt;a href="https://github.com/sean1588/angular-static-site-pulumi/tree/main/src/app/components/menu"&gt;Menu&lt;/a&gt; page.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We also use some components that come with the Angular framework.&lt;/p&gt;
&lt;p&gt;Each of the components has a TypeScript file that contains the programming logic and an HTML file that describes how the component will render.&lt;/p&gt;
&lt;h2 id="building-the-pulumi-café-website"&gt;Building the Pulumi Café Website&lt;/h2&gt;
&lt;p&gt;Here are the instructions to build the website.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Clone the GitHub repository located &lt;a href="https://github.com/sean1588/angular-static-site-pulumi"&gt;here&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Run &lt;code&gt;npm install&lt;/code&gt; to install the website’s node dependencies.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="deploy-the-site-with-pulumi"&gt;Deploy the Site with Pulumi&lt;/h2&gt;
&lt;p&gt;You’re now ready to set up Pulumi to deploy the site to AWS.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a directory named &lt;code&gt;pulumi&lt;/code&gt; in the root of the project directory and then navigate to it with this command:&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;mkdir pulumi &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd&lt;/span&gt; pulumi
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You’re now in the &lt;code&gt;pulumi&lt;/code&gt; directory. Generate a Pulumi project file and create a Pulumi.yaml file with the following command. You will be asked a few questions from the prompt. Use &lt;code&gt;angular-static-website&lt;/code&gt; for the project name and accept the suggested defaults for the remaining questions:&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 new aws-yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id="modify-the-yaml-file"&gt;Modify the .yaml File&lt;/h2&gt;
&lt;p&gt;We need to add a few lines of code to the Pulumi.yaml file. In the &lt;code&gt;resources&lt;/code&gt; section, the code references the AWS Static Website component and sets the &lt;code&gt;sitePath&lt;/code&gt; property to the location of the &lt;code&gt;dist&lt;/code&gt; build directory. We also want to know the URL of the site once it’s deployed. That’s what the &lt;code&gt;outputs&lt;/code&gt; section does. The &lt;code&gt;websiteURL&lt;/code&gt; parameter is one of the outputs that the AWS Static Website component provides. Replace the contents of &lt;code&gt;Pulumi.yaml&lt;/code&gt; with the following code:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;angular-static-website&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;runtime&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;yaml&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;Example of deploying Angular with Pulumi&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;resources&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;web&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;aws-static-website:index:Website&amp;#34;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;properties&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;sitePath&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;../dist/&amp;#34;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;outputs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;websiteURL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;${web.websiteURL}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;The AWS Static Website component is the reason you only need a few lines of code to deploy the site. By using it, all the work of setting up AWS is done for you.&lt;/p&gt;
&lt;p&gt;To deploy the website, type &lt;code&gt;pulumi up&lt;/code&gt;. You’ll first see a preview of all the resources that will be created. Confirm that you want to proceed and Pulumi deploys the website to AWS.&lt;/p&gt;
&lt;p&gt;It’s that simple. With just a few lines of code and one command you deployed your site. Navigate to the site and you’ll see the Home page for the café.&lt;/p&gt;
&lt;p&gt;You can see the navigation components on the left-hand side. Click &lt;code&gt;Menu&lt;/code&gt; to see the Menu page.&lt;/p&gt;
&lt;p&gt;&lt;img src="pulumi-cafe-home.png" alt="pulumi cafe home page"&gt;&lt;/p&gt;
&lt;h2 id="manage-your-site-with-pulumi"&gt;Manage Your Site with Pulumi&lt;/h2&gt;
&lt;p&gt;Along with making it simple to deploy your site, Pulumi also makes it easy to perform some management tasks. For example, If you want to take down the site, run &lt;code&gt;pulumi destroy&lt;/code&gt;. You never have to worry that you’ll forget to remove some resource and continue to pay for it. Pulumi also keeps track of changes to website files, can generate resource graphs and give you complete information about the resources you’re using.&lt;/p&gt;
&lt;p&gt;&lt;img src="pulumi-cli.png" alt="pulumi cli output"&gt;&lt;/p&gt;
&lt;h2 id="learn-more"&gt;Learn More&lt;/h2&gt;
&lt;p&gt;If you want to learn more about Pulumi and the AWS Static Website component, here are a few links you might find interesting:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Along with the &lt;a href="https://www.pulumi.com/blog/deploy-aws-static-website-with-yaml/"&gt;Deploy Static Websites to AWS using 10 lines of YAML&lt;/a&gt; blog post, take a look at the &lt;a href="https://www.pulumi.com/registry/packages/aws-static-website/"&gt;AWS Static Website reference page&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;If you want to learn about other Pulumi components, the &lt;a href="https://www.pulumi.com/registry/"&gt;registry&lt;/a&gt; page catalogs them all.&lt;/li&gt;
&lt;li&gt;If you want to view more examples of how to use Pulumi, go to the Pulumi &lt;a href="https://github.com/pulumi/examples"&gt;examples&lt;/a&gt; repo.&lt;/li&gt;
&lt;li&gt;If you want to delve deeper into Pulumi, the &lt;a href="https://www.pulumi.com/docs/get-started/"&gt;Getting Started&lt;/a&gt; guide is a good first step.&lt;/li&gt;
&lt;li&gt;If you’re interested in learning more about Pulumi concepts, try the &lt;a href="https://www.pulumi.com/docs/concepts/"&gt;Concepts&lt;/a&gt; page.&lt;/li&gt;
&lt;li&gt;If you want to learn more about Angular, see their &lt;a href="https://angular.io/start"&gt;Getting Started&lt;/a&gt; docs.&lt;/li&gt;
&lt;/ul&gt;</description><author>Sean Holung</author><category>aws</category><category>yaml</category><category>configuration</category><category>components</category><category>static-websites</category><category>angular</category></item><item><title>Deploy Static Websites to AWS using 10 lines of YAML</title><link>https://www.pulumi.com/blog/deploy-aws-static-website-with-yaml/</link><pubDate>Thu, 07 Jul 2022 00:00:00 +0000</pubDate><guid>https://www.pulumi.com/blog/deploy-aws-static-website-with-yaml/</guid><description>
&lt;img src="https://www.pulumi.com/images/generated/blog/deploy-aws-static-website-with-yaml/index.png" /&gt;
&lt;p&gt;The &lt;a href="https://www.pulumi.com/registry/packages/aws-static-website/"&gt;AWS Static Website&lt;/a&gt; component makes it easy to deploy an AWS S3 static website and, optionally, add a CloudFront content distribution network (CDN). While you can use any of the programming languages Pulumi supports (TypeScript, JavaScript, Python, Go, .NET, Java, and YAML), the component is particularly useful if you use YAML or JSON. With the AWS Static Website component, you’ll have a complete, functioning site in a few minutes. Without it, you can spend hours or even days to get the same result.&lt;/p&gt;
&lt;p&gt;The component is designed to be simple to use and accessible to a broad range of developers. The only prerequisites are a basic knowledge of YAML or JSON, an AWS account, and an understanding of what a static website is. Even if you’re not used to thinking about infrastructure as code (IaC), you can use the component and let it handle the complexities that make setting up a website so time consuming.&lt;/p&gt;
&lt;p&gt;You will need to have Pulumi on your machine to use the component because you run the &lt;code&gt;pulumi up&lt;/code&gt; command to deploy the website. There’s a link to the &lt;a href="#install"&gt;installation instructions&lt;/a&gt; at the end of this article. You’ll also need an AWS account.&lt;/p&gt;
&lt;h2 id="what-the-component-does"&gt;What the Component Does&lt;/h2&gt;
&lt;p&gt;The component deploys a static website to AWS and, optionally, a CloudFront CDN. You simply add a few lines of code, set a few configuration parameters, run &lt;code&gt;pulumi up&lt;/code&gt; and let the component do the rest. The component sets up:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;An Amazon S3 bucket&lt;/li&gt;
&lt;li&gt;An Amazon CloudFront CDN (optional)
&lt;ul&gt;
&lt;li&gt;An Amazon Route 53 DNS record&lt;/li&gt;
&lt;li&gt;An Amazon Certificate Manager SSL/TLS certificate&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="some-examples"&gt;Some Examples&lt;/h2&gt;
&lt;p&gt;Let’s look at two examples of how to use the component. We’re going to use YAML in this post, but JSON is also supported as well.&lt;/p&gt;
&lt;h2 id="create-a-website"&gt;Create a Website&lt;/h2&gt;
&lt;p&gt;This YAML code creates a basic static website.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;react-static-website&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;runtime&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;yaml&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;Example of deploying React with Pulumi&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;resources&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;web&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;aws-static-website:index:Website&amp;#34;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;properties&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;sitePath&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;../my-website/build&amp;#34;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;outputs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;websiteURL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;${web.websiteURL}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This is the JSON equivalent of the code shown above.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-json" data-lang="json"&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 class="nt"&gt;&amp;#34;name&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;react-static-website&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="nt"&gt;&amp;#34;runtime&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;yaml&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="nt"&gt;&amp;#34;description&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;Example of deploying React with 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="nt"&gt;&amp;#34;resources&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="nt"&gt;&amp;#34;web&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="nt"&gt;&amp;#34;type&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;aws-static-website:index:Website&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="nt"&gt;&amp;#34;properties&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="nt"&gt;&amp;#34;sitePath&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;../my-website/build&amp;#34;&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 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 class="nt"&gt;&amp;#34;outputs&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="nt"&gt;&amp;#34;websiteURL&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;&amp;#34;${web.websiteURL}&amp;#34;&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 class="p"&gt;}&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;This example code deploys a static React website but you can use the component with any other static website framework, such as Hugo. The only parameter that would change is the output directory specified in the &lt;code&gt;sitePath&lt;/code&gt; property.&lt;/p&gt;
&lt;p&gt;The first two lines of this example give the project a name and tell Pulumi that the code is YAML. The next line is simply a description of the project.&lt;/p&gt;
&lt;p&gt;Next you allocate a &lt;em&gt;resource&lt;/em&gt;. This is a Pulumi term. Resources are the fundamental units that make up your cloud infrastructure and Pulumi provides many resources that are ready for you to use. Here, you only need one: &lt;code&gt;aws-static-website:Website&lt;/code&gt;, which is the AWS Static Website component. The resource has an input property, &lt;code&gt;sitePath&lt;/code&gt;, which is the root directory that contains the website&amp;rsquo;s contents. Of course, you can use any path you want.&lt;/p&gt;
&lt;p&gt;Finally, you’ll probably want to know the URL of your new site once it’s deployed. That’s what the &lt;code&gt;outputs&lt;/code&gt; line does. &lt;code&gt;websiteURL&lt;/code&gt; is one of the outputs that the component provides.&lt;/p&gt;
&lt;h3 id="get-started"&gt;Get Started&lt;/h3&gt;
&lt;p&gt;To get started, go to the folder that contains your static website project. Then, follow these steps.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Create a directory named &lt;strong&gt;infrastructure&lt;/strong&gt; alongside your website project directory with this command:&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;mkdir infrastructure &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="nb"&gt;cd&lt;/span&gt; infrastructure
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;You’re now in the infrastructure directory. Generate a &lt;code&gt;Pulumi.yaml&lt;/code&gt; file with this command:&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 new aws-yaml
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Here’s an example of what the final directory structure looks like.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;| react-project-dir
├── my-website
| ├── build
│ ├── index.html
│ ├── main.css
├── infrastructure
│ ├── Pulumi.yaml
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Pulumi will also add some other files to the &lt;strong&gt;infrastructure&lt;/strong&gt; directory, such as a file that contains information specific to your Pulumi &lt;a href="https://www.pulumi.com/docs/concepts/stack/"&gt;stack&lt;/a&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Copy the resources section and the outputs section from the example and add it to the end of the &lt;strong&gt;Pulumi.yaml&lt;/strong&gt; file.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;resources&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;web&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;aws-static-website:index:Website&amp;#34;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;properties&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;sitePath&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;../my-website/build&amp;#34;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;outputs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;websiteURL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;${web.websiteURL}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;h3 id="deploy-the-website"&gt;Deploy the Website&lt;/h3&gt;
&lt;p&gt;To deploy the website, type &lt;code&gt;pulumi up&lt;/code&gt;. You’ll first see a preview of all the resources that will be created. You then confirm that you want to proceed and Pulumi deploys the website.&lt;/p&gt;
&lt;h3 id="what-you-gain"&gt;What You Gain&lt;/h3&gt;
&lt;p&gt;The entire example has 10 lines of YAML code. With this, you will get an S3 bucket provisioned with all of your website’s contents. If you looked at the preview screen when you ran &lt;code&gt;pulumi up&lt;/code&gt;, you saw the many resources that actually had to be deployed to create the site. You never see any of that complexity. Here’s an example of what’s happening under the hood.&lt;/p&gt;
&lt;p&gt;&lt;img src="react-example-simple.png" alt="Preview of resource deployment"&gt;&lt;/p&gt;
&lt;p&gt;If you follow the View Live link, you will go to the Pulumi Service, where you can see all of the information available about a deployment and explore the resources that were deployed. For example, you can see a resource graph and a list of resources. Here’s an example of a resource graph.&lt;/p&gt;
&lt;p&gt;&lt;img src="graph-view-simple-react.png" alt="Graph representation of the resources"&gt;&lt;/p&gt;
&lt;p&gt;After Pulumi deploys the website, it will display any outputs you specified which, in our example, is the URL of the site. as well as the number of resources created.&lt;/p&gt;
&lt;p&gt;&lt;img src="react-simple-output.png" alt="CLI output containing the website URL"&gt;&lt;/p&gt;
&lt;h2 id="input-properties"&gt;Input Properties&lt;/h2&gt;
&lt;p&gt;The AWS Static Website component has several input properties. Here are three of the most commonly used.&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;sitePath&lt;/code&gt; - the root directory that contains the website’s contents (required).&lt;/li&gt;
&lt;li&gt;&lt;code&gt;withCDN&lt;/code&gt; - sets a flag to provision a CloudFront CDN.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;targetDomain&lt;/code&gt; - the domain that serves the content. A Route53 hosted zone must exist for this domain if you specify this option.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See the component’s &lt;a href="https://www.pulumi.com/registry/packages/aws-static-website/"&gt;reference page&lt;/a&gt; for the other properties this component supports.&lt;/p&gt;
&lt;h2 id="output-properties"&gt;Output Properties&lt;/h2&gt;
&lt;p&gt;The AWS Static Website component has several output properties. The one you’ll probably use the most is &lt;code&gt;websiteURL&lt;/code&gt;, which is the URL to access the website. See the component’s &lt;a href="https://www.pulumi.com/registry/packages/aws-static-website/"&gt;reference page&lt;/a&gt; for the others.&lt;/p&gt;
&lt;h2 id="add-a-cloudfront-cdn"&gt;Add a CloudFront CDN&lt;/h2&gt;
&lt;p&gt;To add a CloudFront CDN, you only need to add one more line of code.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-yaml" data-lang="yaml"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;name&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;react-static-website&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;runtime&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;yaml&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;Example of deploying React with Pulumi&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;resources&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;web&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;aws-static-website:index:Website&amp;#34;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;properties&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;sitePath&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;#34;./my-website/build&amp;#34;&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;withCDN&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="nt"&gt;outputs&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nt"&gt;websiteURL&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="l"&gt;${web.websiteURL}&lt;/span&gt;&lt;span class="w"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;All you have to do is add the line &lt;code&gt;withCDN: true&lt;/code&gt; and the component sets up the CDN instance for you. Again, run &lt;code&gt;pulumi up&lt;/code&gt;, confirm that you want to proceed, and Pulumi deploys the website. Here’s an example of what you’ll see.&lt;/p&gt;
&lt;p&gt;&lt;img src="react-more-complex-preview.png" alt="Preview of resource deployment"&gt;&lt;/p&gt;
&lt;p&gt;And here’s the output.&lt;/p&gt;
&lt;p&gt;&lt;img src="react-more-complex-output.png" alt="CLI output containing the website URL"&gt;&lt;/p&gt;
&lt;h2 id="more-pulumi-advantages"&gt;More Pulumi Advantages&lt;/h2&gt;
&lt;p&gt;We’ve already seen how much Pulumi simplifies creating a website. Pulumi also keeps track of any changes you make to any of the website files. It makes those changes the next time you run &lt;code&gt;pulumi up&lt;/code&gt;. Here’s an example screenshot. The changes are marked in the &lt;strong&gt;Plan&lt;/strong&gt; column.&lt;/p&gt;
&lt;p&gt;&lt;img src="preview-resource-changes.png" alt="Preview of resource changes"&gt;&lt;/p&gt;
&lt;p&gt;If you simply want to take an inventory of what’s changed, you can run &lt;code&gt;pulumi up&lt;/code&gt; and not proceed with the confirmation. Alternatively, you can run &lt;code&gt;pulumi preview&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;If you want to take down the site, run &lt;code&gt;pulumi destroy&lt;/code&gt;. Pulumi marks all the resources for deletion. It first previews the changes and, if you confirm, removes them from your AWS account. You don’t have to worry that you’ll forget to remove some resource and continue to pay for it. Here’s an example of what you’d see if you ran &lt;code&gt;pulumi destroy&lt;/code&gt; on your AWS S3 static website.&lt;/p&gt;
&lt;p&gt;&lt;img src="react-simple-destroy.png" alt="Preview of resources to destroy"&gt;&lt;/p&gt;
&lt;h2 id="learn-more"&gt;Learn More&lt;/h2&gt;
&lt;p&gt;If you’re curious and want to learn more about Pulumi and the AWS Static Website component, here are a few links you might find interesting:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;You can examine the &lt;a href="https://github.com/pulumi/pulumi-aws-static-website"&gt;GitHub repository&lt;/a&gt; that contains the code for the component.&lt;/li&gt;
&lt;li&gt;If you want to quickly try out the component, this &lt;a href="https://github.com/sean1588/create-react-app-pulumi"&gt;GitHub repo&lt;/a&gt; houses a complete React example project that you can clone.&lt;/li&gt;
&lt;li&gt;If you want to learn about other Pulumi components, take a look at the &lt;a href="https://www.pulumi.com/registry/"&gt;registry page&lt;/a&gt;, which catalogs them all.&lt;/li&gt;
&lt;li&gt;If you want to view more examples of how to use Pulumi, take a look at the Pulumi &lt;a href="https://github.com/pulumi/examples"&gt;examples&lt;/a&gt; repo.&lt;/li&gt;
&lt;li&gt;If you want to delve deeper into Pulumi, the &lt;a href="https://www.pulumi.com/docs/get-started/"&gt;Getting Started&lt;/a&gt; guide is a good first step.&lt;/li&gt;
&lt;li&gt;If you’re interested in learning more about Pulumi concepts, try the &lt;a href="https://www.pulumi.com/docs/concepts/"&gt;Concepts&lt;/a&gt; page.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="install-pulumi"&gt;&lt;a name="install"&gt;&lt;/a&gt; Install Pulumi&lt;/h2&gt;
&lt;p&gt;To install Pulumi for AWS, go to &lt;a href="https://www.pulumi.com/docs/iac/get-started/aws/"&gt;Before You Begin&lt;/a&gt;. There are instructions for macOS, Windows and Linux. You need to have an AWS account.&lt;/p&gt;</description><author>Sean Holung</author><category>aws</category><category>yaml</category><category>configuration</category><category>components</category><category>static-websites</category></item><item><title>Auditing Your Organization's Infrastructure as Code Activity</title><link>https://www.pulumi.com/blog/auditing-your-organizations-infrastructure-as-code-activity/</link><pubDate>Thu, 20 Feb 2020 00:00:00 +0000</pubDate><guid>https://www.pulumi.com/blog/auditing-your-organizations-infrastructure-as-code-activity/</guid><description>
&lt;img src="https://www.pulumi.com/images/generated/blog/auditing-your-organizations-infrastructure-as-code-activity/index.png" /&gt;
&lt;p&gt;We are excited to announce the release of Audit Logs on
&lt;a href="https://app.pulumi.com/signin"&gt;Pulumi&lt;/a&gt; for Enterprise organizations.
Audit logs enable you to track the activity of users within an
organization. They attempt to answer what a user did, when
they did it and where. They help answer these questions
by recording user actions.&lt;/p&gt;
&lt;p&gt;Pulumi&amp;rsquo;s audit logs allow you to account for the activity your
users are taking within your organization. These logs are available to
organizations with an Enterprise level subscription. The logs are immutable and
and record all user actions. Auditing makes the activity
of members in an organization attributable.
The logs capture the UNIX timestamp of the event, the user
who invoked the action, the event that took place, and the source IP
of the call the user made.&lt;/p&gt;
&lt;h2 id="using-pulumi-audit-logs"&gt;Using Pulumi Audit Logs&lt;/h2&gt;
&lt;p&gt;Audit logs are available to organizations with an Enterprise level subscription
only. If you are an organization administrator, you can view your organization&amp;rsquo;s audit logs,
by selecting your organization from the organization drop down. Then click on the settings tab.
On the left nav-bar you should see a tab called Audit Logs. Clicking here will allow you to view
the most recent audit logs for your organization.&lt;/p&gt;
&lt;p&gt;&lt;img src="https://www.pulumi.com/blog/auditing-your-organizations-infrastructure-as-code-activity/auditlogs.png" alt="auditlogs"&gt;&lt;/p&gt;
&lt;p&gt;This will show the most recent events in descending order. You can
also filter logs by a particular user by clicking on the user&amp;rsquo;s avatar. Doing so will
filter out the events performed by the user you selected.&lt;/p&gt;
&lt;p&gt;We are excited to make this feature available to our users.
Get started with audit logs on &lt;a href="https://app.pulumi.com/signin"&gt;Pulumi&lt;/a&gt; today.&lt;/p&gt;</description><author>Sean Holung</author><category>features</category><category>pulumi-enterprise</category><category>audit-logs</category></item></channel></rss>