<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Chris Uttenweiler on Medium]]></title>
        <description><![CDATA[Stories by Chris Uttenweiler on Medium]]></description>
        <link>https://medium.com/@cuttenweiler?source=rss-8b2487c222b3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*jl44C59orcoRJnmp.jpg</url>
            <title>Stories by Chris Uttenweiler on Medium</title>
            <link>https://medium.com/@cuttenweiler?source=rss-8b2487c222b3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 03:33:32 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@cuttenweiler/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[AWS SSM: Automation Roles & IamInstanceProfileName]]></title>
            <link>https://medium.com/@cuttenweiler/aws-ssm-automation-roles-iaminstanceprofilename-b5a69a89793d?source=rss-8b2487c222b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/b5a69a89793d</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[sms]]></category>
            <category><![CDATA[iaminstanceprofilename]]></category>
            <dc:creator><![CDATA[Chris Uttenweiler]]></dc:creator>
            <pubDate>Wed, 12 Apr 2017 18:26:33 GMT</pubDate>
            <atom:updated>2017-04-12T18:26:33.264Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*RioklzWylGjNh73984xGfg.png" /></figure><p>I’ve been neck deep in AWS EC2 Systems Manager (SSM) and let me tell yah, the documentation is in a sorry state; As such, here is another helpful hint for you. (Well and me too, if I ever forget this little tid-bit again…)</p><p>If your Automation Documents that contain an IamInstanceProfileName action are failing with an error that looks something link this…</p><blockquote>Automation Step Execution fails when it is launching the instance(s). Get Exception from RunInstances API of ec2 Service. Exception Message from RunInstances API: [You are not authorized to perform this operation. Encoded authorization failure message: {{BIG NASTY BASE64 ERROR}} (Service: AmazonEC2; Status Code: 403; Error Code: UnauthorizedOperation; Request ID: e7feb002-b375–4bfc-3bd4–633943b9e158)]. Please refer to Automation Service Troubleshooting Guide for more diagnosis details.</blockquote><p>… and then you, as a good little geek, check the said “<a href="http://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-ami-troubleshooting.html">Automation Service Troubleshooting Guide</a>” to read that …</p><blockquote>The assume role doesn’t have sufficient permission to invoke the RunInstances API on EC2 instances. To resolve this problem, attach an IAM policy to the assume role that has permission to invoke the RunInstances API. For more information, see the <a href="http://docs.aws.amazon.com/systems-manager/latest/userguide/sysman-ami-permissions.html">Method 2: Using IAM to Configure Roles for Automation</a>.</blockquote><p>… it might seem that you found your answer.</p><p><strong><em>Sounds pretty cut and dried, until you check your Automation Role and it’s policies to see that you have full rights to execute EC2:RunInstance on anything in the account.</em></strong></p><p>Here is the missing link / bit of detail: It’s not RunInstances that is failing, it’s IAM that is kicking you to the curb because your role doesn’t have the right to effect/influence/act on any IAM role objects.</p><p>You need to add this in-line policy to you Automation Role to get the whole thing to work:</p><pre>{</pre><pre>    &quot;Version&quot;: &quot;2012-10-17&quot;,</pre><pre>    &quot;Statement&quot;: [</pre><pre>        {</pre><pre>              &quot;Sid&quot;: &quot;GrantsAccessToIAMRoles&quot;,</pre><pre>              &quot;Effect&quot;: &quot;Allow&quot;,</pre><pre>              &quot;Action&quot;: [</pre><pre>                 &quot;iam:*&quot;</pre><pre>               ],</pre><pre>               &quot;Resource&quot;: [</pre><pre>                   &quot;arn:aws:iam::AWS-ACCOUNT-NUMBER:role/*&quot;</pre><pre>               ]</pre><pre>        }</pre><pre>    ]</pre><pre>}</pre><p>What you are doing is adding the right to act upon all role modifications in IAM under your AWS Account.</p><p>That is the missing link.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b5a69a89793d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[If you’re like me and HATE JSON…]]></title>
            <link>https://medium.com/@cuttenweiler/if-youre-like-me-and-hate-json-20aadfb18254?source=rss-8b2487c222b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/20aadfb18254</guid>
            <category><![CDATA[json]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[systems-manager-services]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Chris Uttenweiler]]></dc:creator>
            <pubDate>Fri, 07 Apr 2017 20:56:08 GMT</pubDate>
            <atom:updated>2017-04-07T20:56:08.312Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*tFuvEG2-YfBSMBPykulv9A.gif" /></figure><p>I loathed grammer tree’s in school, and if there is one twisted curly bracketed hell that reminds me of them — it’s JSON. I’m a spacial relations kinda guy; You can give me YAML anyday of the week.</p><p>So this isn’t a huge post, but hopefully if you are starting off with AWS EC2 Systems Management Services, and you have an automation document with SecurityGroupIds here is a JSON formatting tip that will help you out:</p><p>The SecurityGroupIds input uses a string array, and the AWS Systems Management Service documentation doesn’t give you one example of how the heck to format it, OR that it must be an array — even if you have one value to pass.</p><p>Fun huh?</p><p>So it’s basic JSON, but to those of us that hate the curly-bracketed-comma-obsessed-Rainman of template languages, here is the cheat sheet:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/791/1*I7xaGnzSS0ex7zdKNkLyvA.tiff" /><figcaption>Creates a new instance using Automation — So simple, but such a PIA</figcaption></figure><p>See the “SecurityGroupIds” call out at the end of the simple little example script above? Basically you start the call out as</p><p>“SecurityGroupIds”:[<br> “{{PARAMETER-VARIABLE(S)}}”,<br> “{{MAYBE-ANOTHER}}”<br> ],</p><p>This is a bit different than how it’s called out in CloudFormation Template — I got odd behavior when I ran it out on a single line, but you can give it a try if you’d like.</p><p>Again, to JSON script monkeys out there, this is a no brainer — but it’s a brain twister to those of us that hate this languge or are trying to learn it. I wish AWS would of tossed in one example to speed me along. Here is all they say about it:</p><blockquote>SecurityGroupIds</blockquote><blockquote>The IDs of the security groups for the instance.</blockquote><blockquote>Required: No</blockquote><p>Helpful huh? The killer here was the mental hangup that I only wanted to specify ONE group, not a list. Well, it’s an army of one or nothing.</p><p>So there yah go — a little tidbit for Friday. It won’t help 90% of the folks out there, but that one poor sole scouring the Interwebs to no avail — this one is for you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=20aadfb18254" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Ec2 Scheduler Released]]></title>
            <link>https://medium.com/@cuttenweiler/aws-ec2-scheduler-released-c0793881f173?source=rss-8b2487c222b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/c0793881f173</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[ec2]]></category>
            <dc:creator><![CDATA[Chris Uttenweiler]]></dc:creator>
            <pubDate>Thu, 22 Sep 2016 18:53:55 GMT</pubDate>
            <atom:updated>2016-09-22T18:56:53.788Z</atom:updated>
            <content:encoded><![CDATA[<p>One of the little rubs that most folks have with AWS platforms is how to control elasticity based on time.</p><p>It’s one thing <strong>to say</strong> that you can turn off workloads on the weekend or off-hours that your don’t need. It’s another thing <strong>to do it.</strong></p><p>Giving that logic to systems themselves, they could be shutdown on a schedule — but a “custodian” system/application needed to be deployed and online to bring them back up. You could also let a few third party systems handle this for you as well — but that was extra cost beyond the resources that you had to spend.</p><p>AWS just cannibalized that eco-system of tool providers a little bit this month by releasing the <a href="https://aws.amazon.com/answers/infrastructure-management/ec2-scheduler/">EC2 Scheduler</a> CloudFormations Pattern.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/557/1*sQuwfAeWH9gtWtNJ-BfKWg.png" /><figcaption>Source: AWS</figcaption></figure><p>This ingenious pattern uses CloudWatch and Lamba serverless architectures along with EC2 tags to set up a framework that can stop and start instances according to a schedule you can set directly through the AWS Console, or within your own asset creation scripts. No third party integration required.</p><p>It is a first generation release, so there are some considerations:</p><p><strong>It handles weekly schedules only</strong> — Sorry, biweekly and monthly intervals are not supported. Temporary automated shutdowns have to be coded over the standard configuration.</p><p><strong>No GovCloud Support —</strong> Not too surprised are you? For the record China (Beijing) isn’t supported either. On the upside, a single CF deployment of the scheduler can control multiple regions.</p><p><strong>Somewhat restrictive context and syntax — </strong>So you enter the details for stop and start in custom tags associated with your instances; be careful and remember that you only get 10 tags per EC2 instance.</p><p>Your schedules can be set using the following syntax: &lt;start time&gt;; &lt;stop time&gt;; &lt;time zone&gt;; &lt;active day(s)&gt;. The big gotcha here? It must be in UTC.</p><p>As a first release goes, there is a lot of good functionality in this pattern. It also integrates tightly enough into CloudWatch that you can add a pattern of you uptimes and schedule to your dashboard, which is a nice feature to help let your customers or upper management understand visually when systems will be / have been up or down.</p><p>The concept of programmatic elasticity has been one of the common rally cries to AWS — it’s nice to see that they are making it easier on us to use it natively now.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c0793881f173" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS, Ubuntu 14, and Multiple ENI’s]]></title>
            <link>https://medium.com/@cuttenweiler/aws-ubuntu-14-and-multiple-enis-b151692f6be8?source=rss-8b2487c222b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/b151692f6be8</guid>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[computer-networking]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[second-interface]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Chris Uttenweiler]]></dc:creator>
            <pubDate>Wed, 07 Sep 2016 16:10:52 GMT</pubDate>
            <atom:updated>2016-09-07T16:22:22.044Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*AQ7APK1M6OpxsFQ1Xr3Kig.png" /></figure><p>I used to run Linux as my desktop, and when I did, I was <strong>all</strong> in. I ran <a href="https://www.gentoo.org/">Gentoo Linux</a>, who’s claim to fame is that it compiles EVERYTHING — no packages. I really enjoyed tinkering with every aspect of the OS and learning things the hard way, pretty much daily.</p><p>Then I got busy, and then I go busier still. I didn’t have time left in my day to tinker with my workstation anymore. So I switched to Mac’s and OS X, as they gave access to Linux like tools, on a BSD underpinning, with a “get things done everytime” user interface. I’m still Linux oriented, but these days I mostly live in AWS Linux. That said, I still get a healthy exposure to Ubuntu, RHEL/CentOS, and the occasional SUSE.</p><p>Getting to the point, I’m spoiled. When I add an Elastic Network Interface (“ENI”) to an AWS Linux instance *POP* up it comes. Not so much the case in Ubuntu. As I tinkered with this (in relation to <a href="https://medium.com/@cuttenweiler/aws-networking-enis-through-the-fog-of-jetlag-6f0335e11d0f#.gpvnj1x0h">my earlier ENI post</a>) I took some more recent notes on how to configure an Ubuntu Box to support a second ENI, and thought I’d share.</p><p>First of all, you have to get into the box you are adding the interface to, so modify the Security Groups, and/or routing to get into the primary interface via SSH. Having a “Bastian” or “Jump” box is a handy thing here as well.</p><p>After that, you will need to add an ENI via the CLI or the AWS Management Console, and attach it to your instance. Now that the AWS side is ready to go, lets start tweaking the OS to accept it.</p><p>NOTE: You will need to SUDO SU to root, or just SUDO to execute the commands needed to bring up the interface.</p><p>Change directories to the /etc/network/interfaces.d directory. You will need to copy the eth0.cfg file and rename it to eth1.cfg.</p><p>This file initializes the NIC’s on the OS, which are in reality the ENI’s that you attached to the instance. Eth0 is automatically supported, but eth1 will need some tweaking — so open up the file with your favorite editor (<a href="https://www.nano-editor.org/">May I suggest Nano</a>?) and make it look as such:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/353/1*ZGmt4_cruJuZlFJrbKi4BQ.tiff" /></figure><p>You will basically take all the “eth0&quot; entries and change them to “eth1”.</p><p>Save the file, and get back out to the command line — from here we will bring up the interface, and capture some information from it to finalize the interface configuration. Run the “<a href="http://manpages.ubuntu.com/manpages/trusty/man5/interfaces.5.html">ifup</a> eth1” command to bring up the interface.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/641/1*pM6TMzpPwoZ7f7aqW_nipg.tiff" /></figure><p>This command brings up the interface, and based on the config file we modified, the system reached out to a DHCP server and asked for an IP address on the subnet that the ENI is attached to. IP’s assigned to ENI’s typically do not change in AWS after they are assigned by the platform. To finish up our config, we need to have the IP address of the DHCP “server” that AWS is using on that subnet, so we can refrence it in our commands. Look at the feed back of your command — the line that starts with “DHCPOFFER” indicates that an address was offered by 10.0.0.1 — that’s our DHCP origin address. Write that down.</p><p>This next step is optional, but I like to see that everything is coming together. Run “<a href="http://manpages.ubuntu.com/manpages/trusty/man8/ifconfig.8.html">ifconfig</a>” to verify that the interface is up</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/574/1*awvOGUwhPF198XiKII7RYA.tiff" /></figure><p>Sweet! Next we need to get some routes in the system so that traffic can flow into and out of the new interface we created. First, we are going to pick up the default route advertised by the DHCP server to our system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/592/1*tNBRhAvCTmuq1HeKJLlbwA.tiff" /></figure><p>The 10.0.0.1 address is the DHCP server IP you wrote down earlier.</p><p>Then, we will add routes to to the internal table to support proper connectivity, we will need a “from” and a “to” route.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*6Gyv0j7T_8T7VE_WTRAvrQ.tiff" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/1*zJKiMclOGcWjaoIYJeHSng.tiff" /></figure><p>The 10.0.0.211/32 address is the IP assigned to the ETH1 interface from the DHCP server.</p><p>Now if you hooked up an ENI with an Elastic IP (“EIP”), made sure that the routing tables were correct, and allow ICMP Ping through the Security Group that the ENI belongs to (Phew! That’s a lot of TLAs! -&gt; Three Letter Acronyms) you should be able to ping the EIP assigned to the ENI, attached to the instance!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/1*hzlO9BPLb1f3XqxnXmvAvg.tiff" /></figure><p>IF this doesn’t work, make sure that the AWS side of things is set up correctly. 90% of the time, that’s the problem is routing or Security Groups — look there first.</p><p>Now that we have hooked this up by hand, let’s make it persistant between boots. We will add the commnands that we just ran to the eth1.cfg file, and interestingly enough, will need to add a couple additional commands to make sure that the new interface plays well with others on boot. Modify your eth1.cfg file to look like this — with your specific information of course.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/459/1*tZ-kHUa1zs-aRx_WxOO28Q.tiff" /></figure><p>A few notes on this config:</p><ol><li>Notice that the commands have and “up” in front of them. This commands the system to wait until the interface is in an up state before executing the command — this is a critical addition.</li><li>The last line, “ip route flush cache”, does what is says — flushes the route cache. If you don’t add this line along with the others, you get an odd behavior where eth0 stops responding becauase of route cache confusion, and you can only access eth1.</li></ol><p>Reboot the Instance, either from the OS, or from the AWS Console. It should come up and have two interfaces enabled and ready to rock on two different subnets.</p><p>This knowledge is handy for adding an interface on a second subnet, but just as an aside, adding two interfaces to the same subnet on the same instance in AWS can introduce some “intresting” routing behaviours to the intstance. YMMV.</p><p>I’m not 100% sure that these instructions will work with pure Debian systems, but it should be close. Only trick here is that “close” in Linux is sometimes miles apart.</p><p>On that note, there is a way to attempt to give Ubuntu the same sort of automatic ENI addition functionality of AWS Linux, it’s called <a href="https://github.com/ademaria/ubuntu-ec2net">ubuntu-ec2net</a>. The only problem is that it hasn’t really been updated for 3 yrs, and is a bit twitchy — User beware.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b151692f6be8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The State of IPv6 in AWS — August 2016]]></title>
            <link>https://medium.com/@cuttenweiler/the-state-of-ipv6-in-aws-august-2016-976c9088132c?source=rss-8b2487c222b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/976c9088132c</guid>
            <category><![CDATA[amazon-s3]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[ipv6]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Chris Uttenweiler]]></dc:creator>
            <pubDate>Mon, 29 Aug 2016 15:14:30 GMT</pubDate>
            <atom:updated>2016-08-29T15:30:20.597Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/499/1*T913650AFFN_lAwPoe_4Mw.jpeg" /></figure><p><strong>Issues &amp; Concerns</strong></p><p>More and more, I’m asked *exactly* what IPv6 on the AWS platform really means, by more than a few confused people. Working within the Higher Ed and Federal markets, IPv6 is a topic on folks mind — whether its a point of pride at being at the “edge” of solving IPv4 starvation problems, or just fully adhering to the OMB’s IPv6 Mandate for Federal Clients — which has come and gone in 2007.</p><p>I must say, I do share the frustration of these customers as they navigate the many asterisks and small print exceptions when addressing their IPv6 adoption / readiness on the AWS Cloud. Counter point to this is that AWS needs to know that people need (not just “want”) the feature.</p><p>For better or worse, it is what it is — and only a large vocal out cry from the affected communities of users, as well as the low constant growl of their wallets, will bring us a faster, more complete adoption. Just posting on the support forums that you need it is not as powerful of a tool as really leaning on your AWS Account Reps and Solutions Architects — and <strong><em>showing</em></strong> them that it is critical to your workloads. I bug/pester/annoy/put-on-the-spot each AWS SA I meet concerning IPv6 for my customers — but the more that the customers lean in, the more momentum we will get towards a more robust support of the protocol. I’m one voice represting 100’s — that isn’t as powerful as 100 individual voices.</p><p>That said, this month we have some movement on the IPv6 support effort. <strong><em>S3 has received some of the most extensive IPv6 support that any service has ever seen within AWS.</em></strong> I’m hoping that this is a lead up to re:Invent, and we will see lots of IPv6 feature adds leading up to and at the show this year.</p><p>Fingers crossed!</p><p>I’ll update/build on this post as we get new features, but until then, here are all the services that support any type of IPv6 in AWS. Let me break your heart upfront however: There is no <em>native</em> IPv6 support for Instances within AWS. Period. You can impliment a dual stack overlay, however it will not be able to take advantage of any native AWS services — even a VPN. You will have to roll your own like it’s 2005.</p><p><strong>Where We Are Now — August 2016</strong></p><p><strong><em>Elastic Load Balancers</em></strong> — A load balancer deployed in the legacy EC2-Classic mode can support IPv6, sort of. The ELB can be reached via IPv6 using a DNS lookup — you don’t assign it an IP. Also, AWS can provide 3 FQDN to access the ELB: One for IPv4, one for IPv6, and one for IPv6 dualstack. I’ve found that the dualstack address works much more reliably. Regardless, the ELB will communicate with the backend EC2 instances using IPv4 only.</p><p>Interestingly enough, EC2-Classic networking has not seen any sort of feature progression in years. What we have seen is a number of migration features to move you from EC2-Classic to the VPC Networking mode. Newer accounts don’t have EC2-Classic mode enabled at all, you will have to enter a support ticket to obtain it.</p><p>Regardless of EC2-Classic’s future, if you want an AWS supported/maintained ingress/egress to for IPv6, you would use an ELB in that mode, and configure it for dualstack support.</p><p><strong><em>Virtual Private Cloud (VPC)</em></strong> — There is no support for IPv6 natively in the VPC services. There is nothing stopping you from implimenting an overlay network however. The downside here is that the native AWS services can not interact with the IPv6 protocol, so your IPv6 traffic is largely “trapped” inside of the VPC, unless you build some sort of self run proxy or egress to allow it to traverse the VPC.</p><p>That said, if you issue a “show status tunnel” command on a VPC Virtual Private Network (VPN) tunnel, you will see a IPv6 counter on the rec/xmit stats. I’m hoping this means that there is at least a stubbing for IPv6 support here, however that is 100% speculation on my part.</p><p><strong><em>S3</em></strong> — Some good news here, finally! As of this month, you can access your S3 buckets and objects via IPv6 using the dualstack URL. You access the bucket using one of the two URL formats for S3:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*CCI7ILtAfCWnpoccD9O68g.png" /></figure><p>All regions (even GovCloud!!) are supported, <em>except</em> Beijing/China. A few features gotchas here, but not too bad for a version 1 release of the feature:</p><p>· S3 Features — Most features are supported except Static Website Hosting, S3 Transfer Acceleration, and BitTorrent Support. Not supporting S3 Transfer Acceleration makes sense, since that feature works hand-in-hand with CloudFront.</p><p>· Policy Changes — Your IAM and Bucket Policies will need to be modified to enumerate IPv6 addressing, if you wish to allow or deny it once you’ve set up your dual stack access.</p><p><strong>Route 53</strong> — AWS Hosted DNS supports AAAA and PTR records for EXTERNAL resolution. No movement here since 2011, sadly.</p><p><strong>My Wish List</strong></p><p>The S3 support is a great place to start, but besides full EC3 and VPC support, I’d love to see IPv6 support within the CloudFront service line. Being a realist, if I can wrap the consumption of my services in IPv6, then I can continue to wait a little bit for “real” support.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=976c9088132c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS CloudFront Housekeeping — Programmatically Cleaning the Cache]]></title>
            <link>https://medium.com/@cuttenweiler/aws-cloudfront-housekeeping-programmatically-cleaning-the-cache-e871a1181e4a?source=rss-8b2487c222b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/e871a1181e4a</guid>
            <category><![CDATA[cloudfront]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[command-line]]></category>
            <category><![CDATA[content-delivery-network]]></category>
            <dc:creator><![CDATA[Chris Uttenweiler]]></dc:creator>
            <pubDate>Fri, 26 Aug 2016 18:35:23 GMT</pubDate>
            <atom:updated>2016-08-26T20:36:28.030Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*VcC3LaqNOyaCVSC8HD5_vg.png" /></figure><p>Content Delivery Networks (“CDNs”) do a good job of keeping themselves clean and up-to-date. However sometimes the origin systems/applications/webpages we are using go through a big update, and/or we’d like to have a hard cut-over to a new edition or version of our sites. Having the old versions of the files hanging around in the CDN could cause delays in the roll out, or strange behaviors in our web applications.</p><p><strong>Why you’re doing this, doing it once for exposure, and what’s happening</strong></p><p>To flush out this old stuff, we will want to clear out the cache — the AWS CloudFront term is for this is an “invalidation.” This is more than a nit-pick, because we invoke the “create-invalidation” command / SDK method in order to go about doing it! Invalidations are executed against a specific CloudFront Distribution.</p><p>This can be done from the AWS Management Console easily enough; I’m going to step through that quickly to introduce the basics that will help explain how to execute the functionality programmatically.</p><p><em>Before I start explaining how and why, a foundational basic first:</em> You have to have the authorization to take these actions I am about to describe. <a href="http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/access-control-managing-permissions.html#access-policy-example-allow-change-resource-record-sets">The following is the “straight from the manual”</a> IAM permissions policy that will need to be in effect for your user/role to work with invalidations. Of course a full admin or full CloudFront permissions would work as well, but here are is the least permissive policy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/533/1*W_947Nu6_uWebxDKshOG-w.png" /></figure><p>Assuming that all the permissions are in order, lets get started. First, bring up your CloudFront Distribution in the AWS Console, the choose “Invalidations.” (AWS Console -&gt; CloudFront -&gt; Distributions -&gt; Invalidations tab)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*KAGWNknnBziuWquTrPjX-g.png" /></figure><p>Now the rubber hits the road; indicate which elements of your cached site that you want to flush. Just like all important things, the paths are case sensitive, so attention to detail is key here. Also, you can use wildcards to take out entire roots, directories, etc.</p><p>Paths are relevant to the distribution, so <a href="http://xxxxxxxx.cloudfront.net/images/banners">http://xxxxxxxx.cloudfront.net/images/banners</a> would be referred to as “/images/banners.”</p><p>Wildcards in your path declarations are an option, and are a powerful tool when working with invalidations — attention to detail is needed when working with them however. With that in mind, I’ve whipped up a cheat sheet based on the <a href="http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Invalidation.html#invalidation-specifying-objects">docs</a> for you:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*YACwMqbl9NpY3BOiVHuyug.tiff" /></figure><p>The screen you use in the console to enter paths looks like this. Press enter after each of your invalidation paths. The action of invoking / running the invalidation doesn’t trigger until you hit the pretty blue button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/421/1*-BSJXuohYO_PiYPiX8LHhQ.png" /></figure><p>Be sure you really want to do this before hitting the “Invalidate” button — once you push it there is no stopping it.</p><p>Oh, and you <em>could</em> be charged for this action too.</p><p>CloudFront allows the first 1,000 paths requested for invalidation a month to happen at no charge. After that you get clipped for $0.005 per path requested for invalidation. Paths you enter with a wildcard tally up to equal the number of paths / URL’s that get removed. It’s not a lot of money, but just be aware that it will happen should you cross that 1,000 object/URL line.</p><p>Pretty easy huh? Once you have created an Invalidation, you can re-run it later. An invalidation takes about 10 minutes or less to to run across the CDN edge, so don’t expect immediate results.</p><p>Now if you trigger an invalidation by accident, there is no need to get too excited — as your site is accessed going forward, CloudFront will start caching the content you invalidated again as it is requested, and all will be right with the world in time.</p><p><strong>Evolving from Mouse Thrashing, to Key Tickling.</strong></p><p>Sometimes, you don’t want to personally “click-click-type-click” your way through the Console to trigger an invalidation. Replacing yourself with a tiny script has the advantage of empowering others, and more importantly giving you more time AFK (“Away From Keyboard”) if you want to schedule the action or trigger it with other programmatic activities.</p><p>Understanding the Command Line Interface (CLI) method of doing this helps with understanding how the API’s and SDK’s process the request. In my opinion working with the CLI almost always is the best way to learn something new, as well as what the SDK’s will need to execute the action.</p><p>The commands to invalidate content from the CLI are still technically in the “preview stage.” If you are not aware, AWS keeps things in this stage for awhile, for better or worse. To enable access to the feature on the CLI, you have to run the following command to pop-off the safety:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*EC3i_ocCWYN28BHPx-FPPQ.png" /></figure><p>Alright, we are ready to dive in; the instruction we will be utilizing is the “create-invalidation” command:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*HEG6N5EVPbrxyNW2Xm_uuw.png" /></figure><p><a href="http://docs.aws.amazon.com/cli/latest/reference/cloudfront/create-invalidation.html">Check out the docs for an explanation of <strong>all</strong> the switches</a>, but I’ll cover the important ones below.</p><p>· <strong>distribution-id</strong> — The ID of your CloudFront distribution. –REQUIRED —</p><p>· <strong>invalidation-batch</strong> — A JSON file that you can create to hold all of your invalidation paths and a few variables. Frankly, this is infinitely safer than tossing them on the command line.</p><p>· <strong>paths</strong> — Okay, if you are a Keyboard Cowboy, you can toss a space separated list of paths after this switch to invalidate. Don’t say I didn’t warn you.</p><p>The way I get this started is to build my invocation JSON file, I tend to name them invbatch-[PURPOSE].json. The file needs to follow this format:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*KPBf69BmsRVTMhOe6me2vQ.png" /></figure><p>Pretty self explanatory really. “CallerReference” lets you name the invalidation. If you leave this blank or use the command line, AWS makes something up for you that isn’t remotely human readable. This value will need to be unique between unique invalidation requests, because you can reference this value to re-trigger the same request, should you need to.</p><p>Bringing it all together, the command line to execute this invalidation looks like this:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*FJ8cv9YF6vzmWnKmtNyFWQ.png" /></figure><p>Once you trigger that command, the system leaps into action. It will return a JSON output to your screen that reports the status, and parrots back the configuration you built for the action. In the background, the CloudFront platform starts yanking out all the objects that match your URL patterns.</p><p><strong>Code Monkeys — Here’s your huckleberry</strong></p><p>So you can take the command above &amp; supporting invbatch files and execute them in a cron, or if you would like to integrate a invalidation event into your operations you can use the various SDK’s to get things done.</p><p>Looking at the CLI has given you the grounding to tackle the task in all of the supported SDKs. Each one is structured appropriately to the language applied. Click the label link to get to the SDK Reference to see an example along with the expected formatting of the variables we used the command line.</p><p><a href="http://docs.aws.amazon.com/aws-sdk-php/v3/api/api-cloudfront-2016-08-01.html#createinvalidation">PHP</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*6JVpEQq-NN00UEWpFLeCiA.png" /></figure><p><a href="http://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/CloudFront.html#createInvalidation-property">Node.js</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*FJXhtGCMPWOfcz2G18BXAg.png" /></figure><p><em>Like Modules? Here is another option for Node.js</em></p><p>I’ve played a little with a node.js module called “<a href="https://github.com/edj-boston/void">Void</a>” that takes care of this as well. It’s still in development, but it’s a nice little self contained (but relies on the AWS Node.js SDK) module to kick this sort of thing off</p><p><a href="https://boto3.readthedocs.io/en/latest/reference/services/cloudfront.html#CloudFront.Client.create_invalidation">Python</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/1*PdfE-Byj_gAW27jV5UGB2w.png" /></figure><p><a href="http://docs.aws.amazon.com/sdkfornet/v3/apidocs/Index.html">.NET</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/931/1*kVaNj58iZV4YbkGiLdcJTQ.png" /></figure><p><strong>Other options — Version Control Design Operations</strong></p><p>Invalidation requests have a few draw backs we illuminated earlier — the biggest two being possible cost, and delay in effect. The alternative way to getting “refresh” functionality for big changes is to use a versioning control pattern with your CloudFront deployment. This is less of a monolithic feature or command, and more of an operations methodology that relies on a few characteristics of CloudFront and your origin application/webpage.</p><p><em>HEADS UP — This has nothing to do with </em><a href="http://docs.aws.amazon.com/AmazonS3/latest/dev/Versioning.html"><em>S3 Versioning</em></a><em> what-so-ever</em></p><p>· <strong>String Based Versioning</strong> — Using this method you take advantage of the “<a href="http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/QueryStringParameters.html">Forward Query Strings</a>” function of CloudFront and pass a variable back to the Origin to select the object for CloudFront to cache. It would look something like this: “/images/foo.jpg?version=12” In essence, you modify your application/website to request the new version of the object and CloudFront asks the Origin Server for that version to cache. This method must be supported by your application/backend Origin Server.</p><p>· <strong>Filename Modification </strong>— This method has a few different ways to implement, but works in the same basic manner. Through your application and origin servers, you modify the filename of the “current” version of the file/object you want cached. Like the first method, as soon as the new request is seen by CloudFront, it updates the cache. Again, most of this magic is triggered by the back-end Origin Server configuration.</p><p>Something keep in mind — using either Version Control element above in your site/distribution design relies on your expiration settings in CloudFront to keep your cache size down — which in turn has a cost consideration as well.</p><p>Integrating a Version Control Design Operation into your site/application is a step beyond simply fronting your web presence with a CDN. It is something that you design or re-factor to support. I’ll probably write another blog on VCDO, as I call it, in the future — my simplified summary above was only meant to show you that other options exist. You can read more about the concept <a href="http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/ReplacingObjects.html">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e871a1181e4a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[aws-shell … I think I’m in love.]]></title>
            <link>https://medium.com/@cuttenweiler/aws-shell-i-think-im-in-love-d39878c3e7b7?source=rss-8b2487c222b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/d39878c3e7b7</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[command-line]]></category>
            <category><![CDATA[aws-cli]]></category>
            <dc:creator><![CDATA[Chris Uttenweiler]]></dc:creator>
            <pubDate>Thu, 25 Aug 2016 19:29:41 GMT</pubDate>
            <atom:updated>2016-08-25T19:34:09.055Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*2vbSURVoVu-6dtjkSiS0qA.png" /></figure><p>Amazon Web Services is a very large sprawling platform. As such, it has a very large and sprawling collection of API’s to issue commands against. The AWS CLI team has done a great job in the last few years of standardizing the commands — both in syntax and function.</p><p>That said, there are still a ton of commands to remember, and it can be daunting to the new user, or to a user that doesn’t have a lot of command line experience. Simple tab completion, when you enable it, helps a little bit, but frankly it isn’t enough to really pull a user into a CLI state of mind.</p><p>To address this, and to really kick up productivity a notch, the AWS team started to work on a dedicated <a href="https://github.com/awslabs/aws-shell">AWS shell</a> — the first glimmers of it I saw at AWS re:Invent 2015. The first functional version of it was dropped in December 2015, and then in May of this year, we quietly had access to version 0.1.1 — which is just choked full of goodness.</p><p>Basically, the shell gives you the ability to do look-ahead command completion, meaning that you don’t have to know a command to find it. Furthermore, it will help you with the switches used with a command as well. Practically that means that you don’t have to have the CLI documentation page up as you work with a new command! The shell will go so far as display help in a separate panel on the bottom of the screen, or inline as you type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/793/1*fuKmT3QvUgX4Bt4uGnfq5g.tiff" /><figcaption>133t training wheels for sure!</figcaption></figure><p>Another huge feature is Server-side Auto-completion that looks up values for you on the platform, like instance ids, or VPC ids. (Support is hit or miss so far — it will support more server-side look ups as the product matures.)</p><p>The utility easily installs like most AWS tools, meaning you can use pip to install it</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/413/1*DmoZvOOQogy8FOmYGbpPCw.png" /></figure><p>If you are an Apple user like me running OSX 10.11, you will need modify this a little bit to get around some weird Python dependencies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/954/1*JQr9YQOJlBozstJx-wZRCg.png" /></figure><p>Regardless, after the install, type in “aws-shell” in your terminal/command line window, and after the the utility finalizes its state, you are up and running.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*Ff3li-11i-5aOfdzYzP-iw.tiff" /></figure><p>As I’m fond of saying, “I’m a naturally lazy, tool using ape,” so this evolution of tab-completion is quite welcome to me. For those getting familiar with AWS, it’s a great learning tool.</p><p>The utility is in Developer Preview right now, but I haven’t hit any major bugs. I’m pretty familiar with the CLI, but having the help reference at my finger tips has been a big productivity boon for me. What is also nice is that preview features in the CLI are called out in the help as well, and explain to you how to enable them, if you want to give “new &amp; dangerous” something a try.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d39878c3e7b7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Placement Groups & SR-IOV — Like a Drum Circle for your Apps]]></title>
            <link>https://medium.com/@cuttenweiler/aws-placement-groups-sr-iov-like-a-drum-circle-for-your-apps-6174d3f90295?source=rss-8b2487c222b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/6174d3f90295</guid>
            <category><![CDATA[cluster]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[hpc]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Chris Uttenweiler]]></dc:creator>
            <pubDate>Wed, 24 Aug 2016 03:51:03 GMT</pubDate>
            <atom:updated>2016-08-24T03:51:03.990Z</atom:updated>
            <content:encoded><![CDATA[<p><em>In this quick blurb, I’m hitting most of my really technical stuff up front — muscle through and we get to the AWS Cloud Architectures and where that rubber meets the road of technical implementation.</em></p><p>In the physical IT space, we had a lot of control over how we set up our infrastructure and systems. It’s not talked about very often any more, but the more layers of the Open Systems Interconnection (OSI) Model we specifically designed for optimization in our architectures, the more flexibility, control, and performance tuning opportunities we had. For the newly minted IT folks out reading along, there are 7 layers of the OSI, counting from the bottom up — Physical Layer =1 / Application Layer = 7. They basically took you from the lowest level of an IT architecture, right up to the application behaviors themselves.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*LPKrlXCbtpEZy8KJrCBJuw.png" /><figcaption>Go check out <a href="http://www.webopedia.com/quick_ref/OSI_Layers.asp">http://www.webopedia.com/quick_ref/OSI_Layers.asp</a> for a good write up of the OSI Model.</figcaption></figure><p>The Virtual Computing revolution obscured layers 1–2 almost entirely. The Cloud has taken the OSI model and just shredded it below Layer 5. Yes, folks try to make it 1:1 relevant, but the bottom line is that we have traded Cloud economy of scale, time to market, and flexibility for a lot of the utility we got from the OSI layer cake.</p><p>Alright, so there is more to this the point that just some old IT artifact bemoaning the revolution of the Cloud — far more. I’m <em>exceedingly</em> pro-cloud, just short of an evangelist really, however there were some real benefits to being forced to build, configure and manage all the layers of the OSI model that we don’t get with Cloud methodologies. The good news is that we are starting to get some of it back. The bad news is that we have a generation of newly minted IT folks that just don’t understand the uber importance of why these OSI bridge features matter.</p><p>One such feature that is trying to bridge Old World controls and Cloud “you can have it in any color as long as it is black” feature inventories, is the AWS Placement Group. By the book AWS defines a Placement Group as such:</p><p><em>A placement group is a logical grouping of instances within a single Availability Zone. Using placement groups with supported instance types enables applications to participate in a low-latency, 10 Gigabits per second (Gbps) network.</em></p><p>For those of us who’ve worked with AWS and cloudly like things from the start, this is a great feature that seeks to replace a wee-bit of functionality &amp; performance tuning that we had in the physical world.</p><p>The meaning beyond the definition is that we can give AWS a strong hint that we are deploying a group of systems into a Virtual Private Cloud (“VPC”) that need the lowest latency that they can give us to communicate efficiently between each other. Application clustering, analytics applications, pseudo HPC applications, Big-Data apps — all these network hungry drum-circles that take large amounts of data and derive them down to a focused data set benefit from this feature.</p><p>AWS pulls this off by carefully launching your instances destined for a Placement Group in a relationally close networking loop. To do so, a placement group must live in the same availability zone — which breaks the best practice of Multi-AZ deployment. However, if you look at the compute resources in a Placement Group as a temporary cog/assembly, and the data as the pillar of your architecture you can wink clusters of systems in a Placement Group in and out of existence as you need them.</p><p>Now hooking up a fast network to a slow machine won’t get you anywhere — in the physical or virtual world. However, you can control this on the AWS Instance type that supports Enhanced Networking and your good to go.</p><p>Enhanced Networking used “single root I/O virtualization” (SR-IOV) on both Windows and Linux instances to trick out the networking layer of your instances, and keep the CPU as free from network I/O bottlenecks as possible. This lets you push the throughput to 10Gbps. A new comer to the game is the X1 instances, which support an even more aggressive optimization of the networking layer to achieve 20Gbps.</p><p>For you heavy HPC folks out there, this isn’t HDR InfiniBand speeds we are talking about here, but for a fully virtualized environment, that costs far far less than a single low-density InfiniBand switch, this is not a bad compromise. Besides a constant 20Gbps between nodes is not that shabby. If you dabbled in the hardware installation and config side of InfiniBand setting up Enhanced Networking and Placement groups is like an all-inclusive tropical island vacation in comparison.</p><p>cfnCluster (a Python based cluster creation script) uses Placement Groups to optimize networking between Compute nodes. You could also use the ElastiCluster utility which also understands and utilizes Placement Groups. Regardless of your choice of Cluster Creation utilities, Placement Groups gives you the ability to build clusters to match your workload needs, as opposed to trying to shoe-horn your applications onto a cluster, by making it easy to build (in a fully automated fashion) disposable HPC Grids.</p><p>Trust me — the words “disposable” and “HPC” haven’t been in the same sentence for very long.</p><p>Another interesting feature of a Placement Group is that you can deploy them across different VPCs — allowing temporary boosts in inter-VPC networking for applications working together with other systems / teams in your AWS Accounts. (#GeekSqueal) You can’t get the full 10G experience, but you do get benefits over just a VPC Peering connection.</p><p>Engineers are a whiny crowd. The older we get, the whinier we are — even if it is only in our own heads. Cloud methodologies really moved the cheese of a lot of folks when it hit. Once Engineers and Architects got to the point of adoption, the next stage of kavitching is feature parity.</p><p>As Cloud matures, it will grow these features and move forward — it’s up to the savvy technologist to stop asking “why”, and ask “how” when we feel that inflexive “No!” reaction coming. Placement Groups, and SRV-IO networking aren’t as sexy as some Cloud features, but they open up a number of HPC workloads that we couldn’t service before. We’ve had Placement Groups since 2011, but the increasing functionality hasn’t gotten much illumination.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6174d3f90295" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Misunderstood Misfits — The T2 Instance.]]></title>
            <link>https://medium.com/@cuttenweiler/misunderstood-misfits-the-t2-instance-14ed3ec9a314?source=rss-8b2487c222b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/14ed3ec9a314</guid>
            <category><![CDATA[information-technology]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[t2]]></category>
            <dc:creator><![CDATA[Chris Uttenweiler]]></dc:creator>
            <pubDate>Fri, 19 Aug 2016 19:23:32 GMT</pubDate>
            <atom:updated>2016-08-30T16:03:50.753Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oZEx_okP6wKleFsfsilHOQ.jpeg" /></figure><p><em>We are going to take a simple but often misunderstood AWS methodology / feature and drag it out into the unapologetic sunlight of my way of looking at things: The T2 Instance — An Architects Users Guide</em></p><p>T2 Instances help us get to the elusive “Goldilocks” zone in our lower level capacity mapping in the AWS Cloud. It’s the architectural equivalent of sharing a meal with your significant other — done right, everyone walks away happy, feeling like they nailed their order, and that they (for once) didn’t over eat. However, if you’ve ever tried to “share” something when the both of you are ravenous, you know just how well that works out — as in it doesn’t, and enviably someone ends with a fork stuck in the top of someone’s hand like a bad Tom &amp; Jerry cartoon.</p><p>The major benefit of the T2 instance class is that you get <em>percentage</em> of an instances CPU power to leverage against your workloads, at a very low price. As we all operate in a give and take world, the consideration here is that you aren’t allowed to <em>constantly </em>consume more than your allocated portion of the processor time. It’s sorta like bogarting to many fires off that shared plate — you can get away with it so many times before, {{!BAM!}}, your hand is slapped.</p><p>Getting to the technicalities, each of the T2 instance sizes allows for different level of constant access and expected use the available CPU — this is called the Baseline.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/667/1*a1POE_HAZXVvGBHNLAOrqQ.png" /></figure><p>The diagram above shows the baseline expectations for each T2 instance size. To make sure that you are using the right instance size, you see what baseline you can operate in.</p><p>For example, if you have an application / workload that is going to use very little CPU, equal to or less than an average of 5% of one processor for an hour, then a t2.nano is a good fit. If you had an application/workload that would take up less than an average of 20% of once processor, but more than 10%, then a t2.small is the T2 for you.</p><p>The t2.nano through the t2.small are 1 vCPU instances. The t2.medium and t2.large are 2 vCPU instances. The trick to making sure you are walking the line using the medium and large T2’s is to understand that the baseline is an aggregate of the both vCPUs. For example, if you use 100% of a single vCPU and a 5% of the other, your CloudWatch metrics will show 55% utilization.</p><p>With either one or two processors, the expectation is clear — stay under the baseline and you’ll get constant performance. Well, what happens when your workload gets hungry for more?</p><p>In most cases, AWS <em>expects</em> that you are going to soar past the baseline occasionally. Really, asking a system to boot using less than an average of 5% of it’s of CPU is unrealistic. (It’s like the idea that people want more hotdog bun than hotdog, what rocket scientist came up with that??)</p><p>To address the inevitable over-use of the processor, AWS implements <strong>CPU credits</strong>. Single processor T2 instance sizes start you off with 30 credits, dual processor sizes start you with 60 credits.</p><p>Credits equate to 1 minute of full CPU performance against on vCPU core. AWS is agonizingly literal about this — they track the utilization of the vCPU’s at the millisecond level. So you can and do consume fractions of a credit as your system works the processor, but at least you are charged an exact amount as opposed to getting rounded up on. You can trust but verify the state of your systems and pools using CloudWatch metrics and alarms. AWS stays very much above board on this.</p><p><strong><em>CPU Credits are the foundation of the T2 instance operation.</em></strong> When you are running your system you are constantly consuming and in some cases banking credits. This is where it gets a wee bit complicated to plan to use T2 instances in a steady state / production environment, and why a lot of people just use them for development or sandboxing use cases.</p><p>Basically, AWS provisions each T2 instance size with a large starting pool of credits, and then feed it enough over the course of each hour to run at it’s baseline level. If you consume more than the credits you are given in an hour, the pool goes down. If you consume less, you get to back the hours that you didn’t use. Each credit you earn is good for 24hrs in the bank. If you don’t use that particular credit, it expires and is taken off that instances pool ledger.</p><p>Each T2 instance type has a maximum pool size to take into account as well — but the ebb and flow of credits is more important to understand as it is your planning metric. <em>The pool is your safety margin.</em></p><p>Honestly, one of the best explanations of Credit expenditure and banking is straight from the AWS on-line manual entry on T2 instances:</p><blockquote>[I]f a t2.small instance had a CPU utilization of 5% for the hour, it would have used 3 CPU credits (5% of 60 minutes), but it would have earned 12 CPU credits during the hour, so the difference of 9 CPU credits would be added to the CPU credit balance. Any CPU credits in the balance that reached their 24-hour expiration date during that time (which could be as many as 12 credits if the instance was completely idle 24 hours ago) would also be removed from the balance. If the amount of credits expired is greater than those earned, the credit balance will go down; conversely, if the amount of credits expired is fewer than those earned, the credit balance will go up.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/769/1*GY_4dM4CRPhzx36npYOYHw.png" /></figure><p>AWS has a pretty “fair” system for helping you utilize T2 instances — however, if you are undersized too far, you will exhaust your pool. Once you reach a zero pool balance, AWS will start lowering your access to the vCPU core over 15 minutes until you are throttled down to the baseline expectation of the instance type you provisioned. While a fair and balanced response to using too many resources, it will feel like your application is bogging down, and your CPU KPI’s will look as though the system is not stressed. Don’t be fooled — you’re being starved for your gluttony.</p><p>Admittedly, there are a lot more nuances working with T2’s than with all the other instance sizes in AWS — but there is a financial benefit for sure as a T2 instance tends to be 40%-50% cheaper than their closest M class cousins.</p><p>The T2 class excels at single server workloads — or in other words single uniform tasks. File servers, File transfer servers, and other “You’ve got one job” roles that you can develop/predict an average workload on. Picking up jobs from a queue and processing tasks is another place where they find a happy purpose. I love using them to support Continuous Integration (CI) and Continuous Delivery (Cd) tools — mostly because of the predictable nature of those workloads resource needs, and that I like to keep those types of systems up in a steady state to handle the needs of Dev and QA teams. Devies and QA Cops are a hair trigger on the panic button in my experience as an Ops Monkey, and I’d rather not move their cheese on tools they see as critical.</p><p>(Somethings, like team-critical toolsets, I still am bearish on blinking in and out of existence, even if the load on them isn’t constant — T2’s let me look at not compromising cost vs consistency in these cases.)</p><p>Using T2’s as web origin servers for a website fronted by a CDN, or as a read-replica feeding an ElastiCache node is another interesting use of the instance type. Sometimes when I suggest people try this out, their eyes bug out — however the network throughput of a T2 instance is on par with the other t-shirt sized instances in it’s class, and oddly in some cases there is a quick 1G burst of through put before they settle into a steady state comparable with their like sized cousins. At the very least, you should consider load testing such a scenario if you are looking for some pennies to squeeze out of a budget.</p><p>Where they don’t fit in very well at all is load balanced workloads working as a close knit group of servers. T2’s aren’t really team players. Putting T2’s in an auto scaling group is also a lesson that I can share my scars with you on, so you can avoid it. They don’t play nice under such scrutiny, and tend to make for some very grumpy load balancers.</p><p>Theoretical spreadsheet jockeys often come to the beer-napkin conclusion that acquiring T2’s on the Spot market would support a fairly powerful queue tasking workload… in theory yes, however AWS would like to stay in business, so you won’t find the uber-frugal T2’s on the Spot market.</p><p>Finally, don’t expect the T2 instances to give you stellar disk performance, as none of them support the EBS Optimized instance feature — however a nice steady, under baseline use case might not need that feature as much, and it’s easy enough to uncover in the KPI’s.</p><p>So, coming full circle back to our starting analogy (and oh do I love analogies…) how hungry your application/use case is determines if the T2 instance family is appropriate for you. Hopefully you’ll consider these little guys for a job other than a sandbox sometime soon.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=14ed3ec9a314" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Networking — ENIs Through the fog of Jet Lag]]></title>
            <link>https://medium.com/@cuttenweiler/aws-networking-enis-through-the-fog-of-jetlag-6f0335e11d0f?source=rss-8b2487c222b3------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f0335e11d0f</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws-architecture]]></category>
            <category><![CDATA[aws-vpc]]></category>
            <dc:creator><![CDATA[Chris Uttenweiler]]></dc:creator>
            <pubDate>Thu, 18 Aug 2016 18:37:53 GMT</pubDate>
            <atom:updated>2016-09-03T17:13:43.123Z</atom:updated>
            <content:encoded><![CDATA[<p>AWS Networking — ENIs Through the fog of Jet Lag</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*g0VRcnkzN43PxLzmworm5Q.jpeg" /><figcaption>Jet lags breeding grounds can be pretty</figcaption></figure><p>Jet lag is the mind killer.</p><p>Anyone who has ever had to regularly brave the US Airport circuit to make sure the checks don’t bounce at the end of the month, understands that jetlag isn’t something that only gets you the day after you travel. The confused, fuzzy headed filter will occasionally slam down on your poor hapless brain anywhere from 24 to 168 hours since you finally landed back in your home time zone.</p><p>Delayed jet lag hit me like a sack of bricks yesterday, as I tried to explain verbally to a Client how to attach an Elastic Network Interface (ENI) to a network isolated AWS instance to support remote administration. While I was fighting my eye lids for control of my consciousness, I didn’t have the luxury of muscle memory to demonstrate the concept, since I wasn’t driving the console. To top it off, we were also working on a wireless connection that seemed to be playing merry hell with our AWS Console session.</p><p>Needless to say, hilarity ensued as Murphy played with us like marionettes. At the end of the session we did get the connection up, and I was reminded that AWS, in an attempt to keep things simple, obscures what is really going on when dealing with network interfaces, Elastic IP’s and routing tables inside of a Virtual Private Cloud (VPC). My understanding was complete, but in my fog I assumed that everyone understood the subtleties that are hidden in plain site when working with the console. That led to a pretty disjointed Point-A to Point-B process. Ultimatly it demonstrated a number of little things that the team hadn’t seen from the perspective of the ENI.</p><p>As such, and in an attempt to transform my foggy-struggles at the end of a simple consulting session into a teachable moment, I’d like to give you another way to look at AWS networking that isn’t new, but is often obscured by the inherit assumptions in many AWS diagrams.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*-zKsz3CYNuJpKoXqk9jXoQ.png" /><figcaption>Fig 1. So simple in assumption, so much possible complication in reality</figcaption></figure><p>Simplified, yes — however this is typically how AWS diagrams show the relationships of instances, subnets, the VPC, and Security groups. I often drill down deeper, but many examples and descriptions show that the instance has a direct membership INSIDE of a subnet, and that the Internet Gateway (IGW) is lurking near the public subnets waiting to route traffic with baited breath. In reality, its not that way at all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/777/1*ElvuTT7o1uxO_KyCo9a-lA.png" /><figcaption>Fig 2. A demonstration of how this all maps in my tortured mind — a little closer to reality I think</figcaption></figure><p>The way we really virtually wire all the instances together in a VPC is much more like the diagram above. It’s not as pretty and symmetrical, but conceptually you should always be thinking about your VPC networking like this. When you do, the security, flexibility and functionality of the VPC networking model spring forward.</p><p>First of all, ENIs are <em>attached</em> to instances and <em>assigned</em> to subnets. An instance’s connection, or anchor, to subnets is through the ENIs, or if you prefer, hook into a subnet trunk, though the ENI. Otherwise they float on the edge of subnets. The thing that makes the generalized “instance in a subnet” diagram technically correct, is that each instance is given a non-movable ETH0 interface at launch time that is assigned to a subnet. Really it’s the difference between looking at a visualization as an application/systems engineer or a network engineer. Using AWS requires you to do both in order to get the full picture.</p><p>The VPC router links all the subnets within a VPC together, referencing route tables that subnets are associated with. The router makes the call on what paths the traffic will take between subnets, and to ingress/egress points like the IGW or Virtual Gateways (VGWs) that you have attached to the VPC. Finally, the security groups encapsulate the ENI’s — <em>not the instances</em> — so that the Security Groups, ENI’s, and subnets act as membranes to protect and service the instances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*0AGPAzDkGzJxtiM91tWv9w.png" /><figcaption>Fig 3. Security Groups of Interfaces, not Instances.</figcaption></figure><p>In this context, it is also easier to show/visualize the true nature of Security Group memberships. Since traditional firewalling typically defended a subnet, sometimes the mind will drift back to that assumption. Looking at the VPC from an ENI centric view changes that for the better.</p><p>So, drilling into the use case I was trying to explain to my Client earlier, we have a need to preform maintenance or house keeping functions on our DB server, however it is in a Private Subnet. We can take advantage of the magic of ENIs and Elastic IPs (EIPs) to get the job done securely when we don’t have the luxury of using a Virtual Private Network (VPN) connection to come in over a permanent established backchannel.</p><p>The first part of this adventure is to build an ENI to handle the traffic. We need to do this because right now the DB server is only connected to the Private Subnet A, and Private Subnet A uses the NAT instance to communicate out of the VPC to the Internet. That is only a one-way path leading out of the VPC, that can’t support incoming SSH sessions into the DB instance, or interactive tools DB tools like Navicat.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*ET1mXSvXjr4yK8sFGYIfdw.png" /><figcaption>Fig 4. A three step process — Seems so easy to describe when your eyelids don’t weigh a ton each.</figcaption></figure><p>When we build the ENI, we specify the Subnet that the ENI is attached to, and what Security Group it is attached to as well.</p><p>In the AWS Architecture and SysOps classes I teach, I stress that there are two places to look <em>first</em> when you are having a connectivity issue: Security Groups and Routing Tables. 90% of the time, there is a SNAFU with one of those two configuration points. When attaching your ENI to a Security Group to support this use case, make sure you have configured the group to support the bare necessity of ports, and make absolutely sure you have specified a source IP address or source IP range to allow the traffic from. While SSH can weather unfiltered exposure <strong>fairly</strong> well if you are using Key authentication, a system with RDP open to the world will quickly find itself a new occupation as a Bit-Torrent node, compliments of some pimply faced 133t script kiddie.</p><p>Specifically, we will need to create a Security Group for our use case, let’s call it “MySQL-Direct-Access”, and open up ports tcp/22 and tcp/3306 from <em>an exact IP address</em> used by our SQL team. We will assign the ENI to that group, and to the Public A Subnet.</p><p>After that, we will attach the ENI to the DB server, and associate an EIP with the ENI.</p><p>(Note: The AWS Linux OS picks up the new ENI automatically, and oddly enough *most* Windows AMI’s do as well. However Ubuntu, SUSE, and RHEL sometimes don’t and you’ll need to modify the standard config files to get the instance to see the new ENI. Sometimes a restart will do the trick too)</p><p>That changes our logical landscape to look like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/665/1*5m8y6l1Kef4OJEJkQ5TMVw.png" /><figcaption>Fig 5. A Bridge in a time of need.</figcaption></figure><p>The routing table attached to the Public Subnet will route traffic to and from our new ENI attached to our DB server. It will show up as ETH1 on the instance and in the AWS Console / API. The Security Group will allow ports tcp/22 and tcp/3306 to be accessed by a specific system or IP grouping of systems. The EIP atached to the ENI will be the target for our remote administrators. When there is no need for the interface to be active, we can disattach it from the DB instance. We could also give the DB or SA teams specific permissions in the AWS platform that would let them attach it when needed, or use a script to bring it online.</p><p>This is a pretty simple use case, for a condition that comes up more often than you’d think. I’d like the stress that the best way to handle this is to have a Direct Connect (DX) or a Virtual Private Network (VPN) into the VPC to support privileged and/or trusted connections. That said, every situation and customer is a unique snowflake, and this “Management ENI” technique is infinitely better than just tossing your DB servers into a public subnet.</p><p>Now, if you all don’t mind, I’m going to go find another cup of coffee to keep away Jet lag Gremlins.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f0335e11d0f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>