<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Armory Docs – AWS Guides for Spinnaker</title><link>/continuous-deployment/spinnaker-user-guides/aws-guides/</link><description>Recent content in AWS Guides for Spinnaker on Armory Docs</description><generator>Hugo -- gohugo.io</generator><atom:link href="/continuous-deployment/spinnaker-user-guides/aws-guides/index.xml" rel="self" type="application/rss+xml"/><item><title>Continuous-Deployment: Use an Amazon Machine Image in a Spinnaker Pipeline</title><link>/continuous-deployment/spinnaker-user-guides/aws-guides/aws-application-pipeline/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/continuous-deployment/spinnaker-user-guides/aws-guides/aws-application-pipeline/</guid><description>
&lt;h2 id="overview">Overview&lt;/h2>
&lt;p>In this guide, you create a pipeline that takes the Debian package produced by a Jenkins job and uses it to create an Amazon Machine Image (AMI) before deploying that image to a server group.&lt;/p>
&lt;h2 id="prerequisites-for-using-an-ami-in-spinnaker">Prerequisites for using an AMI in Spinnaker&lt;/h2>
&lt;ul>
&lt;li>A configured Jenkins Master&lt;/li>
&lt;li>A Jenkins job that archives a Debian package&lt;/li>
&lt;li>A security group within AWS with appropriate permissions&lt;/li>
&lt;/ul>
&lt;h2 id="step-1-after-selecting-your-application-click-the-pipelines-category">Step 1: After selecting your Application, click the Pipelines category.&lt;/h2>
&lt;figure>
&lt;img src="/images/overview/your-first-pipeline/empty-pipelines.png"/>
&lt;/figure>
&lt;h2 id="step-2-on-this-page-click-the--icon">Step 2: On this page, click the “+” icon.&lt;/h2>
&lt;h2 id="step-3-input-a-name-for-your-new-pipeline">Step 3: Input a name for your new pipeline&lt;/h2>
&lt;p>&lt;em>Note&lt;/em>: Strategy will be covered in a separate guide.&lt;/p>
&lt;h2 id="step-4-on-this-page-you-will-see">Step 4: On this page you will see&lt;/h2>
&lt;ul>
&lt;li>A visual representation of your pipeline and its stages&lt;/li>
&lt;li>Execution Options&lt;/li>
&lt;li>Automated Triggers&lt;/li>
&lt;li>Parameters&lt;/li>
&lt;li>Notifications&lt;/li>
&lt;li>Description&lt;/li>
&lt;/ul>
&lt;figure>
&lt;img src="/images/overview/your-first-pipeline/first-pipeline-view.png"/>
&lt;/figure>
&lt;h2 id="step-5-the-first-thing-you-should-do-is-set-up-how-your-pipeline-will-be-triggered-scroll-down-to-the-automated-triggers-sub-section-this-section-will-allow-you-to-select-a-type-first-looking-like-this">Step 5: The first thing you should do is set up how your pipeline will be triggered. Scroll down to the Automated Triggers sub section. This section will allow you to select a Type first, looking like this.&lt;/h2>
&lt;figure>
&lt;img src="/images/overview/your-first-pipeline/automated-trigger-types.png"/>
&lt;/figure>
&lt;h2 id="step-6-for-this-example-we-will-select-jenkins-by-adding-a-trigger-we-are-defining-how-our-pipeline-will-be-initiated">Step 6: For this example we will select Jenkins. By adding a trigger we are defining how our pipeline will be initiated.&lt;/h2>
&lt;figure>
&lt;img src="/images/overview/your-first-pipeline/jenkins-trigger.png"/>
&lt;/figure>
&lt;p>&lt;em>Note&lt;/em>: The Property File is an important topic that will be &lt;a href="/continuous-deployment/spinnaker-user-guides/working-with-jenkins/#property-file">covered in a separate guide&lt;/a>.&lt;/p>
&lt;h2 id="step-7-before-you-test-your-pipeline-you-may-want-to-consider-enabling-or-disabling-the-trigger-via-the-checklist-at-the-bottom">Step 7: Before you test your pipeline, you may want to consider enabling or disabling the trigger via the checklist at the bottom.&lt;/h2>
&lt;h2 id="step-8-add-a-new-stage">Step 8: Add a new stage.&lt;/h2>
&lt;p>Click the add stage button in the visual representations section.&lt;/p>
&lt;figure>
&lt;img src="/images/overview/your-first-pipeline/pipeline-config-only.png"/>
&lt;/figure>
&lt;h2 id="step-9-select-bake-from-the-different-types-category">Step 9: Select Bake from the different types category.&lt;/h2>
&lt;figure>
&lt;img src="/images/overview/your-first-pipeline/add-bake-stage.png"/>
&lt;/figure>
&lt;h2 id="step-10-select-the-region-you-want-to-bake-in">Step 10: Select the region you want to bake in.&lt;/h2>
&lt;p>Enter the name of the package that was archived by the Jenkins job.&lt;/p>
&lt;ul>
&lt;li>
&lt;p>&lt;em>Note&lt;/em>: The package name should not include any version numbers. (e.g.: If your build produces a deb file named &lt;code>myapp_1.27-h343&lt;/code>, you would want to enter &lt;code>myapp&lt;/code> here.)&lt;/p>
&lt;/li>
&lt;li>
&lt;p>&lt;em>Note&lt;/em>: If you would like to configure your own Base AMI under the Advanced Options, the Base OS configuration will be ignored.&lt;/p>
&lt;/li>
&lt;/ul>
&lt;figure>
&lt;img src="/images/overview/your-first-pipeline/bake-ami-config.png"/>
&lt;/figure>
&lt;h2 id="step-11-now-add-a-deploy-stage-by-clicking-add-stage-again-in-the-type-category-select-deploy-deploys-configuration-settings-should-pop-up-on-the-screen">Step 11: Now add a Deploy stage by clicking Add Stage again. In the Type category select Deploy. Deploy’s configuration settings should pop up on the screen.&lt;/h2>
&lt;figure>
&lt;img src="/images/overview/your-first-pipeline/add-deploy-stage.png"/>
&lt;/figure>
&lt;p>&lt;em>Note&lt;/em>: If we want to reorganize the order that the stages execute in the pipeline, we can add or remove precursor stages in the Depends On category.&lt;/p>
&lt;h2 id="step-12-in-the-deploy-configuration-click-on-the-add-server-group-button-pick-your-provider-for-our-example-it-will-be-aws">Step 12: In the Deploy Configuration, click on the “Add server group” button. Pick your provider. For our example it will be AWS.&lt;/h2>
&lt;h2 id="step-13-select-continue-without-a-template">Step 13: Select “Continue without a template”.&lt;/h2>
&lt;p>Since this is a new application we will not choose to copy a configuration from a template.&lt;/p>
&lt;figure>
&lt;img src="/images/overview/your-first-pipeline/continue-without-template.png"/>
&lt;/figure>
&lt;h2 id="step-14-set-up-the-deploy-strategy">Step 14: Set up the Deploy Strategy.&lt;/h2>
&lt;p>We will use the Highlander strategy for this example, which will ensure that only one server group for our application exists at a time.&lt;/p>
&lt;figure>
&lt;img src="/images/overview/your-first-pipeline/deploy-strategy.png"/>
&lt;/figure>
&lt;p>&lt;em>Note&lt;/em>: Different deployment strategies are important and there will be a separate guide for those.&lt;/p>
&lt;h2 id="step-15-select-a-security-group">Step 15: Select a security group&lt;/h2>
&lt;p>The security group will define the access rights to your resource.&lt;/p>
&lt;h2 id="step-16-select-instance-type">Step 16: Select Instance Type.&lt;/h2>
&lt;p>Make sure to select the right instance type for your application, preferably the one that is running in production currently.&lt;/p>
&lt;h2 id="step-17-select-the-capacity">Step 17: Select the Capacity&lt;/h2>
&lt;p>Select how many instances you want in your server group on deploy. For our example, we will set it at 1.&lt;/p>
&lt;figure>
&lt;img src="/images/overview/your-first-pipeline/deploy-capacity.png"/>
&lt;/figure>
&lt;h2 id="step-18-add-the-server-group">Step 18: Add the server group.&lt;/h2>
&lt;p>Click &amp;ldquo;Add&amp;rdquo; and you&amp;rsquo;ll be brought back to your Application and to see your new Deploy Configuration.&lt;/p>
&lt;figure>
&lt;img src="/images/overview/your-first-pipeline/new-deployment-overview.png"/>
&lt;/figure>
&lt;h2 id="step-19-save-the-changes">Step 19: Save the changes&lt;/h2>
&lt;p>Press “Save Changes” at the bottom right of your window.&lt;/p>
&lt;h2 id="step-20-go-back-to-the-pipeline-overview">Step 20: Go back to the Pipeline Overview.&lt;/h2>
&lt;p>You should see your new pipeline. Click on “Start Manual Execution”.&lt;/p>
&lt;figure>
&lt;img src="/images/overview/your-first-pipeline/start-manual-execution.png"/>
&lt;/figure>
&lt;h2 id="step-21-select-the-build-to-run">Step 21: Select the build to run.&lt;/h2>
&lt;p>You will be able to select a Build for your Jenkins job from a drop down menu. By default, Spinnaker will not recreate an AMI unless the underlying package has changed. If you would like to force it, you may use the checkbox for “Rebake”.&lt;/p>
&lt;figure>
&lt;img src="/images/overview/your-first-pipeline/select-build.png"/>
&lt;/figure>
&lt;h2 id="step-22-run">Step 22: Run&lt;/h2>
&lt;p>You should see a progress bar where blue represents running and green represents complete. Gray represents not ran or canceled. Red is a failed task.&lt;/p>
&lt;figure>
&lt;img src="/images/overview/your-first-pipeline/job-in-progress.png"/>
&lt;/figure>
&lt;p>If your pipeline does not succeed, refer to one of the troubleshooting sections in the &lt;a href="/continuous-deployment/spinnaker-user-guides/spin-pipelines/#troubleshooting">pipelines&lt;/a>, &lt;a href="/continuous-deployment/spinnaker-user-guides/aws-guides/aws-baking-images/#troubleshooting">baking&lt;/a>, or &lt;a href="/continuous-deployment/spinnaker-user-guides/aws-guides/aws-deploy/#common-errors-and-troubleshooting">deploying&lt;/a> guides.&lt;/p></description></item><item><title>Continuous-Deployment: Bake Amazon Machine Images in a Spinnaker Pipeline</title><link>/continuous-deployment/spinnaker-user-guides/aws-guides/aws-baking-images/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/continuous-deployment/spinnaker-user-guides/aws-guides/aws-baking-images/</guid><description>
&lt;blockquote>
&lt;p>The phrase &amp;ldquo;baking images&amp;rdquo; is used within Armory and Spinnaker&lt;sup>TM&lt;/sup> to refer to the process of creating machine images.&lt;/p>
&lt;/blockquote>
&lt;h2 id="prerequisites-for-baking-amis">Prerequisites for baking AMIs&lt;/h2>
&lt;ul>
&lt;li>You are familiar with creating &lt;a href="/continuous-deployment/overview/your-first-application/">applications&lt;/a> and &lt;a href="/continuous-deployment/overview/your-first-pipeline/">pipelines&lt;/a>.&lt;/li>
&lt;li>You are deploying to Amazon Web Services (AWS).&lt;/li>
&lt;li>You have configured Armory to work with Jenkins. See the &lt;a href="/continuous-deployment/spinnaker-user-guides/working-with-jenkins/"}>Use Jenkins in Spinnaker&lt;/a> guide for more information.&lt;/li>
&lt;li>You are familiar with Debian packages. See the &lt;a href="/continuous-deployment/spinnaker-user-guides/debian-packages/"}>Debian Packages&lt;/a> guide for more information.&lt;/li>
&lt;/ul>
&lt;h2 id="example-of-how-to-bake-an-ami-in-a-pipeline">Example of how to bake an AMI in a pipeline&lt;/h2>
&lt;p>In this example, you bake an image containing a Debian package created by a Jenkins job.&lt;/p>
&lt;p>First, look at the the Jenkins job that builds our package.&lt;/p>
&lt;figure>
&lt;img src="/images/user-guides/aws/Image-2017-03-29-at-12.43.31-PM.png"/>
&lt;/figure>
&lt;p>The last run archived a package named &lt;code>armory-hello-deploy_0.5.0-h5.c4baff4_all.deb&lt;/code>&lt;/p>
&lt;p>In Armory, create a new pipeline named &lt;code>bake-example&lt;/code>.&lt;/p>
&lt;p>On the configuration stage, down and add a new Jenkins automated trigger. Select my master, and then select the Jenkins job shown above (&lt;code>armory/job/armory-hello-deploy/job/master&lt;/code>). For this example, there is no need to worry about setting a properties file.&lt;/p>
&lt;p>Next I add a bake stage (add stage -&amp;gt; Type: Bake)&lt;/p>
&lt;p>Select the &lt;code>us-west-2&lt;/code> region. For the Package field, I enter the base name of my package. In my case, the entire package filename is &lt;code>armory-hello-deploy_0.5.0-h5.c4baff4_all.deb&lt;/code> so I will input &lt;code>armory-hello-deploy&lt;/code>. Also, I know that my package is created for Ubuntu 14, so I make sure to select the &amp;rsquo;trusty (v14.04)&amp;rsquo; option.&lt;/p>
&lt;figure>
&lt;img src="/images/Image-2017-03-29-at-1.35.13-PM.png"/>
&lt;/figure>
&lt;p>like:&lt;/p>
&lt;figure>
&lt;img src="/images/Image-2017-03-29-at-1.45.09-PM.png"/>
&lt;/figure>
&lt;p>At this point if I want to see more details about my bake, I can click the &amp;lsquo;View Bakery Details&amp;rsquo; box. A new window will open up with the bakery logs. In my case, the first few lines look like:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">==&lt;/span>&amp;gt; amazon-ebs: Prevalidating AMI Name...
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> amazon-ebs: Found Image ID: ami-3d50120d
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">==&lt;/span>&amp;gt; amazon-ebs: Creating temporary keypair: packer_58dc1ccb-b936-7104-ebe0-0984e888ca78
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">==&lt;/span>&amp;gt; amazon-ebs: Creating temporary security group &lt;span style="color:#ff79c6">for&lt;/span> this instance...
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">==&lt;/span>&amp;gt; amazon-ebs: Authorizing access to port &lt;span style="color:#bd93f9">22&lt;/span> the temporary security group...
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">==&lt;/span>&amp;gt; amazon-ebs: Launching a &lt;span style="color:#8be9fd;font-style:italic">source&lt;/span> AWS instance...
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> amazon-ebs: Instance ID: i-08327d863d1911675
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">==&lt;/span>&amp;gt; amazon-ebs: Waiting &lt;span style="color:#ff79c6">for&lt;/span> instance &lt;span style="color:#ff79c6">(&lt;/span>i-08327d863d1911675&lt;span style="color:#ff79c6">)&lt;/span> to become ready...
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">==&lt;/span>&amp;gt; amazon-ebs: Adding tags to &lt;span style="color:#8be9fd;font-style:italic">source&lt;/span> &lt;span style="color:#8be9fd;font-style:italic">instance&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">==&lt;/span>&amp;gt; amazon-ebs: Waiting &lt;span style="color:#ff79c6">for&lt;/span> SSH to become available...
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">==&lt;/span>&amp;gt; amazon-ebs: Connected to SSH!
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">==&lt;/span>&amp;gt; amazon-ebs: Pausing 30s before the next provisioner...
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">==&lt;/span>&amp;gt; amazon-ebs: Provisioning with shell script: /opt/spinnaker/config/packer/install_packages_armory.sh
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> amazon-ebs: &lt;span style="color:#8be9fd;font-style:italic">repository&lt;/span>&lt;span style="color:#ff79c6">=&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> amazon-ebs: &lt;span style="color:#8be9fd;font-style:italic">package_type&lt;/span>&lt;span style="color:#ff79c6">=&lt;/span>deb
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> amazon-ebs: &lt;span style="color:#8be9fd;font-style:italic">packages&lt;/span>&lt;span style="color:#ff79c6">=&lt;/span>armory-hello-deploy&lt;span style="color:#ff79c6">=&lt;/span>0.5.0-h5.c4baff4
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>...
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Under the hood, Spinnaker is leveraging &lt;a href="https://www.packer.io/">HashiCorp&amp;rsquo;s Packer&lt;/a> tool to create images. The above is a Packer log file.&lt;/p>
&lt;p>The thing I wanted to point out here is that the correct version of the package is getting passed down to the bakery.&lt;/p>
&lt;p>After the bake is successful, I see:&lt;/p>
&lt;figure>
&lt;img src="/images/Image-2017-03-29-at-1.49.44-PM.png"/>
&lt;/figure>
&lt;p>Notice that the AMI name and ID are shared in the lower right&amp;rsquo;s blue box - in this example it is &amp;ldquo;armory-hello-deploy-all-20170329204459-trusty (ami-c78410a7)&amp;rdquo;.&lt;/p>
&lt;p>If I press &amp;lsquo;Start Manual Execution&amp;rsquo; again, since the package version hasn&amp;rsquo;t changed, it will reuse the same image rather than rebaking. The screen for that looks like:&lt;/p>
&lt;figure>
&lt;img src="/images/Image-2017-03-29-at-1.55.52-PM.png"/>
&lt;/figure>
&lt;p>Notice the whole pipeline only ran for &amp;lsquo;00:00&amp;rsquo; and the UI says &amp;lsquo;No changes detected; reused existing bake&amp;rsquo;&lt;/p>
&lt;h2 id="advanced-options-for-baking-amis">Advanced options for baking AMIs&lt;/h2>
&lt;p>You can do additional things like use a specific base AMI, specify your baked AMI&amp;rsquo;s name, use a custom packer script, or pass variables to a packer script.&lt;/p>
&lt;p>If you would like to change the name in AWS of your AMI, you can do so by selecting the &amp;lsquo;Show Advanced Options&amp;rsquo; checkbox in the Bake Stage Configuration. Continuing from our example above, when I see:&lt;/p>
&lt;figure>
&lt;img src="/images/Image-2017-03-29-at-2.29.08-PM.png"/>
&lt;/figure>
&lt;p>What do all of these fields mean? Great question!&lt;/p>
&lt;h3 id="changing-an-amis-name">Changing an AMI&amp;rsquo;s name&lt;/h3>
&lt;p>If I were to instead input &amp;lsquo;mycustomname&amp;rsquo; into the &amp;lsquo;AMI Name&amp;rsquo; field, like:&lt;/p>
&lt;figure>
&lt;img src="/images/Image-2017-03-29-at-2.55.24-PM.png"/>
&lt;/figure>
&lt;p>After re-running the pipeline, I see that Spinnaker named the AMI &lt;code>mycustomname-all-20170329220104-trusty&lt;/code>&lt;/p>
&lt;figure>
&lt;img src="/images/Image-2017-03-29-at-3.05.57-PM.png"/>
&lt;/figure>
&lt;p>Then I add &amp;lsquo;mycustomsuffix&amp;rsquo; to the &amp;lsquo;AMI Suffix&amp;rsquo; field:&lt;/p>
&lt;figure>
&lt;img src="/images/Image-2017-03-29-at-3.14.07-PM.png"/>
&lt;/figure>
&lt;p>Repeating the bake, I see that Spinnaker named the AMI &lt;code>mycustomname-all-mycustomsuffix-trusty&lt;/code>&lt;/p>
&lt;h3 id="base-amis">Base AMIs&lt;/h3>
&lt;p>Often you will want to specify a base image for use in your bake. In that case you will use the &amp;lsquo;Base AMI&amp;rsquo; field, not to be confused with the &amp;lsquo;Base Name&amp;rsquo; field. As an example, I have specified &lt;code>ami-4d78c02d&lt;/code>:&lt;/p>
&lt;figure>
&lt;img src="/images/Image-2017-03-29-at-4.06.24-PM.png"/>
&lt;/figure>
&lt;p>In this situation, the base OS selection (ubuntu/trusty/windows) will be ignored.&lt;/p>
&lt;p>You can also select a base AMI more dynamically by combing the &amp;lsquo;Bake&amp;rsquo; stage type with the &amp;lsquo;Find Image&amp;rsquo; stage type. For more details check out the &lt;a href="/continuous-deployment/spinnaker-user-guides/aws-guides/aws-find-images/">Find Images Guide&lt;/a>.&lt;/p>
&lt;h3 id="adding-debian-repositories">Adding Debian repositories&lt;/h3>
&lt;p>It is common practice to use a base image throughout your team or organization. Usually this base image will be kept up to date with security patches and will contain common tools (DataDog, Splunk, etc.). It is also a good place to register your Debian repository&amp;rsquo;s GPG keys.&lt;/p>
&lt;p>If you need to add repositories on a per bake basis, you can use the &amp;lsquo;Extended Attributes&amp;rsquo; within the &amp;lsquo;Advanced Options&amp;rsquo; section. You can add a key/value pair where the key is labeled &amp;lsquo;repository&amp;rsquo; and the value is a space separated list of repository URLs. For example:&lt;/p>
&lt;figure>
&lt;img src="/images/Image-2017-04-17-at-10.41.20-AM.png"/>
&lt;/figure>
&lt;p>This will add Armory&amp;rsquo;s bintray debian repository to the bake.&lt;/p>
&lt;h2 id="regions">Regions&lt;/h2>
&lt;p>By selecting a region, you are selecting which region the bake will take place. When a bake happens, an instance is spun up, the desired packages are installed, and then a snapshot is taken. The location where the instances spin up is determined by which region you select. Multiple regions may be selected at once.&lt;/p>
&lt;h2 id="rebaking">Rebaking&lt;/h2>
&lt;p>When a bake step executes, Spinnaker looks for a previously created image before baking a new one. It uses the set of packages (and their versions) that users specify in the bake stage configuration to determine if the bake is neccessary.&lt;/p>
&lt;p>You can force Spinnaker to always bake by selecting the &amp;lsquo;Rebake: Rebake image without regard to the status of any existing bake&amp;rsquo; checkbox on the bake stage configuration screen. You also have the option to force rebaking when manually executing a pipeline.&lt;/p>
&lt;h2 id="bake-and-copy-vs-multi-region-bake">Bake and copy vs multi-region bake&lt;/h2>
&lt;p>There are two options for getting an image to multiple regions in AWS. A common practice outside of Spinnaker is to create your AMI and then copy it to the regions you need. However, Spinnaker by default will do a multi-region bake. This means if you select more than one region it will go through the process of creating an image in each region (spin up an instance, install the packages, etc).&lt;/p>
&lt;p>There are trade-offs to each approach. Generally, Spinnaker&amp;rsquo;s default multi-region bake approach is faster than the bake and copy approach. However, if you need to limit all baking activities to one region then there isn&amp;rsquo;t much of a choice.&lt;/p>
&lt;h2 id="custom-bake-scripts">Custom bake scripts&lt;/h2>
&lt;p>If you would like to use a custom Packer script to bake your AMI you will need to contact your Spinnaker Administrator. The script will have to be installed on your Spinnaker instances.&lt;/p>
&lt;h2 id="caching-bakes">Caching bakes&lt;/h2>
&lt;p>Spinnaker will cache bakes and not re-run a bake to save time if it finds the bake key in its cache.
When Spinnaker bakes a package it creates a unique key based on the following components:
Cloud Provider Type, Base OS, Base AMI, AMI Name, Packer Template Filename, Var Filename, Package Name and Package Version. If any of those components change at the time of bake it will rebake otherwise it&amp;rsquo;ll use the cached AMI.&lt;/p>
&lt;h4 id="package-name-and-version">Package name and version&lt;/h4>
&lt;p>By default, Spinnaker looks for an artifact from the Jenkins build that triggered the bake to &lt;a href="https://github.com/spinnaker/rosco/blob/ddd6ed4689b8a769e4b7331acdca2c0ba1b29a66/rosco-core/src/main/groovy/com/netflix/spinnaker/rosco/providers/util/PackageNameConverter.groovy#L54">parse out version information&lt;/a>. Below are valid names to packages:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-fallback" data-lang="fallback">&lt;span style="display:flex;">&lt;span>subscriberha-1.0.0-h150
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>subscriberha-1.0.0-h150.586499
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>subscriberha-1.0.0-h150.586499/WE-WAPP-subscriberha/150
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>This allows you to just specify &lt;code>subscriberha&lt;/code> as the &lt;code>package&lt;/code> in your bake stage and Spinnaker will handle which version to bake based on the Jenkins trigger that was chosen at execution time.&lt;/p>
&lt;h2 id="troubleshooting">Troubleshooting&lt;/h2>
&lt;p>When you have a failing bake step and you do not know why, a good place to start is with the bakery log. You can find a link to the bakery log in the Detail of your bake step on the pipeline execution screen&lt;/p>
&lt;figure>
&lt;img src="/images/Image-2017-03-29-at-1.59.18-PM.png"/>
&lt;/figure>
&lt;p>Click the link that says &amp;lsquo;View Bakery Details&amp;rsquo;. It can be helpful to track down the last command that the bakery executed.&lt;/p>
&lt;p>Another source of information is the pipeline&amp;rsquo;s source link. You can find this link in small writing in the far bottom right of the pipeline execution detail screen. The &amp;lsquo;source&amp;rsquo; is a JSON representation of the data generated by Spinnaker when running your pipeline (not just the bake step).&lt;/p></description></item><item><title>Continuous-Deployment: Bake and Find Custom Amazon Machine Images in Spinnaker</title><link>/continuous-deployment/spinnaker-user-guides/aws-guides/aws-find-images/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/continuous-deployment/spinnaker-user-guides/aws-guides/aws-find-images/</guid><description>
&lt;h2 id="prerequisites-and-assumptions">Prerequisites and assumptions&lt;/h2>
&lt;p>You have experience &lt;a href="/continuous-deployment/spinnaker-user-guides/aws-guides/aws-baking-images/">baking&lt;/a> and &lt;a href="/continuous-deployment/spinnaker-user-guides/aws-guides/aws-deploy/">deploying images&lt;/a> with Spinnaker&lt;/p>
&lt;p>Spinnaker provides a lot of auto-magic for determining which AMI should be deployed to which server group. However, sometimes it is necessary to override Spinnaker&amp;rsquo;s selection.&lt;/p>
&lt;h2 id="dynamic-base-ami">Dynamic base AMI&lt;/h2>
&lt;p>Sometimes you may want to build your AMI in several different pipelines before deploying it. This is a popular method when you need to add a layer of standard tools and daemons to all of your instances (ex: Splunk or DataDog agents). Also, you may want to do regular security updates and have it roll out to all instances in your organization.&lt;/p>
&lt;p>Let&amp;rsquo;s go through an example.&lt;/p>
&lt;p>I have created a multi-region bake pipeline that creates AMIs from a package built on Jenkins. For directions on how to create a pipeline like this, check out the &lt;a href="/continuous-deployment/spinnaker-user-guides/aws-guides/aws-baking-images/">baking guide&lt;/a>. You can see it running here:&lt;/p>
&lt;figure>
&lt;img src="/images/Image-2017-04-04-at-11.01.25-AM.png"/>
&lt;/figure>
&lt;p>Next I want to create a pipeline that is triggered by a Jenkins job and installs the package that Jenkins created. However, I want that package to be installed on top of one of the AMIs from the multi-region bake above.&lt;/p>
&lt;p>I start by creating a new pipeline.&lt;/p>
&lt;p>I add an automated trigger to build from a Jenkins&amp;rsquo; job. For a more detailed example of this, check out the &lt;a href="/continuous-deployment/spinnaker-user-guides/aws-guides/aws-baking-images/">baking guide&lt;/a>.&lt;/p>
&lt;figure>
&lt;img src="/images/Image-2017-04-04-at-2.47.40-PM.png"/>
&lt;/figure>
&lt;p>Now I add a &amp;lsquo;Find Images From Tags&amp;rsquo; stage and input &amp;lsquo;armoryami&amp;rsquo; in the &amp;lsquo;Package&amp;rsquo; field. The &amp;lsquo;package&amp;rsquo; you input needs to match the package installed by the baked AMI in the prior bake pipeline.&lt;/p>
&lt;figure>
&lt;img src="/images/Image-2017-04-04-at-2.40.14-PM.png"/>
&lt;/figure>
&lt;p>By checking the &amp;lsquo;us-west-2&amp;rsquo; checkbox, I am telling Spinnaker to find images in only that regions and make it available to the rest of the pipeline.&lt;/p>
&lt;p>Next I want to add my own package to this AMI. First, I add a bake stage. Since my Jenkins&amp;rsquo; job created an artifact named &amp;lsquo;armory-hello-deploy&amp;rsquo;, I input that into the &amp;lsquo;Package&amp;rsquo; field. The next part is a little tricky. I need to specify the correct base AMI by checking the &amp;lsquo;Show Advanced Options&amp;rsquo; and using the &lt;a href="/continuous-deployment/spinnaker-user-guides/expression-language/">expression language&lt;/a> in the &amp;lsquo;Base AMI&amp;rsquo; field.&lt;/p>
&lt;figure>
&lt;img src="/images/Image-2017-04-04-at-3.03.22-PM.png"/>
&lt;/figure>
&lt;p>As you can see, the expression I use is:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#ff79c6">{&lt;/span> &lt;span style="color:#6272a4">#stage(&amp;#39;Find Image from Tags&amp;#39;)[&amp;#39;context&amp;#39;][&amp;#39;amiDetails&amp;#39;][0][&amp;#39;imageId&amp;#39;] }&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="what-is-happening-here">What is happening here?&lt;/h3>
&lt;ul>
&lt;li>The &lt;code>#stage(&amp;quot;Find Image from Tags&amp;quot;)&lt;/code> function references the previous pipeline stage named &amp;lsquo;Find Image from Tags&amp;rsquo;. This function returns a map of data.&lt;/li>
&lt;li>The &amp;lsquo;context&amp;rsquo; field of the map is populated after the &amp;lsquo;Find Image from Tags&amp;rsquo; stage runs and contains the resulting data.&lt;/li>
&lt;li>The &amp;lsquo;amiDetails&amp;rsquo; field is an array of all images found. This is especially relevant if you are looking for images in multiple regions. Although in our case, we are just working in &amp;lsquo;us-west-2&amp;rsquo;, so there is only one element in the array, &amp;lsquo;[0]&amp;rsquo;.&lt;/li>
&lt;li>Lastly, the &amp;lsquo;Base AMI&amp;rsquo; field in the &amp;lsquo;Bake Configuration&amp;rsquo; is expecting an AMI id as input so after we specify element &amp;lsquo;[0]&amp;rsquo;, we further specify &amp;lsquo;[imageId]&amp;rsquo; to get the AMI id of the image.&lt;/li>
&lt;/ul>
&lt;p>We can now execute the pipeline with the above inputs.&lt;/p>
&lt;figure>
&lt;img src="/images/Image-2017-04-04-at-3.22.17-PM.png"/>
&lt;/figure>
&lt;p>Notice the &amp;lsquo;Results&amp;rsquo; box in the lower right hand corner. After inspecting it and comparing it to the bake pipeline in the very beginning of the example, I can see that Spinnaker did indeed choose the correct AMI.&lt;/p>
&lt;p>If you wanted to deploy this image, you can just add a deploy step and Spinnaker will deploy the correct AMI. For more instructions on deploying, check out the &lt;a href="/continuous-deployment/spinnaker-user-guides/aws-guides/aws-deploy/">deployment guide&lt;/a>.&lt;/p></description></item><item><title>Continuous-Deployment: Deploy an Application to Amazon EC2</title><link>/continuous-deployment/spinnaker-user-guides/aws-guides/aws-deploy/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/continuous-deployment/spinnaker-user-guides/aws-guides/aws-deploy/</guid><description>
&lt;h2 id="how-spinnaker-deploys-applications">How Spinnaker deploys applications&lt;/h2>
&lt;p>The primary objective of Spinnaker&lt;sup>TM&lt;/sup> is to deploy your software. To do that, you need to bake an image and then use that same image to deploy to all of your environments.&lt;/p>
&lt;p>The typical type of distributed application that Spinnaker deploys is one with a cluster of homogeneous instances behind a load balancer. The load balancer is responsible for detecting healthy and unhealthy instances.&lt;/p>
&lt;p>This guide continues the example in the &lt;a href="/continuous-deployment/spinnaker-user-guides/aws-guides/aws-baking-images/"}>Bake Amazon Machine Images in a Spinnaker Pipeline&lt;/a> guide. Here, you deploy a simple web server that serves a page with details about its environment.&lt;/p>
&lt;h2 id="prerequisites-for-deploying-an-application-to-ec2">Prerequisites for deploying an application to EC2&lt;/h2>
&lt;ul>
&lt;li>You know how to create pipelines.&lt;/li>
&lt;li>You have read the &lt;a href="/continuous-deployment/spinnaker-user-guides/aws-guides/aws-baking-images/"}>Bake Amazon Machine Images in a Spinnaker Pipeline&lt;/a> guide and completed the steps to bake an image.&lt;/li>
&lt;li>You have read the &lt;a href="/continuous-deployment/overview/naming-conventions/"}>Spinnaker Nomenclature and Naming Conventions&lt;/a> guide.&lt;/li>
&lt;li>You are familiar with &lt;a href="https://aws.amazon.com/elasticloadbalancing/">Elastic Load Balancing (ELB)&lt;/a> configuration.&lt;/li>
&lt;li>You have already created a security group to use in your application.&lt;/li>
&lt;/ul>
&lt;h2 id="create-a-load-balancer">Create a load balancer&lt;/h2>
&lt;p>Go to the application screen to create a load balancer. Select the &lt;strong>Load Balancers&lt;/strong> tab:&lt;/p>
&lt;figure>
&lt;img src="/images/user-guides/aws/deploy/Image-2019-02-21-at-15.27.01.png"/>
&lt;/figure>
&lt;p>Press the &amp;lsquo;+&amp;rsquo; on the right to create a new load balancer, you may need to select AWS &amp;gt; then select a Load Balance Type.&lt;/p>
&lt;figure>
&lt;img src="/images/user-guides/aws/deploy/Screen-Shot-2019-02-21-at-15.32.49.png"/>
&lt;/figure>
&lt;p>We&amp;rsquo;ll enter &amp;lsquo;prod&amp;rsquo; into the &amp;lsquo;Stack&amp;rsquo; field because our environment contains dev, stage, and prod.&lt;/p>
&lt;p>Set the &lt;a href="/continuous-deployment/armory-admin/aws/aws-subnets-configure/">&lt;strong>VPC Subnet Type&lt;/strong>&lt;/a> grouping by tagging VPCs so that they appear in the VPC dropdown selection in Spinnaker. This change may take some time to cache and reflect in Spinnaker. In the &lt;strong>Firewalls&lt;/strong> section, select your firewall, which maps to the preconfigured security group. Create the forwarding ports in the &lt;strong>Listeners&lt;/strong> section. Finally, create the &lt;strong>Health Check&lt;/strong>.&lt;/p>
&lt;p>Then press &lt;em>Create&lt;/em>.&lt;/p>
&lt;figure>
&lt;img src="/images/user-guides/aws/deploy/Image-2019-02-21-at-16.33.44.png"/>
&lt;/figure>
&lt;h2 id="create-a-deploy-pipeline">Create a deploy pipeline&lt;/h2>
&lt;p>Navigate to the configuration screen of the previously created pipeline from the &lt;a href="/continuous-deployment/spinnaker-user-guides/aws-guides/aws-baking-images/"}>Bake Amazon Machine Images in a Spinnaker Pipeline&lt;/a> guide.&lt;/p>
&lt;p>Select &lt;strong>Add Stage&lt;/strong> and select &lt;strong>Deploy&lt;/strong> from the &lt;em>Type&lt;/em> dropdown.&lt;/p>
&lt;p>Select &lt;strong>Add server group&lt;/strong> option in the &amp;lsquo;Deploy Configuration&amp;rsquo;&lt;/p>
&lt;p>Select &lt;strong>AWS&lt;/strong> option for the provider.&lt;/p>
&lt;p>We&amp;rsquo;ll be shown the option to copy a configuration from a currently running server group if a server group for this application already exists. In our case, let&amp;rsquo;s select &amp;lsquo;None&amp;rsquo; and continue.&lt;/p>
&lt;figure>
&lt;img src="/images/user-guides/aws/deploy/ezgif.com-gif-maker-%283%29.gif"/>
&lt;/figure>
&lt;p>Select the same &lt;strong>VPC Subnet&lt;/strong> type as the ELB you just made. Remember to input &amp;lsquo;prod&amp;rsquo; to the &lt;strong>Stack&lt;/strong> field since that is what you used when creating the ELB.&lt;/p>
&lt;blockquote>
&lt;p>If you skipped the ELB steps above and do not see the VPCs grouping available, or you need to crate a new VPC group, follow the instructions in the &lt;a href="/continuous-deployment/armory-admin/aws/aws-subnets-configure/">VPC Subnet Type&lt;/a> guide. Tag your VPCs so that they are available for selection in the dropdown.&lt;/p>
&lt;/blockquote>
&lt;p>For this example, you use a Blue/Green &lt;strong>deployment strategy&lt;/strong>. Leave 3 &lt;strong>maximum server groups&lt;/strong> alive for normal services allows you to manually rollback in case of emergency easily.&lt;/p>
&lt;p>Scroll down and select the &lt;strong>load balancer&lt;/strong> that was just created from the list and select the preconfigured security group.&lt;/p>
&lt;p>Note, the Firewall in this case will be for the EC2 instances.&lt;/p>
&lt;p>Under the &lt;strong>Instance Type&lt;/strong> section, select &amp;lsquo;Micro Utility&amp;rsquo;.&lt;/p>
&lt;p>We&amp;rsquo;ll set the capacity at 1 for now, but we can later set it up to do auto-scaling.&lt;/p>
&lt;figure>
&lt;img src="/images/user-guides/aws/deploy/Screen-Shot-2019-02-21-at-16.44.29.png"/>
&lt;/figure>
&lt;p>Scroll all the way down to the &lt;strong>Advanced Settings&lt;/strong> section and change the &lt;strong>Health Check Type&lt;/strong> from &amp;lsquo;EC2&amp;rsquo; to &amp;lsquo;ELB&amp;rsquo;, we&amp;rsquo;ll later see green boxes for health instances, gray for EC2 healthcheck instances, or red for unhealthy instances.&lt;/p>
&lt;p>Select the keypair for the EC2 instances in &lt;strong>Key Name&lt;/strong>.&lt;/p>
&lt;p>Erase the &lt;strong>IAM Instance Profile&lt;/strong> field. In our example, we don&amp;rsquo;t need access to any other AWS resources and the field may be filled in by default depending on your configurations.&lt;/p>
&lt;figure>
&lt;img src="/images/user-guides/aws/deploy/Image-2019-02-21-at-16.51.16.png"/>
&lt;/figure>
&lt;p>Then click &lt;strong>Add&lt;/strong> to complete this step.&lt;/p>
&lt;p>We return back to the deploy stage, with it now looking like:&lt;/p>
&lt;p>Finally, we can click &lt;strong>Save Changes&lt;/strong> and select the back arrow to return to the Pipeline Executions screen.&lt;/p>
&lt;figure>
&lt;img src="/images/user-guides/aws/deploy/Screen-Shot-2019-02-21-at-16.58.56.png"/>
&lt;/figure>
&lt;p>I press &amp;lsquo;Start Manual Execution&amp;rsquo; on my pipeline. This is what I see:&lt;/p>
&lt;figure>
&lt;img src="/images/user-guides/aws/deploy/ezgif.com-gif-maker-%284%29.gif"/>
&lt;/figure>
&lt;p>When this pipeline finishes the Bake stage, we can see it&amp;rsquo;s current stage/tasks status and we can also see it in the &lt;strong>Clusters&lt;/strong> tab to see a new server group come up.&lt;/p>
&lt;figure>
&lt;img src="/images/user-guides/aws/deploy/Image-2017-03-30-at-3.23.24-PM.png"/>
&lt;/figure>
&lt;p>For more information about the details of this screen, see the &lt;a href="/continuous-deployment/spinnaker-user-guides/application-screen/"}>Spinnaker&amp;#39;s Application Screen&lt;/a> guide.&lt;/p>
&lt;p>I can see here that a new server has indeed come up and is healthy. Healthy in this case means that it has passed the ELB health check. If you are having problems with your instances not passing the health check, see the &lt;a href="#common-errors">common errors section&lt;/a>.&lt;/p>
&lt;p>Now, to demonstrate the Blue/Green, go back to the Pipeline Executions screen and press &amp;lsquo;Start Manual Execution&amp;rsquo; again. Then go back to the &amp;lsquo;Clusters&amp;rsquo; tab to watch the execution process.&lt;/p>
&lt;p>First you see that a new server group named &lt;code>v001&lt;/code> is being created. It doesn&amp;rsquo;t have any instances in it yet:
&lt;figure>
&lt;img src="/images/user-guides/aws/deploy/Image-2017-03-30-at-3.46.44-PM.png"/>
&lt;/figure>
&lt;/p>
&lt;p>After a few moments an instance is created and is initially &amp;lsquo;unhealthy&amp;rsquo;:
&lt;figure>
&lt;img src="/images/user-guides/aws/deploy/Image-2017-03-30-at-3.47.16-PM.png"/>
&lt;/figure>
&lt;/p>
&lt;p>Once it passes its healthchecks and becomes healthy, it will visually indicate so by turning green. At this point Armory will add the server group to the load balancer.
&lt;figure>
&lt;img src="/images/user-guides/aws/deploy/Image-2017-03-30-at-3.50.01-PM.png"/>
&lt;/figure>
&lt;/p>
&lt;p>Immediately after that, the old server group is removed from the load balancer. Armory will turn the old server group&amp;rsquo;s instances blue. This means that they are disabled and no longer receiving traffic.&lt;/p>
&lt;figure>
&lt;img src="/images/user-guides/aws/deploy/Image-2017-03-30-at-3.50.18-PM.png"/>
&lt;/figure>
&lt;p>Because of how I configured my deploy stage, the old Blue server group will stick around until I either manually scale it down or destroy it. If you like, you can configure your deploy stage to automatically scale down the old server group after the new one is healthy.&lt;/p>
&lt;h2 id="common-errors-and-troubleshooting">Common errors and troubleshooting&lt;/h2>
&lt;p>If you are having trouble try checking out some of these topics:&lt;/p>
&lt;h3 id="deploy-times-out">Deploy times out&lt;/h3>
&lt;p>Often when your deploy stage is timing out, it is because your instances are never becoming healthy. In this case, Armory will keep terminating and replacing the instances.&lt;/p>
&lt;h3 id="investigating-red-instances">Investigating red instances&lt;/h3>
&lt;p>Select your red instance and hover your cursor over the red triangle next to the load balancer under the &amp;lsquo;Status&amp;rsquo; section. This should display some helpful information for understanding why your instance is not deploying correctly.&lt;/p>
&lt;figure>
&lt;img src="/images/user-guides/aws/deploy/Image-2017-03-30-at-3.29.02-PM.png"/>
&lt;/figure>
&lt;h3 id="incorrect-health-check">Incorrect health check&lt;/h3>
&lt;p>You have the option when deploying a new server group to use either EC2 or ELB health checking. When instances aren&amp;rsquo;t passing this health check they will be terminated and replaced. If you are experiencing strange behavior, double check that the correct health check is selected.&lt;/p>
&lt;h3 id="deploy-azs-vs-elb-azs">Deploy AZs vs ELB AZs&lt;/h3>
&lt;p>It is possible to set your ELB to work with certain AZs but then deploy your server group to another AZ. If you have your health check set to ELB, then your instances will never become healthy. You can tell when this happens by hovering you mouse over the red triangle &lt;a href="#investigating-red-instances">described above&lt;/a>.&lt;/p>
&lt;h3 id="unknown-errors">Unknown errors&lt;/h3>
&lt;p>Sometimes you may encounter an &amp;lsquo;Unknown Error&amp;rsquo; message when executing your deploy. Something like, &amp;ldquo;Shrink cluster: Exception: No reason provided.&amp;rdquo; These errors are almost always caused by a field having an incorrect value in the deploy configuration. This particular &amp;ldquo;Shrink cluster&amp;rdquo; error was caused by the server group&amp;rsquo;s region being invalid.&lt;/p>
&lt;h2 id="deployment-strategies">Deployment strategies&lt;/h2>
&lt;h3 id="bluegreen">Blue/Green&lt;/h3>
&lt;blockquote>
&lt;p>This strategy was formerly called &amp;ldquo;Red/Black&amp;rdquo; in Spinnaker.&lt;/p>
&lt;/blockquote>
&lt;p>This strategy deploys a fresh server group and add it to the load balancer. The older server group will then be &lt;a href="#what-does-disabled-mean">disabled&lt;/a>.&lt;/p>
&lt;figure>
&lt;img src="/images/user-guides/aws/deploy/Image-2017-03-30-at-5.23.57-PM.png"/>
&lt;/figure>
&lt;p>When you configure this strategy you can choose to scale down the old server group. You can always scale it back up if you need it for a rollback. Also, you can choose how many old server groups to leave in the cluster.&lt;/p>
&lt;h3 id="highlander">Highlander&lt;/h3>
&lt;p>This strategy creates a new server group and add it to the load balancer. Once everything is healthy, the old server group(s) will be destroyed.&lt;/p>
&lt;h3 id="none">None&lt;/h3>
&lt;p>This strategy deploys a new server group. It won&amp;rsquo;t do anything about the older server groups. They will just all be in the load balancer together like one big happy family!&lt;/p>
&lt;h2 id="what-does-disabled-mean">What does disabled mean?&lt;/h2>
&lt;p>When an instance is disabled within Armory, it is removed from all load balancers. Depending on how your application receives work, this may or may not stop your application from doing work. If your application receives work via the load balancer - like a web application - then it should actually be disabled. However, if you have an application that works similarly to pulling workloads off of a distributed queue (SQS, Kafka, etc), then removing it from a load balancer won&amp;rsquo;t change anything. In fact, it was probably never in a load balancer.&lt;/p>
&lt;p>You can re-enable a server group by selecting it from the &amp;lsquo;Cluster&amp;rsquo; screen, click the &amp;lsquo;Server Group Actions&amp;rsquo; button on the right panel and click &amp;lsquo;Enable&amp;rsquo;.&lt;/p>
&lt;h2 id="userdata">UserData&lt;/h2>
&lt;p>You can pass custom information to your deployed instances through the &amp;lsquo;User Data&amp;rsquo; field under the &amp;lsquo;Advanced Settings&amp;rsquo; section of the deploy stage configuration.&lt;/p>
&lt;figure>
&lt;img src="/images/user-guides/aws/deploy/Image-2017-03-30-at-4.30.36-PM.png"/>
&lt;/figure>
&lt;p>Make sure to base64 encode the content before putting it into the field in the options.&lt;/p>
&lt;h3 id="userdata-issues">UserData issues&lt;/h3>
&lt;p>If the default UserData doesn&amp;rsquo;t work with your instance launch sequence, there are two work-arounds you can use.&lt;/p>
&lt;ul>
&lt;li>
&lt;p>If the UserData you want to use is bash-compatible and will fit after that existing chunk of variables that Armory puts in, you can just put your base64 encoded UserData into the cluster config.&lt;/p>
&lt;/li>
&lt;li>
&lt;p>Adjust the UserData template using information from Clouddriver&amp;rsquo;s AWS UserData &lt;a href="https://github.com/spinnaker/clouddriver/blob/master/clouddriver-aws/UserData.md">README&lt;/a>. When we use that option we normally point udfRoot at something like /opt/spinnaker/config/custom-udf, and then add the custom-udf directory to the config package we release Spinnaker from. If you want to turn it off completely that means just adding the udfRoot option to clouddriver-local.yml, and putting a blank file at /opt/spinnaker/config/custom-udf/udf0 .&lt;/p>
&lt;/li>
&lt;/ul>
&lt;h2 id="passing-environment-data-to-your-deployed-instances">Passing environment data to your deployed instances&lt;/h2>
&lt;p>The default configuration of Spinnaker creates a file &lt;code>/etc/default/server-env&lt;/code> on every instance with information about its environment. In the example above, &lt;code>server-env&lt;/code> looks like:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-bash" data-lang="bash">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8be9fd;font-style:italic">CLOUD_ACCOUNT&lt;/span>&lt;span style="color:#ff79c6">=&lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;default-aws-account&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8be9fd;font-style:italic">CLOUD_ACCOUNT_TYPE&lt;/span>&lt;span style="color:#ff79c6">=&lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;default-aws-account&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8be9fd;font-style:italic">CLOUD_ENVIRONMENT&lt;/span>&lt;span style="color:#ff79c6">=&lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;default-aws-account&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8be9fd;font-style:italic">CLOUD_SERVER_GROUP&lt;/span>&lt;span style="color:#ff79c6">=&lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;test-example-v001&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8be9fd;font-style:italic">CLOUD_CLUSTER&lt;/span>&lt;span style="color:#ff79c6">=&lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;test-example&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8be9fd;font-style:italic">CLOUD_STACK&lt;/span>&lt;span style="color:#ff79c6">=&lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;example&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8be9fd;font-style:italic">CLOUD_DETAIL&lt;/span>&lt;span style="color:#ff79c6">=&lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8be9fd;font-style:italic">EC2_REGION&lt;/span>&lt;span style="color:#ff79c6">=&lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;us-west-2&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#8be9fd;font-style:italic">LAUNCH_CONFIG&lt;/span>&lt;span style="color:#ff79c6">=&lt;/span>&lt;span style="color:#f1fa8c">&amp;#34;test-example-v001-03302017224619&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="rolling-back">Rolling back&lt;/h2>
&lt;p>Yup. Sometimes you need to rollback to a known previously working state.&lt;/p>
&lt;h3 id="automatically">Automatically&lt;/h3>
&lt;p>From the &amp;lsquo;Cluster&amp;rsquo; tab, select a server group. Click the button on the right pane labeled &amp;lsquo;Server Group Actions&amp;rsquo; and press &amp;lsquo;Rollback&amp;rsquo;&lt;/p>
&lt;figure>
&lt;img src="/images/user-guides/aws/deploy/Image-2017-03-30-at-5.14.14-PM.png"/>
&lt;/figure>
&lt;p>In the window that pops up, you can select which server group to rollback to.&lt;/p>
&lt;figure>
&lt;img src="/images/user-guides/aws/deploy/Image-2017-03-30-at-5.15.27-PM.png"/>
&lt;/figure>
&lt;p>The server group that you select will re-enabled and scaled up to the necessary number of replicas. Then the rolled back server group will be disabled.&lt;/p>
&lt;h3 id="manually">Manually&lt;/h3>
&lt;p>If you are ever in a situation where you need to roll back without Spinnaker, you can do so from the AWS console. You will basically run through the process that Spinnaker would do automatically:&lt;/p>
&lt;ul>
&lt;li>Scale up the older Auto Scaling Groups (ASG)&lt;/li>
&lt;li>Add those instances to the ELB&lt;/li>
&lt;li>Remove the newer ASG&amp;rsquo;s instances from the ELB&lt;/li>
&lt;li>Scale down or delete the new ASG&lt;/li>
&lt;/ul>
&lt;h2 id="additional-launch-block-devices">Additional launch block devices&lt;/h2>
&lt;p>If you want additional block devices or a larger root partition you&amp;rsquo;ll need to
add an a new list to the pipeline JSON. Unfortunately at this time there is no
UI to add block devices.&lt;/p>
&lt;ol>
&lt;li>&lt;a href="/continuous-deployment/spinnaker-user-guides/spin-pipelines/#pipeline-json">Edit&lt;/a> your pipeline&amp;rsquo;s JSON&lt;/li>
&lt;li>Find your deployment dictionary. You&amp;rsquo;ll need to add the object of pairs for each cluster definition.&lt;/li>
&lt;li>Add your custom block devices for launch under the key &lt;code>blockDevices&lt;/code>.&lt;/li>
&lt;li>Make sure that &lt;code>AMI Block Device Mappings&lt;/code> is set to &lt;code>Defaults for selected instance type &lt;/code>.&lt;/li>
&lt;/ol>
&lt;h3 id="block-devices-definition">Block devices definition&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-json" data-lang="json">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f1fa8c">&amp;#34;blockDevices&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;deleteOnTermination&amp;#34;&lt;/span>: [&lt;span style="color:#ff79c6">true&lt;/span>|&lt;span style="color:#ff79c6">false&lt;/span>],
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;deviceName&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;[device string]&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;iops&amp;#34;&lt;/span>: [integer ranging from &lt;span style="color:#bd93f9">100-20000&lt;/span>],
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;size&amp;#34;&lt;/span>: [integer, size in GB, range from &lt;span style="color:#bd93f9">1&lt;/span>GB&lt;span style="color:#bd93f9">-64&lt;/span>TB],
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;volumeType&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;[st1|io1|gp2|sc1]&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>]
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h3 id="example-of-additional-block-devices">Example of additional block devices&lt;/h3>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#282a36;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-json" data-lang="json">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f1fa8c">&amp;#34;clusters&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;account&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;my-aws-account&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;application&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;myapplication&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;blockDevices&amp;#34;&lt;/span>: [
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;deleteOnTermination&amp;#34;&lt;/span>: &lt;span style="color:#ff79c6">true&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;deviceName&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;/dev/sda1&amp;#34;&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;size&amp;#34;&lt;/span>: &lt;span style="color:#bd93f9">32&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;volumeType&amp;#34;&lt;/span>: &lt;span style="color:#f1fa8c">&amp;#34;gp2&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#f1fa8c">&amp;#34;copySourceCustomBlockDeviceMappings&amp;#34;&lt;/span>: &lt;span style="color:#ff79c6">false&lt;/span>,
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#ff79c6">&amp;#34;useAmiBlockDeviceMappings&amp;#34;&lt;/span>: &lt;span style="color:#ff79c6">false&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> },
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> ...
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>]
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="vpc-subnet-type">VPC subnet type&lt;/h2>
&lt;p>Throughout Spinnaker, Subnet Type is an abstraction of subnets within AWS.&lt;/p>
&lt;p>You can find fields that you use to specify VPC Subnet type when creating load balancers, deploying server groups, etc.&lt;/p>
&lt;p>In order to use a subnet within Spinnaker, you will need to tag it in AWS a certain way.&lt;/p>
&lt;p>There are two ways you can tag them. One option is to use the convention &lt;code>spinnaker.&amp;lt;internal|external&amp;gt;.&amp;lt;region&amp;gt;&lt;/code> for the subnet&amp;rsquo;s name. In the screenshot below, you can see that is what I have done on my subnets.&lt;/p>
&lt;figure>
&lt;img src="/images/user-guides/aws/deploy/Image-2017-03-30-at-1.48.35-PM.png"/>
&lt;/figure>
&lt;p>Another option is to create a tag named &lt;code>immutable_metadata&lt;/code> with value &lt;code>{&amp;quot;purpose&amp;quot;: &amp;quot;MySubnetNameInsideSpinnaker&amp;quot;}&lt;/code>&lt;/p></description></item><item><title>Continuous-Deployment: Use Amazon Secure Storage Service (S3) Artifacts in Spinnaker</title><link>/continuous-deployment/spinnaker-user-guides/aws-guides/artifacts-s3-use/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>/continuous-deployment/spinnaker-user-guides/aws-guides/artifacts-s3-use/</guid><description>
&lt;blockquote>
&lt;p>Before you start, you need to &lt;a href="/continuous-deployment/armory-admin/aws/artifacts-s3-configure/">configure an S3 artifact account&lt;/a>. If you don&amp;rsquo;t see an S3 option for Expected
Artifacts &amp;ldquo;Match against&amp;rdquo; in the UI, you&amp;rsquo;ll need to double-check your
installation is configured with the S3 account.&lt;/p>
&lt;/blockquote>
&lt;h2 id="identifying-an-s3-file-as-an-artifact">Identifying an S3 file as an artifact&lt;/h2>
&lt;p>On a pipeline&amp;rsquo;s Configuration, you&amp;rsquo;ll want to &amp;ldquo;Add Artifact&amp;rdquo;. If S3 has been
configured, you should be able to select &amp;ldquo;S3&amp;rdquo; to &amp;ldquo;Match against&amp;rdquo;. Now all
you should need to do is enter the object path as an S3 URL
(ie. &lt;code>s3://mybucket/myfolder/myfile.yaml&lt;/code>). You will want to select &amp;ldquo;Default
Artifact&amp;rdquo; so that, if the pipeline is run manually, it knows what file to pull
(because the artifact won&amp;rsquo;t be present in the trigger otherwise). Note that
you can choose a completely different path &amp;ndash; or even a complete different
artifact source &amp;ndash; for your default artifact.&lt;/p>
&lt;h2 id="referencing-the-new-image">Referencing the new image&lt;/h2>
&lt;p>Depending on what you&amp;rsquo;re using the file for, the artifact should show up as
a possible selection in later stages. For example, if you wanted to use the
S3 file as a deployment manifest, you could reference it in the &amp;ldquo;Deploy
(Manifest)&amp;rdquo; stage:&lt;/p>
&lt;figure>
&lt;img src="/images/s3-user-guide-1.gif"/>
&lt;/figure></description></item></channel></rss>