<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>cloudwatch Archives | Cloudar</title>
	<atom:link href="https://cloudar.be/tag/cloudwatch/feed/" rel="self" type="application/rss+xml" />
	<link>https://cloudar.be/tag/cloudwatch/</link>
	<description>100% Focus On AWS // 100% Customer Obsession</description>
	<lastBuildDate>Mon, 23 Mar 2020 12:17:59 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>
	<item>
		<title>Let&#8217;s trash talk!</title>
		<link>https://cloudar.be/awsblog/lets-trash-talk/</link>
		
		<dc:creator><![CDATA[Michiel Vanderlinden]]></dc:creator>
		<pubDate>Mon, 23 Mar 2020 12:17:59 +0000</pubDate>
				<category><![CDATA[AWS Blog]]></category>
		<category><![CDATA[AWS]]></category>
		<category><![CDATA[cloudformation]]></category>
		<category><![CDATA[cloudwatch]]></category>
		<category><![CDATA[Lambda]]></category>
		<category><![CDATA[SAM]]></category>
		<category><![CDATA[sns]]></category>
		<guid isPermaLink="false">https://www.cloudar.be/?p=16571</guid>

					<description><![CDATA[<p>Hi all, in this blogpost I will give a brief overview of how I used AWS to remind me to take out the trash. It’s a familiar scene: as you’re waking up or making your morning coffee, you hear the garbage truck roaring away outside when you suddenly realize your garbage bags are still rotting [&#8230;]</p>
<p>The post <a href="https://cloudar.be/awsblog/lets-trash-talk/">Let&#8217;s trash talk!</a> appeared first on <a href="https://cloudar.be">Cloudar</a>.</p>
]]></description>
										<content:encoded><![CDATA[<p>Hi all, in this blogpost I will give a brief overview of how I used AWS to remind me to take out the trash.</p>
<p>It’s a familiar scene: as you’re waking up or making your morning coffee, you hear the garbage truck roaring away outside when you suddenly realize your garbage bags are still rotting away in the garage. Do you run after the truck like a lunatic, even though it’s too late (of course I’ve never done this, but I’ve heard it’s a thing)? Or do you just let it go and let the garbage fester even longer? Either way, it’s a frustrating start to the day.</p>
<p>Luckily for me I live in the modern and very civilised province of Limburg of Belgium where the local government has made a website available with a downloadable calendar showing all dates the garbage truck comes along: so handy! They even provide the calendar in a number of digital formats, including iCal. I could just import this into my phone and set an alert on it, but where’s the fun in that? After some fiddling around or “reverse engineering” as they call it, I found out that the data for the calendar files was provided by an undocumented but publicly available API.</p>
<p>Being the sucker for coding up and fooling around with APIs that I am (and given my state of utter boredom while under full lockdown in Belgium) I decided to code up a project based on this API that would send me an SMS notification the evening before garbage collection. Because that’s my idea of fun. And that way I would be reminded to take out the trash on time and keep my garage clean.</p>
<p>Want to know this neat trick to save you from rubbish resentment? Read on!</p>
<p><img fetchpriority="high" decoding="async" class="alignnone size-medium wp-image-16575" src="https://cloudar.be/wp-content/uploads/2020/03/1-650x433.png" alt="reverseengineering" width="650" height="433" srcset="https://cloudar.be/wp-content/uploads/2020/03/1-650x433.png 650w, https://cloudar.be/wp-content/uploads/2020/03/1-1300x867.png 1300w, https://cloudar.be/wp-content/uploads/2020/03/1-325x217.png 325w" sizes="(max-width: 650px) 100vw, 650px" /></p>
<p>So for this project I partly used the AWS SAM framework and set up a CodePipeline to deploy my code changes instantly on AWS (stay tuned for a future blogpost on this).</p>
<p><img decoding="async" class="alignnone wp-image-16578 size-thumbnail" src="https://cloudar.be/wp-content/uploads/2020/03/pipeline-325x217.png" alt="codepipeline" width="325" height="217" srcset="https://cloudar.be/wp-content/uploads/2020/03/pipeline-325x217.png 325w, https://cloudar.be/wp-content/uploads/2020/03/pipeline-650x433.png 650w" sizes="(max-width: 325px) 100vw, 325px" /></p>
<p>First let’s code up the AWS SAM template file containing the necessary resources for this project.</p>
<p>The resources I used are:</p>
<ul>
<li>Type: AWS::Events::Rule<br />
A Cloudwatch event rule to invoke a lambda each evening around 8.</li>
<li>Type: AWS::Lambda::Permission<br />
To give the Cloudwatch event rule permissions to invoke the lambda.</li>
<li>Type: AWS::Logs::LogGroup<br />
A log group for the lambda logs.</li>
<li>Type: AWS::Serverless::Function<br />
The lambda that will run the show.</li>
<li>Type: AWS::IAM::Role<br />
An IAM role for the lambda to have the necessary rights like accessing SNS for the SMS notification.</li>
</ul>
<p><img decoding="async" class="alignnone size-medium wp-image-16579" src="https://cloudar.be/wp-content/uploads/2020/03/template-650x433.png" alt="template" width="650" height="433" srcset="https://cloudar.be/wp-content/uploads/2020/03/template-650x433.png 650w, https://cloudar.be/wp-content/uploads/2020/03/template-325x217.png 325w" sizes="(max-width: 650px) 100vw, 650px" /></p>
<p>Next we code up the lambda that will call the API and send us an SMS.</p>
<p><img loading="lazy" decoding="async" class="alignnone size-medium wp-image-16580" src="https://cloudar.be/wp-content/uploads/2020/03/code-650x433.png" alt="code" width="650" height="433" srcset="https://cloudar.be/wp-content/uploads/2020/03/code-650x433.png 650w, https://cloudar.be/wp-content/uploads/2020/03/code-1300x867.png 1300w, https://cloudar.be/wp-content/uploads/2020/03/code-325x217.png 325w" sizes="auto, (max-width: 650px) 100vw, 650px" /></p>
<p>The API provides event data for each month by just requesting the year and month in the url path like this ‘/2020-03’. So we can easily get the data for the current month and loop through its events, checking whether any are occurring the next morning. If so we receive an SMS notifying us (note that you can provide the number of your girlfriend here, but it’s not recommended as I have found out it isn’t that effective).</p>
<p><img loading="lazy" decoding="async" class="alignnone wp-image-16581 size-thumbnail" src="https://cloudar.be/wp-content/uploads/2020/03/watch-325x217.jpg" alt="result" width="325" height="217" srcset="https://cloudar.be/wp-content/uploads/2020/03/watch-325x217.jpg 325w, https://cloudar.be/wp-content/uploads/2020/03/watch-650x433.jpg 650w, https://cloudar.be/wp-content/uploads/2020/03/watch-1300x867.jpg 1300w" sizes="auto, (max-width: 325px) 100vw, 325px" /></p>
<p>And that’s all folks!</p>
<p>&nbsp;</p>
<p>I’m aware that this trick is no rocket science, and that this isn’t even a full guide to get to the same result (leave a comment if you want some more details), but I thought it would be fun to share how I resolved one of life’s little problems using AWS.</p>
<p>As I’m moving toward two years of professional experience using the platform, I’m still amazed at how easily you can code some services together and create a working, scalable and highly available project in a matter of minutes or hours.</p>
<p>Hope you liked my trashy tale &#8211; keep your garages clean and your heads in the cloud!</p>
<p>The post <a href="https://cloudar.be/awsblog/lets-trash-talk/">Let&#8217;s trash talk!</a> appeared first on <a href="https://cloudar.be">Cloudar</a>.</p>
]]></content:encoded>
					
		
		
			</item>
	</channel>
</rss>
