<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Cloud on Technology Enlightened</title>
    <link>https://pprakash.me/tags/cloud/</link>
    <description>Recent content in Cloud on Technology Enlightened</description>
    <generator>Hugo</generator>
    <language>en</language>
    <copyright>&amp;copy; &lt;a href=&#34;https://github.com/p-prakash/&#34;&gt;Prakash P&lt;/a&gt; 2015 - 2023</copyright>
    <lastBuildDate>Thu, 06 Sep 2018 07:55:46 +0000</lastBuildDate>
    <atom:link href="https://pprakash.me/tags/cloud/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Running AWS Glue jobs connecting to database in VPC with Custom DNS</title>
      <link>https://pprakash.me/tech/2018/09/06/running-aws-glue-jobs-connecting-to-database-in-vpc-with-custom-dns/</link>
      <pubDate>Thu, 06 Sep 2018 07:55:46 +0000</pubDate>
      <guid>https://pprakash.me/tech/2018/09/06/running-aws-glue-jobs-connecting-to-database-in-vpc-with-custom-dns/</guid>
      <description>&lt;p&gt;AWS Glue is a fully managed ETL service that makes it simple and cost-effective to categorize your data, clean it, enrich it, and move it reliably between various data stores. Glue job is the business logic that automate the extract, transform, and transfer data to different locations.&lt;/p&gt;&#xA;&lt;p&gt;Glue job creates a Hadoop task in the backend and since it uses Hadoop ecosystem all the nodes in the cluster must be able to find using the FQDN and communicate with each other. To satisfy Hadoop DNS lookup, both forward and reverse lookups must succeed. When you use the default DHCP option set with AmazonProvidedDNS, it automatically creates the DNS record for the nodes that’s getting created in the VPC.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Monitor AWS Trusted Advisor Checks</title>
      <link>https://pprakash.me/tech/2017/03/14/monitor-aws-trusted-advisor-checks/</link>
      <pubDate>Tue, 14 Mar 2017 17:39:24 +0000</pubDate>
      <guid>https://pprakash.me/tech/2017/03/14/monitor-aws-trusted-advisor-checks/</guid>
      <description>&lt;p&gt;AWS Trusted Advisor is an important tool which provides more than 50 checks across four different categories Cost Optimization, Performance, Security &amp;amp; Fault Tolerance (at the moment of writing this post).&lt;/p&gt;&#xA;&lt;p&gt;But I have noticed that this is not being used more extensively considering the importance of it. Hence I created couple of lambda functions which shall be configured to run on daily basis to refresh the checks and create summary of all the checks and send an email.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Scheduling automated EBS snapshots serverless using AWS Lambda</title>
      <link>https://pprakash.me/tech/2016/06/09/automated-ebs-snapshots/</link>
      <pubDate>Thu, 09 Jun 2016 11:46:37 +0000</pubDate>
      <guid>https://pprakash.me/tech/2016/06/09/automated-ebs-snapshots/</guid>
      <description>&lt;p&gt;EBS snapshot as backup mechanism is a very common practice and it also has been defined in &lt;a href=&#34;http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-best-practices.html&#34;&gt;Backup and Recovery&lt;/a&gt; section of EC2 best practices. If you have read my another article &lt;a href=&#34;https://pprakash.me/tech/2015/11/15/save-aws-costs-by-scheduled-start-and-stop-of-ec2-instances/&#34;&gt;Save AWS costs by scheduled start and stop of EC2 instances&lt;/a&gt;, similar approach will be used in creating Snapshots too.&lt;/p&gt;&#xA;&lt;p&gt;Using JSON in EC2 Tags enables us to provide granular configuration details. Create an EC2 tag with name as &lt;em&gt;backup&lt;/em&gt; and value with details containing time to take backup and retention period. Obtaining these details from Tags will enable us to configure different schedule &amp;amp; retention period for different EC2 instance. If no backup is needed on a particular day, that day shall be removed from the value.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Sync S3 bucket to multiple S3 buckets in different region</title>
      <link>https://pprakash.me/tech/2016/05/27/sync-s3-bucket-to-multiple-different-s3-buckets/</link>
      <pubDate>Fri, 27 May 2016 11:55:41 +0000</pubDate>
      <guid>https://pprakash.me/tech/2016/05/27/sync-s3-bucket-to-multiple-different-s3-buckets/</guid>
      <description>&lt;p&gt;&lt;a href=&#34;https://aws.amazon.com/blogs/aws/new-cross-region-replication-for-amazon-s3/&#34;&gt;Cross-Region Replication for Amazon S3&lt;/a&gt; was introduced last year which enables replicating objects from a S3 bucket to a different S3 bucket located in different region (it can be same/different AWS account). It’s one of the most sought after feature for long time but it doesn’t solve some of the scenarios as defined below.&lt;/p&gt;&#xA;&lt;ul&gt;&#xA;&lt;li&gt;Synchronizing to a bucket in same region.&lt;/li&gt;&#xA;&lt;li&gt;Synchronizing to multiple destination buckets.&lt;/li&gt;&#xA;&lt;li&gt;Object ACLs needs to be set at the source bucket hence multiple different ACLs needs to be set when copying across different accounts.&lt;/li&gt;&#xA;&lt;li&gt;Replication doesn’t change the ownership of the objects hence bucket policy applied at the destination bucket won’t be honored.&lt;/li&gt;&#xA;&lt;/ul&gt;&#xA;&lt;p&gt;Refer the feedback from AWS support team regarding the last point mentioned above.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Running IIS in Windows Docker Container in Amazon EC2</title>
      <link>https://pprakash.me/tech/2016/05/15/running-iis-in-windows-docker-container-in-amazon-ec2/</link>
      <pubDate>Sun, 15 May 2016 15:53:17 +0000</pubDate>
      <guid>https://pprakash.me/tech/2016/05/15/running-iis-in-windows-docker-container-in-amazon-ec2/</guid>
      <description>&lt;p&gt;Windows Server 2016 Technical Preview 5 was released on &lt;a href=&#34;https://technet.microsoft.com/en-us/library/dn765472(v=ws.12).aspx&#34;&gt;27th April 2016&lt;/a&gt; &amp;amp; it&amp;rsquo;s well known by now that it supports docker with its &lt;a href=&#34;https://www.docker.com/microsoft&#34;&gt;windows server containers&lt;/a&gt;. Microsoft also started uploading windows server core with various application as docker images to &lt;a href=&#34;https://hub.docker.com/u/microsoft/?page=1&#34;&gt;docker hub&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;I was wondering whether it’s possible to run Windows 2016 TP5 on an EC2 instance and launch a windows container inside the EC2 instance. EC2 officially supports only upto Windows 2012 R2 and I couldn’t find any 2016 AMI’s in Ireland region. Hence I decided to install Windows 2016 TP5 on local VirtualBox, upload it to S3 create AMI out of it and launch the EC2 instance.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Using AWS IoT button - Simple Example</title>
      <link>https://pprakash.me/tech/2016/05/14/using-aws-iot-button-simple-example/</link>
      <pubDate>Sat, 14 May 2016 17:32:27 +0000</pubDate>
      <guid>https://pprakash.me/tech/2016/05/14/using-aws-iot-button-simple-example/</guid>
      <description>&lt;p&gt;Amazon did a limited release of the &lt;a href=&#34;https://aws.amazon.com/iot/button/&#34;&gt;programmable Dash button&lt;/a&gt; and unsurprisingly it got &lt;a href=&#34;http://mashable.com/2016/05/13/amazon-dash-custom/#n0NCZ5flsSqG&#34;&gt;sold out within a day&lt;/a&gt;. It&amp;rsquo;s stated in amazon.com that &amp;ldquo;&lt;a href=&#34;http://www.amazon.com/AWS-IoT-Button-Limited-Programmable/dp/B01C7WE5WM&#34;&gt;We don&amp;rsquo;t know when or if this item will be back in stock.&lt;/a&gt;&amp;rdquo;, hence you might need to wait to get one.&lt;/p&gt;&#xA;&lt;p&gt;I take this opportunity to write a post about how I used the AWS IoT button that I received in AWS re:Invent 2015 to show case AWS IoT to the team.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Sending response back to CFN custom resource from python Lambda function</title>
      <link>https://pprakash.me/tech/2015/12/20/sending-response-back-to-cfn-custom-resource-from-python-lambda-function/</link>
      <pubDate>Sun, 20 Dec 2015 06:00:56 +0000</pubDate>
      <guid>https://pprakash.me/tech/2015/12/20/sending-response-back-to-cfn-custom-resource-from-python-lambda-function/</guid>
      <description>&lt;p&gt;CloudFormation uses a pre-signed S3 URL to receive the response back from the custom resources managed by it. There are few blue prints available for Node.js Lambda custom resources but nothing available for python yet. Hence I created this simple function which shall be used to send the response back to CFN custom resource by performing PUT request to the pre-signed S3 URL.&lt;/p&gt;&#xA;&lt;div class=&#34;highlight&#34;&gt;&lt;pre tabindex=&#34;0&#34; style=&#34;color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;&#34;&gt;&lt;code class=&#34;language-python&#34; data-lang=&#34;python&#34;&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; json&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#f92672&#34;&gt;import&lt;/span&gt; requests&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;def&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;lambda_handler&lt;/span&gt;(event, context):&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    responseStatus &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;SUCCESS&amp;#39;&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    responseData &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; {}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; event[&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;RequestType&amp;#39;&lt;/span&gt;] &lt;span style=&#34;color:#f92672&#34;&gt;==&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Delete&amp;#39;&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        sendResponse(event, context, responseStatus, responseData)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    responseData &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; {&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Success&amp;#39;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Test Passed.&amp;#39;&lt;/span&gt;}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    sendResponse(event, context, responseStatus, responseData)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;def&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;sendResponse&lt;/span&gt;(event, context, responseStatus, responseData):&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    responseBody &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; {&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Status&amp;#39;&lt;/span&gt;: responseStatus,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                    &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Reason&amp;#39;&lt;/span&gt;: &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;See the details in CloudWatch Log Stream: &amp;#39;&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;+&lt;/span&gt; context&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;log_stream_name,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                    &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;PhysicalResourceId&amp;#39;&lt;/span&gt;: context&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;log_stream_name,&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                    &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;StackId&amp;#39;&lt;/span&gt;: event[&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;StackId&amp;#39;&lt;/span&gt;],&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                    &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;RequestId&amp;#39;&lt;/span&gt;: event[&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;RequestId&amp;#39;&lt;/span&gt;],&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                    &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;LogicalResourceId&amp;#39;&lt;/span&gt;: event[&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;LogicalResourceId&amp;#39;&lt;/span&gt;],&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;                    &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Data&amp;#39;&lt;/span&gt;: responseData}&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    print &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;RESPONSE BODY:n&amp;#39;&lt;/span&gt; &lt;span style=&#34;color:#f92672&#34;&gt;+&lt;/span&gt; json&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;dumps(responseBody)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;try&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        req &lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt; requests&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;put(event[&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;ResponseURL&amp;#39;&lt;/span&gt;], data&lt;span style=&#34;color:#f92672&#34;&gt;=&lt;/span&gt;json&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;dumps(responseBody))&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; req&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;status_code &lt;span style=&#34;color:#f92672&#34;&gt;!=&lt;/span&gt; &lt;span style=&#34;color:#ae81ff&#34;&gt;200&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            print req&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;text&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;            &lt;span style=&#34;color:#66d9ef&#34;&gt;raise&lt;/span&gt; &lt;span style=&#34;color:#a6e22e&#34;&gt;Exception&lt;/span&gt;(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;Recieved non 200 response while sending response to CFN.&amp;#39;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#66d9ef&#34;&gt;return&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    &lt;span style=&#34;color:#66d9ef&#34;&gt;except&lt;/span&gt; requests&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;exceptions&lt;span style=&#34;color:#f92672&#34;&gt;.&lt;/span&gt;RequestException &lt;span style=&#34;color:#66d9ef&#34;&gt;as&lt;/span&gt; e:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        print e&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;        &lt;span style=&#34;color:#66d9ef&#34;&gt;raise&lt;/span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;&lt;span style=&#34;color:#66d9ef&#34;&gt;if&lt;/span&gt; __name__ &lt;span style=&#34;color:#f92672&#34;&gt;==&lt;/span&gt; &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;__main__&amp;#39;&lt;/span&gt;:&#xA;&lt;/span&gt;&lt;/span&gt;&lt;span style=&#34;display:flex;&#34;&gt;&lt;span&gt;    lambda_handler(&lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;event&amp;#39;&lt;/span&gt;, &lt;span style=&#34;color:#e6db74&#34;&gt;&amp;#39;handler&amp;#39;&lt;/span&gt;)&#xA;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;I&amp;rsquo;m using json module to form the response body, json module is available by default in the Lambda container. Whereas the requests module which I use to perform the http PUT request needs to be packaged along with the python script.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Continuous Integration - Manage shared resources across accounts automatically</title>
      <link>https://pprakash.me/2015/12/07/continuous-integration-manage-shared-resources-across-accounts-automatically/</link>
      <pubDate>Mon, 07 Dec 2015 18:28:16 +0000</pubDate>
      <guid>https://pprakash.me/2015/12/07/continuous-integration-manage-shared-resources-across-accounts-automatically/</guid>
      <description>&lt;p&gt;I prefer creating the base &lt;a href=&#34;http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/sharing-amis.html&#34;&gt;AMI&lt;/a&gt; using &lt;a href=&#34;https://www.packer.io/&#34;&gt;packer&lt;/a&gt;; &lt;a href=&#34;http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ShareSnapshot.html&#34;&gt;RDS snapshot&lt;/a&gt; using a Jenkins job which get triggered whenever there is a change in the database schema in the SCM. In case of installers, binaries, etc. it would be best to store them in a single &lt;a href=&#34;http://docs.aws.amazon.com/AmazonS3/latest/dev/using-iam-policies.html&#34;&gt;S3 bucket&lt;/a&gt;.&lt;/p&gt;&#xA;&lt;p&gt;In all the above mentioned scenarios I prefer to share those resources to a 3rd party AWS account and remove the share when not needed. Automating this would be easy to handle add/remove permissions, hence I decided to hold the sharing details in a JSON file in the SCM. Changes to that file will trigger a Jenkins job which will invoke a Lambda function which in turn will share the resources based on the values in the JSON file.&lt;/p&gt;</description>
    </item>
    <item>
      <title>CloudFormation parameters grouping and labelling</title>
      <link>https://pprakash.me/tech/2015/12/06/cloudformation-parameters-grouping-and-labelling/</link>
      <pubDate>Sun, 06 Dec 2015 07:16:52 +0000</pubDate>
      <guid>https://pprakash.me/tech/2015/12/06/cloudformation-parameters-grouping-and-labelling/</guid>
      <description>&lt;p&gt;Last week AWS &lt;a href=&#34;https://aws.amazon.com/about-aws/whats-new/2015/12/aws-cloudformation-adds-support-for-aws-codepipeline-aws-config-and-more/&#34;&gt;enhanced CloudFormation&lt;/a&gt; by adding new services like AWS CodePipeline, AWS Config, AWS KMS and few more; default stack limit also has been increased from 20 to 200. Among other new features they also have introduced this small but useful &lt;a href=&#34;http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-cloudformation-interface.html&#34;&gt;parameters grouping and labelling&lt;/a&gt; feature.&lt;/p&gt;&#xA;&lt;p&gt;Earlier all the parameters in a CFN template get listed in alphabetical order based on the logical name of the parameter. Also the parameters logical name is restricted to alphanumeric characters hence it causes some restrictions.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
