<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Blog on Mysterious Code - The AWS infrastructure team for companies without one</title><link>https://mysteriouscode.com/blog/</link><description>Recent content in Blog on Mysterious Code - The AWS infrastructure team for companies without one</description><generator>Hugo</generator><language>en-gb</language><lastBuildDate>Thu, 22 Oct 2026 06:00:00 +0000</lastBuildDate><atom:link href="https://mysteriouscode.com/blog/index.xml" rel="self" type="application/rss+xml"/><item><title>On the Beyond Co-Sell podcast: co-sell from the boutique side</title><link>https://mysteriouscode.com/blog/on-the-beyond-co-sell-podcast-co-sell-from-the-boutique-side/</link><pubDate>Thu, 22 Oct 2026 06:00:00 +0000</pubDate><guid>https://mysteriouscode.com/blog/on-the-beyond-co-sell-podcast-co-sell-from-the-boutique-side/</guid><description>&lt;p&gt;Our founder, Paulina Budzoń, joined Andrew Morris on &lt;a href="https://www.youtube.com/@beyondcosell"&gt;Beyond Co-Sell&lt;/a&gt;,&#10;a podcast about the people and machinery behind AWS partnerships. Most of its guests run alliances at&#10;software companies. This episode is the view from a boutique services partner: how we use the AWS partner&#10;programme, what we hand to a machine, and where our customers actually come from.&lt;/p&gt;</description></item><item><title>Enable Amazon ECS event capture with CloudFormation</title><link>https://mysteriouscode.com/blog/enable-amazon-ecs-event-capture-with-cloudformation/</link><pubDate>Wed, 02 Sep 2026 13:00:00 +0000</pubDate><guid>https://mysteriouscode.com/blog/enable-amazon-ecs-event-capture-with-cloudformation/</guid><description>&lt;p&gt;The Amazon ECS console has an&#10;&lt;a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-lifecycle-events.html"&gt;Event history&lt;/a&gt; tab&#10;on every cluster. It shows the events ECS generated for that cluster (task state changes, service actions,&#10;deployment state changes) for as long as you choose to keep them, instead of the last 100 events or the one&#10;hour ECS keeps stopped tasks for. It&amp;rsquo;s a useful troubleshooting tool. &lt;strong&gt;The catch is how you turn it on: a&#10;&amp;ldquo;Turn on event capture&amp;rdquo; button in the console, which you need to press separately for every cluster. There&amp;rsquo;s&#10;no API call, no CLI command and no CloudFormation resource for it.&lt;/strong&gt; You can create the underlying resources&#10;yourself, and events do get captured, but the console still tells you event capture isn&amp;rsquo;t configured. The&#10;reason is the name of the EventBridge rule. This post explains what the console checks for and shares a small&#10;CloudFormation custom resource that computes that name for you.&lt;/p&gt;</description></item><item><title>Enable Amazon ECS Action Logs with CloudFormation</title><link>https://mysteriouscode.com/blog/enable-amazon-ecs-action-logs-with-cloudformation/</link><pubDate>Tue, 01 Sep 2026 06:00:00 +0000</pubDate><guid>https://mysteriouscode.com/blog/enable-amazon-ecs-action-logs-with-cloudformation/</guid><description>&lt;p&gt;Amazon ECS has a new observability feature:&#10;&lt;a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/action-logs.html"&gt;Action Logs&lt;/a&gt;, released in&#10;&lt;a href="https://aws.amazon.com/about-aws/whats-new/2026/07/amazon-ecs-action-logs/"&gt;July 2026&lt;/a&gt;. They record every&#10;action ECS takes on your behalf during service deployments and Managed Daemon operations, and deliver&#10;those records to CloudWatch Logs, Amazon S3 or Amazon Data Firehose. The documentation shows how to&#10;enable them in the console and through the API, but there&amp;rsquo;s no infrastructure-as-code example. This post&#10;fills that gap with a CloudFormation template. It also flags a value the documentation currently gets&#10;wrong.&lt;/p&gt;</description></item><item><title>ECS deployments that fail safely: the configuration we ship</title><link>https://mysteriouscode.com/blog/ecs-deployments-that-fail-safely-the-configuration-we-ship/</link><pubDate>Tue, 25 Aug 2026 06:00:00 +0000</pubDate><guid>https://mysteriouscode.com/blog/ecs-deployments-that-fail-safely-the-configuration-we-ship/</guid><description>&lt;p&gt;Eight posts ago we built a small test stack to answer one question: how do ECS deployments and&#10;CloudFormation actually behave together, underneath what the documentation says? The answer turned out to&#10;be mostly reassuring and occasionally alarming, and the alarming parts share a theme. &lt;strong&gt;An ECS deployment&#10;with default settings doesn&amp;rsquo;t fail loudly. It fails silently, succeeds falsely, or hangs invisibly.&lt;/strong&gt;&#10;This closing part collects everything in one place: the catalogue of silent failures the series found,&#10;the CloudFormation configuration we ship to close them, the pipeline rules the template can&amp;rsquo;t&#10;express, and one last measurement that makes new services cheaper to add than we expected.&lt;/p&gt;</description></item><item><title>One stack update, three ECS services: who rolls back what</title><link>https://mysteriouscode.com/blog/one-stack-update-three-ecs-services-who-rolls-back-what/</link><pubDate>Sun, 23 Aug 2026 08:00:00 +0000</pubDate><guid>https://mysteriouscode.com/blog/one-stack-update-three-ecs-services-who-rolls-back-what/</guid><description>&lt;p&gt;Every failure in this series so far happened to one service at a time. Real stacks don&amp;rsquo;t deploy like&#10;that. A typical application template carries a web service, a worker fleet and a singleton, and one&#10;CloudFormation stack update moves all of them together. That opens questions the single-service tests&#10;can&amp;rsquo;t answer. If the web deployment fails, what happens to workers that already finished? If a worker&#10;fails while the web service is mid blue/green, who backs out first? So we ran the combinations, and two&#10;findings stand out. When one service fails, CloudFormation rolls the healthy ones back too, each with a&#10;full backward deployment. And the update where all three services failed at once was the easiest one to&#10;recover from.&lt;/p&gt;</description></item><item><title>ECS container health checks: catching alive-but-sick services</title><link>https://mysteriouscode.com/blog/ecs-container-health-checks-catching-alive-but-sick-services/</link><pubDate>Wed, 12 Aug 2026 09:00:00 +0000</pubDate><guid>https://mysteriouscode.com/blog/ecs-container-health-checks-catching-alive-but-sick-services/</guid><description>&lt;p&gt;A container health check is four lines of task definition, and on most services it looks like paperwork.&#10;The load balancer already checks the web tasks. A container that crashes already fails its own deployment.&#10;So many people never bother with them, and we often skipped them too, until a release that started,&#10;stayed up and did nothing useful was&#10;&lt;a href="https://mysteriouscode.com/blog/the-deployment-that-lied-ecs-singletons-and-false-success/"&gt;marked successful by every layer&lt;/a&gt;.&#10;The obvious follow-up question was which of our other services would fail the same way. The answer turned&#10;out to be all of them. This post covers what a container health check costs, what it catches on each&#10;type of service, and the one place where it does noticeably less than you would expect.&lt;/p&gt;</description></item><item><title>The deployment that lied: ECS singletons and false success</title><link>https://mysteriouscode.com/blog/the-deployment-that-lied-ecs-singletons-and-false-success/</link><pubDate>Mon, 10 Aug 2026 08:00:00 +0000</pubDate><guid>https://mysteriouscode.com/blog/the-deployment-that-lied-ecs-singletons-and-false-success/</guid><description>&lt;p&gt;We deployed a container that exits with code 1 five seconds after it starts. Not a subtle failure - the process dies almost immediately, every time. ECS marked the deployment &lt;code&gt;SUCCESSFUL&lt;/code&gt;. The service events said &amp;ldquo;reached a steady state&amp;rdquo;, &lt;strong&gt;twice&lt;/strong&gt;. CloudFormation took the stack to &lt;code&gt;UPDATE_COMPLETE&lt;/code&gt; in 4 minutes 36 seconds, a perfectly ordinary time for this service. Every layer a pipeline could check said the release went out cleanly. Meanwhile the service was down before the first new task launched, and it stayed down, relaunching a dead container roughly every 50 seconds, indefinitely. Nothing was going to notice. This post is the story of that deployment: why it&amp;rsquo;s in-contract behaviour rather than a bug, and the configuration that closes the gap.&lt;/p&gt;</description></item><item><title>ECS deployment alarms: the fine print</title><link>https://mysteriouscode.com/blog/ecs-deployment-alarms-the-fine-print/</link><pubDate>Fri, 07 Aug 2026 08:00:00 +0000</pubDate><guid>https://mysteriouscode.com/blog/ecs-deployment-alarms-the-fine-print/</guid><description>&lt;p&gt;Deployment alarms are the easiest of the ECS failure detectors to describe. You name some CloudWatch&#10;alarms on the service, and if one goes into &lt;code&gt;ALARM&lt;/code&gt; during a deployment, ECS fails that deployment and&#10;rolls it back. We ran that path repeatedly against both a blue/green service and a rolling one, and the&#10;mechanism was never the interesting part. What matters is how late the alarm arrives, what a quiet metric&#10;does to it afterwards, and the documented behaviour that switches monitoring off at the worst (or best?) possible&#10;moment. Every number below comes from a measured run (July 2026, eu-west-1).&lt;/p&gt;</description></item><item><title>ECS circuit breaker and CloudFormation: who owns the rollback</title><link>https://mysteriouscode.com/blog/ecs-circuit-breaker-and-cloudformation-who-owns-the-rollback/</link><pubDate>Wed, 05 Aug 2026 09:00:00 +0000</pubDate><guid>https://mysteriouscode.com/blog/ecs-circuit-breaker-and-cloudformation-who-owns-the-rollback/</guid><description>&lt;p&gt;This post is about the question that started the whole series: when an ECS deployment fails while CloudFormation&#10;is driving, who puts things back - ECS, CloudFormation, or both, one after the other? We had once watched a service&#10;roll back twice in a row on another stack, every task replaced once by ECS and then again by CloudFormation, and that&#10;fear is why we built the test stack. Nothing in the AWS documentation says what happens to a service resource when&#10;ECS rolls a deployment back in the middle of a stack update. So we measured it: deployments where the new tasks&#10;never come good, first with no failure detector at all, then with the circuit breaker in both of its modes, on both&#10;deployment strategies. Every number below comes from a measured run (July 2026, eu-west-1).&lt;/p&gt;</description></item><item><title>ECS rolling deployments: what "done" actually means</title><link>https://mysteriouscode.com/blog/ecs-rolling-deployments-what-done-actually-means/</link><pubDate>Mon, 03 Aug 2026 08:00:00 +0000</pubDate><guid>https://mysteriouscode.com/blog/ecs-rolling-deployments-what-done-actually-means/</guid><description>&lt;p&gt;Rolling is the ECS deployment strategy most people start with, and the one everyone assumes they already&#10;understand. Old tasks out, new tasks in, two percentages to control the pace. The percentages are documented&#10;properly. What the documentation never actually defines is when a rolling deployment is &lt;em&gt;done&lt;/em&gt;. Three separate&#10;layers each declare completion at their own moment (the deployment record, the service&amp;rsquo;s own events, and the&#10;CloudFormation resource), and on an update they disagree by well over a minute. We measured where each one&#10;lands, on two very different rolling services, and this post is what came out of it.&lt;/p&gt;</description></item><item><title>ECS pause hooks: a real smoke test phase, and where they do nothing</title><link>https://mysteriouscode.com/blog/ecs-pause-hooks-a-real-smoke-test-phase-and-where-they-do-nothing/</link><pubDate>Fri, 31 Jul 2026 09:00:00 +0000</pubDate><guid>https://mysteriouscode.com/blog/ecs-pause-hooks-a-real-smoke-test-phase-and-where-they-do-nothing/</guid><description>&lt;p&gt;When we measured a full ECS blue/green deployment in&#10;&lt;a href="https://mysteriouscode.com/blog/ecs-native-blue-green-deployments-with-cloudformation-how-it-actually-works/"&gt;the first post of this series&lt;/a&gt;,&#10;one number stood out: 28 seconds. That&amp;rsquo;s how long the new revision sits on the test listener&#10;before production traffic shifts to it, and it&amp;rsquo;s the only period in which a smoke test could&#10;stop a bad release before users see it. No realistic test suite fits in that time. Pause hooks are the fix.&#10;Announced in &lt;a href="https://aws.amazon.com/about-aws/whats-new/2026/05/amazon-ecs-pause-continue-deployments/"&gt;May 2026&lt;/a&gt;,&#10;they make the deployment stop at a stage you choose and wait for you, turning those 28 seconds&#10;into a smoke test phase of whatever length you need. Third-party coverage of the feature is&#10;still close to zero, so we measured the whole workflow on our test stack: the continue path,&#10;the rollback path, an alarm firing mid-pause, and one case where the hook is accepted and then&#10;does nothing at all. Every number below comes from a measured run (July 2026, eu-west-1).&lt;/p&gt;</description></item><item><title>ECS native blue/green deployments with CloudFormation: how it actually works</title><link>https://mysteriouscode.com/blog/ecs-native-blue-green-deployments-with-cloudformation-how-it-actually-works/</link><pubDate>Mon, 27 Jul 2026 08:00:00 +0000</pubDate><guid>https://mysteriouscode.com/blog/ecs-native-blue-green-deployments-with-cloudformation-how-it-actually-works/</guid><description>&lt;p&gt;In July 2025, ECS introduced a &lt;a href="https://docs.aws.amazon.com/AmazonECS/latest/developerguide/deployment-type-blue-green.html"&gt;native blue/green deployment type&lt;/a&gt;&#10;comprising two target groups, a test listener, a bake period and managed rollback, all of which are run by ECS itself&#10;with no involvement from CodeDeploy. The documentation covers the ideal scenario. However, it says much less about how&#10;the feature behaves with CloudFormation on top, such as where &lt;code&gt;UPDATE_COMPLETE&lt;/code&gt;&#10;lands relative to the bake, how long each stage really takes and whether stack updates end up conflicting with the&#10;listener rules that the feature rewrites. We built a small test stack and ran the machinery repeatedly, documenting&#10;everything. This post opens a series on how ECS deployment strategies behave when driven by CloudFormation - every&#10;number in it comes from a measured run.&lt;/p&gt;</description></item><item><title>Composer's HTTP/2 400 failures from codeload.github.com in CI</title><link>https://mysteriouscode.com/blog/composer-http2-400-from-codeload-in-ci/</link><pubDate>Mon, 29 Jun 2026 09:00:00 +0000</pubDate><guid>https://mysteriouscode.com/blog/composer-http2-400-from-codeload-in-ci/</guid><description>&lt;p&gt;We hit a frustrating issue recently while building PHP images in AWS CodeBuild: &lt;code&gt;composer install&lt;/code&gt;&#10;started failing, often, with an &lt;code&gt;HTTP/2 400&lt;/code&gt; from &lt;code&gt;codeload.github.com&lt;/code&gt; while downloading a package&#10;archive. The package that failed changed from run to run, and the &lt;em&gt;same&lt;/em&gt; Dockerfile and&#10;&lt;code&gt;composer.lock&lt;/code&gt; that broke in one pipeline built cleanly in another. The short version is that this&#10;is GitHub wobbling rather than anything wrong in your project, that the same failure has come and&#10;gone for years, and that the usual environment-variable fixes only take the edge off. If your&#10;deployments run &lt;code&gt;composer install&lt;/code&gt;, here is what is actually going on and how to stop it taking your&#10;builds down.&lt;/p&gt;</description></item><item><title>How to validate a CloudFormation template (CLI and cfn-lint)</title><link>https://mysteriouscode.com/blog/how-to-validate-cloudformation-template-with-aws-cli/</link><pubDate>Sun, 28 Jun 2026 09:00:00 +0000</pubDate><guid>https://mysteriouscode.com/blog/how-to-validate-cloudformation-template-with-aws-cli/</guid><description>&lt;p&gt;Validating an IaC template before you hand it to CloudFormation is one of the cheapest ways to avoid the&#10;dreaded &lt;code&gt;UPDATE_ROLLBACK_IN_PROGRESS&lt;/code&gt;. You can catch a lot without ever creating a stack - but only if you understand&#10;what the tool you use actually checks. Here are the two we usually use, and where one stops and the other takes over.&lt;/p&gt;</description></item><item><title>Multiplatform docker images for cfn-lint (and a v1.52 schema fix)</title><link>https://mysteriouscode.com/blog/multiplatform-docker-images-for-cfn-lint-and-a-v1.52-schema-fix/</link><pubDate>Sat, 27 Jun 2026 09:00:00 +0000</pubDate><guid>https://mysteriouscode.com/blog/multiplatform-docker-images-for-cfn-lint-and-a-v1.52-schema-fix/</guid><description>&lt;p&gt;A while back we wrote about our &lt;a href="https://mysteriouscode.com/blog/automatically-updated-docker-image-for-cfn-lint/"&gt;automatically updated docker image for cfn-lint&lt;/a&gt; -&#10;a public, daily-rebuilt image for &lt;a href="https://github.com/aws-cloudformation/cfn-lint"&gt;cfn-lint&lt;/a&gt; that fills the gap left by&#10;the lack of an official one. Two changes have just landed in that build, and both are worth a few words: the images are&#10;now multiplatform, and we have fixed a problem that, from cfn-lint v1.52.0 onwards, left the image unable to recognise&#10;any resources.&lt;/p&gt;</description></item><item><title>Mysterious Code at Cloud &amp; AI Infrastructure - meet us at Tech Show London 2025</title><link>https://mysteriouscode.com/blog/mysterious-code-at-cloud-ai-infrastructure-meet-us-at-tech-show-london-2025/</link><pubDate>Tue, 18 Feb 2025 11:00:00 +0000</pubDate><guid>https://mysteriouscode.com/blog/mysterious-code-at-cloud-ai-infrastructure-meet-us-at-tech-show-london-2025/</guid><description>&lt;p&gt;We&amp;rsquo;re excited to announce that Mysterious Code will be part of the &lt;a href="https://www.cloudaiinfrastructure.com/MysteriousCodeDolptec"&gt;Cloud &amp;amp; AI Infrastructure event at Tech Show London&#10;2025&lt;/a&gt;!&lt;/p&gt;</description></item><item><title>Mysterious Code Ltd is now part of AWS Public Sector Program</title><link>https://mysteriouscode.com/blog/mysterious-code-ltd-is-now-part-of-aws-public-sector-program/</link><pubDate>Fri, 19 Apr 2024 15:00:00 +0000</pubDate><guid>https://mysteriouscode.com/blog/mysterious-code-ltd-is-now-part-of-aws-public-sector-program/</guid><description>&lt;p&gt;As a member of the AWS Public Sector Partner Program, Mysterious Code Ltd will leverage its expertise to empower&#10;government, education and nonprofit entities with secure, scalable, and compliant cloud solutions built on AWS infrastructure.&#10;By combining AWS&amp;rsquo;s industry-leading cloud platform with Mysterious Code&amp;rsquo;s specialized knowledge and experience,&#10;public sector customers can expect enhanced capabilities in areas such as data security, compliance, and cost optimization.&lt;/p&gt;</description></item><item><title>Automatically updated docker image for cfn-lint</title><link>https://mysteriouscode.com/blog/automatically-updated-docker-image-for-cfn-lint/</link><pubDate>Thu, 18 Apr 2024 15:00:00 +0000</pubDate><guid>https://mysteriouscode.com/blog/automatically-updated-docker-image-for-cfn-lint/</guid><description>&lt;p&gt;If you&amp;rsquo;re using CloudFormation, you probably know about &lt;a href="https://github.com/aws-cloudformation/cfn-lint"&gt;cfn-lint&lt;/a&gt; - a&#10;linting tool created by the CloudFormation team to validate templates against the schema and best practices. Validating&#10;each template before deployment is in itself actually&#10;&lt;a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/best-practices.html#validate"&gt;considered a best practice by AWS&lt;/a&gt;.&#10;However, simply using &lt;code&gt;validate-template&lt;/code&gt; in the Console or CLI&#10;&lt;a href="https://mysteriouscode.com/blog/how-to-validate-cloudformation-template-with-aws-cli/"&gt;only validates the basic syntax of the template&lt;/a&gt;,&#10;not the actual contents and resource specification. That&amp;rsquo;s where using a linter like &lt;a href="https://github.com/aws-cloudformation/cfn-lint"&gt;cfn-lint&lt;/a&gt;&#10;can be helpful to make sure you&amp;rsquo;re not making any obvious mistakes or going against best practices in your resources.&lt;/p&gt;&#10;&lt;p&gt;You can use &lt;code&gt;cfn-lint&lt;/code&gt; in a number of ways during development, including simply within command-line, using git pre-commit&#10;hooks or as a plugin to your IDE. All those options, while helpful in day-to-day work, do not establish code quality&#10;standards for your overall codebase. To do that, it&amp;rsquo;s ideal to include linting as part of CI/CD pipeline and/or&#10;pull/merge-requests approval process.&lt;/p&gt;&#10;&lt;p&gt;That is where you can come across a hurdle: &lt;a href="https://github.com/aws-cloudformation/cfn-lint/issues/1025"&gt;cfn-lint does not have an official, up-to-date docker image&lt;/a&gt;&lt;/p&gt;</description></item><item><title>Deploying AWS GuardDuty with CloudFormation for Master and Member accounts</title><link>https://mysteriouscode.com/blog/deploying-aws-guardduty-with-cloudformation-for-master-and-member-accounts/</link><pubDate>Tue, 01 May 2018 15:21:00 +0000</pubDate><guid>https://mysteriouscode.com/blog/deploying-aws-guardduty-with-cloudformation-for-master-and-member-accounts/</guid><description>&lt;p&gt;AWS GuardDuty analyses various events happening on your AWS account and can notify you when suspicious activity takes&#10;place. Right now, GuardDuty is specific to a region and needs to be enabled in each region you want to monitor (though&#10;AWS recommends you enable it in all regions to ensure global actions are monitored). Going through GuardDuty console in&#10;every AWS region can be a daunting task, and quite time consuming if you have multiple AWS accounts which you&amp;rsquo;d like to&#10;connect into Master-Member setup. Luckily, CloudFormation supports enabling and setting up GuardDuty detectors, so you&#10;can use it to make it a little bit less painful.&lt;/p&gt;</description></item><item><title>Don't panic! False-positives from GuardDuty and Network Load Balancer (NLB)</title><link>https://mysteriouscode.com/blog/dont-panic-false-positives-from-guardduty-and-network-load-balancer-nlb/</link><pubDate>Tue, 20 Mar 2018 09:00:12 +0000</pubDate><guid>https://mysteriouscode.com/blog/dont-panic-false-positives-from-guardduty-and-network-load-balancer-nlb/</guid><description>&lt;p&gt;If you&amp;rsquo;re keeping in touch with new services provided by AWS, you probably heard about new security monitoring tool:&#10;GuardDuty. You probably also noticed a whole new family of Elastic Load Balancers (v2), which includes Network Load&#10;Balancers (NLB). Deploying those two new services may generate some unexpected results - and here&amp;rsquo;s why.&lt;/p&gt;</description></item><item><title>Complete code: automated EC2 snapshots and retention management</title><link>https://mysteriouscode.com/blog/complete-code-automated-ec2-snapshots-and-retention-management/</link><pubDate>Sun, 11 Mar 2018 23:22:07 +0000</pubDate><guid>https://mysteriouscode.com/blog/complete-code-automated-ec2-snapshots-and-retention-management/</guid><description>&lt;p&gt;Creating snapshots from EBS drives attached to your EC2 instances is the most basic way of backing up your data. While&#10;you have to be cautious when snapshotting running EC2 instances without restart, doing it regularly is a base of many&#10;disaster recovery plans. In the latest update&#10;to &lt;a href="https://github.com/pbudzon/aws-maintenance"&gt;aws-maintenance repo on GitHub&lt;/a&gt; you&amp;rsquo;ll find a complete code and&#10;CloudFormation template that will make this as painless a process as possible.&lt;/p&gt;</description></item><item><title>Cross-region RDS recovery: encryption and Aurora support</title><link>https://mysteriouscode.com/blog/cross-region-rds-recovery-encryption-and-aurora-support/</link><pubDate>Sat, 03 Feb 2018 00:45:22 +0000</pubDate><guid>https://mysteriouscode.com/blog/cross-region-rds-recovery-encryption-and-aurora-support/</guid><description>&lt;p&gt;After &lt;a href="https://mysteriouscode.com/blog/complete-code-cross-region-rds-recovery/"&gt;my previous post&lt;/a&gt; about a complete code for automated RDS&#10;cross-region backup copy, some issues and new feature requests have been raised on GitHub (thanks for that!) - and with&#10;your help, support for encrypted RDS instances and Aurora Clusters have now been added!&lt;/p&gt;</description></item><item><title>Complete code: cross-region RDS recovery</title><link>https://mysteriouscode.com/blog/complete-code-cross-region-rds-recovery/</link><pubDate>Thu, 28 Dec 2017 00:12:46 +0000</pubDate><guid>https://mysteriouscode.com/blog/complete-code-cross-region-rds-recovery/</guid><description>&lt;p&gt;After posting the previous post on this&#10;topic (&lt;a href="https://mysteriouscode.com/blog/copying-rds-snapshot-to-another-region-for-cross-region-recovery/"&gt;Copying RDS snapshot to another region for cross-region recovery&lt;/a&gt;)&#10;, I noticed a lot of people being interested in using the code I provided as an example. Many were not sure how to make&#10;use of it, and&#10;after &lt;a href="https://github.com/pbudzon/aws-maintenance/pulls?utf8=%E2%9C%93&amp;amp;q=is%3Apr"&gt;a couple of pull requests&lt;/a&gt; it became&#10;obvious that a complete, fully-working code and CloudFormation template would be a good idea. So, yesterday, I pushed an&#10;update to &lt;a href="https://github.com/pbudzon/aws-maintenance/"&gt;aws-maintenance&lt;/a&gt; repository with a fully working code, which you&#10;can easily customize via CloudFormation parameters to match your needs.&lt;/p&gt;</description></item><item><title>Sharing encrypted AMIs between AWS accounts (using Python and boto3)</title><link>https://mysteriouscode.com/blog/sharing-encrypted-amis-between-aws-accounts-using-python-and-boto3/</link><pubDate>Thu, 02 Nov 2017 18:00:08 +0000</pubDate><guid>https://mysteriouscode.com/blog/sharing-encrypted-amis-between-aws-accounts-using-python-and-boto3/</guid><description>&lt;p&gt;Each Amazon Machine Image (AMI) holds information of the volumes and snapshots of those volumes that should be attached&#10;to instances created from that AMI. To protect the data on those snapshots, you can choose to encrypt them using KMS.&#10;Encrypting your data at rest is generally a good idea, though many companies choose to avoid encrypting their snapshots,&#10;because sharing such snapshots between different AWS accounts (for example, Test and Production accounts) can be&#10;difficult. That&amp;rsquo;s why I&amp;rsquo;m sharing details on how to make this as easy as possible (and automated!).&lt;/p&gt;</description></item><item><title>Enabling global API Gateway stage logging using CloudFormation</title><link>https://mysteriouscode.com/blog/enabling-global-api-gateway-stage-logging-using-cloudformation/</link><pubDate>Tue, 18 Jul 2017 09:42:49 +0000</pubDate><guid>https://mysteriouscode.com/blog/enabling-global-api-gateway-stage-logging-using-cloudformation/</guid><description>&lt;p&gt;Enabling logging in API Gateway for your stage is fairly easy. You go into the Console, setup a role for API Gateway to&#10;use for logging, find the stage and enable logs. It will enable logging for all methods within that stage. Doing the&#10;same configuration using CloudFormation is not completely obvious though, as&#10;the &lt;a href="http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-apigateway-stage.html"&gt;stage object&amp;rsquo;s&lt;/a&gt; &lt;code&gt;MethodSettings&lt;/code&gt;&#10;property seems to allow you to only do that for a specific resource and method.&lt;/p&gt;</description></item><item><title>Using Magical Dictionaries to manage long CloudFormation templates with Troposphere</title><link>https://mysteriouscode.com/blog/using-magical-dictionaries-to-manage-long-cloudformation-templates-with-troposphere/</link><pubDate>Wed, 05 Jul 2017 15:09:03 +0000</pubDate><guid>https://mysteriouscode.com/blog/using-magical-dictionaries-to-manage-long-cloudformation-templates-with-troposphere/</guid><description>&lt;p&gt;When deploying infrastructure with CloudFormation, at some point you will reach a moment when your CloudFormation JSON&#10;or YAML file is just too big. It will be too long to get a good overview of what&amp;rsquo;s in it, manage parameters and all&#10;dependencies between resources within the template. Nested stacks may be a solution, but if sometimes you can&amp;rsquo;t/won'&#10;t/don&amp;rsquo;t use them for whatever reason (for example, it will get to complicated to manage tested stacks or their contents&#10;are not reusable between other stacks).&lt;/p&gt;&#10;&lt;p&gt;Even if you&amp;rsquo;re using &lt;a href="https://github.com/cloudtools/troposphere"&gt;troposphere&lt;/a&gt; to generate your templates, you&amp;rsquo;ll face&#10;the same issue - a very long Python file. Luckily, if you are using troposphere, you&amp;rsquo;re inherently using Python - which&#10;means you can take advantage of it.&lt;/p&gt;</description></item><item><title>Want to get in touch? Meet us at events this month!</title><link>https://mysteriouscode.com/blog/want-to-get-in-touch-meet-us-at-events-this-month/</link><pubDate>Fri, 09 Jun 2017 10:00:30 +0000</pubDate><guid>https://mysteriouscode.com/blog/want-to-get-in-touch-meet-us-at-events-this-month/</guid><description>&lt;p&gt;Fancy getting in touch with us? Have a question or want to know a bit more about our work? June is the month of&#10;conferences in London, and we will be attending them! Here are the details where and when to meet us:&lt;/p&gt;</description></item><item><title>Controlling access to AWS ElasticSearch Service clusters with IAM</title><link>https://mysteriouscode.com/blog/controlling-access-to-aws-elasticsearch-service-clusters-with-iam/</link><pubDate>Mon, 05 Jun 2017 10:00:52 +0000</pubDate><guid>https://mysteriouscode.com/blog/controlling-access-to-aws-elasticsearch-service-clusters-with-iam/</guid><description>&lt;p&gt;When using &lt;a href="https://aws.amazon.com/elasticsearch-service/"&gt;AWS ElasticSearch Service&lt;/a&gt;, you have multiple ways of&#10;controlling access to your cluster. AWS Console gives you some pre-set policies you can use, but the ways of access can&#10;be confusing. Using the IP-based access, you can allow access from your EC2 instances. But what if you want to access&#10;your cluster from a Lambda?&lt;/p&gt;</description></item><item><title>S3 bucket permissions: what does "everyone" mean?</title><link>https://mysteriouscode.com/blog/s3-bucket-permissions-what-does-everyone-mean/</link><pubDate>Wed, 10 May 2017 20:47:05 +0000</pubDate><guid>https://mysteriouscode.com/blog/s3-bucket-permissions-what-does-everyone-mean/</guid><description>&lt;p&gt;On more than one occasion I have seen S3 bucket policies set for the predefined users groups: &amp;ldquo;Everyone&amp;rdquo; and &amp;ldquo;Any&#10;authenticated AWS user&amp;rdquo;, but rarely has it been done with understanding of what those groups actually mean. So, if&#10;you&amp;rsquo;ve ever set (or thought of setting) permissions for those, please read on.&lt;/p&gt;</description></item><item><title>Intrusion detection and prevention with AWS Lambda and DynamoDB streams</title><link>https://mysteriouscode.com/blog/intrusion-detection-and-prevention-with-aws-lambda-and-dynamodb-streams/</link><pubDate>Wed, 05 Apr 2017 10:00:07 +0000</pubDate><guid>https://mysteriouscode.com/blog/intrusion-detection-and-prevention-with-aws-lambda-and-dynamodb-streams/</guid><description>&lt;p&gt;Intrusion detection system (IDS) and intrusion prevention system (IPS) tend to be expensive and complicated. In AWS, you&#10;can go for much simpler solution - WAF. But that requires you to use Application Load Balancer or CloudFront. But even&#10;with WAF, you have to manage a list IP addresses of attackers that should be blocked. Or, if you only ever need to block&#10;single IPs for short periods of time, NACLs may be a much easier option! Here&amp;rsquo;s a walkthrough on how you can implement a&#10;terribly simple (yet very powerful) intrusion detection and prevention in AWS with Lambda and DynamoDB Streams for a web&#10;application.&lt;/p&gt;</description></item><item><title>AWS Certified Solutions Architect vs DevOps exams - my subjective comparison</title><link>https://mysteriouscode.com/blog/aws-certified-solutions-architect-vs-devops-exams-my-subjective-comparison/</link><pubDate>Mon, 27 Mar 2017 10:00:55 +0000</pubDate><guid>https://mysteriouscode.com/blog/aws-certified-solutions-architect-vs-devops-exams-my-subjective-comparison/</guid><description>&lt;p&gt;Last week, I finally had the time to schedule my AWS Certified Solutions Architect - Professional exam, which I passed&#10;on Saturday. It&amp;rsquo;s been a while since I did the other AWS Professional level (DevOps) certificate, but I thought I&amp;rsquo;d&#10;share my take on how the exams compare.&lt;/p&gt;</description></item><item><title>Bug in KMS: encryption key that cannot be deleted</title><link>https://mysteriouscode.com/blog/bug-in-kms-encryption-key-that-cannot-be-deleted/</link><pubDate>Mon, 06 Mar 2017 10:00:24 +0000</pubDate><guid>https://mysteriouscode.com/blog/bug-in-kms-encryption-key-that-cannot-be-deleted/</guid><description>&lt;p&gt;Recently, I noticed a weird KMS key on an AWS account - what was weird about it, was the fact that it wasn&amp;rsquo;t marked as&#10;AWS-managed key, but no-one (not even root) could delete or modify the key!&lt;/p&gt;</description></item><item><title>Creating Elasticsearch Domain did not stabilize - can't create AWS Elasticsearch 5.1 with CloudFormation</title><link>https://mysteriouscode.com/blog/creating-elasticsearch-domain-did-not-stabilize-cant-create-aws-elasticsearch-5-1-with-cloudformation/</link><pubDate>Fri, 17 Feb 2017 12:19:59 +0000</pubDate><guid>https://mysteriouscode.com/blog/creating-elasticsearch-domain-did-not-stabilize-cant-create-aws-elasticsearch-5-1-with-cloudformation/</guid><description>&lt;p&gt;Recently &lt;a href="https://aws.amazon.com/about-aws/whats-new/2017/01/elasticsearch-5-now-available-on-amazon-elasticsearch-service/"&gt;AWS announced support for Elasticsearch 5.1&lt;/a&gt;&#10;in their Elasticsearch Service. Today, I tried to upgrade an existing CloudFormation stack, previously using&#10;Elasticsearch 2.3, to the new version and, after a very long wait, CloudFormation rolled back the stack with the&#10;following error: &amp;ldquo;&lt;strong&gt;Creating Elasticsearch Domain did not stabilize&lt;/strong&gt;&amp;rdquo;. Here&amp;rsquo;s what I did to solve it.&lt;/p&gt;</description></item><item><title>How to tag Redshift clusters (and others) in one place in AWS Console</title><link>https://mysteriouscode.com/blog/how-to-tag-redshift-clusters-and-others-in-one-place-in-aws-console/</link><pubDate>Fri, 03 Feb 2017 10:00:18 +0000</pubDate><guid>https://mysteriouscode.com/blog/how-to-tag-redshift-clusters-and-others-in-one-place-in-aws-console/</guid><description>&lt;p&gt;Management page of Redshift in AWS Console does not currently allow you to add or modify tags on your clusters. That&#10;doesn&amp;rsquo;t mean that Redshift resources cannot be tagged - almost everything from clusters to parameters groups can be&#10;tagged through the Tag Editor.&lt;/p&gt;</description></item><item><title>Bypassing CloudTrail and CloudWatch monitoring of AWS API</title><link>https://mysteriouscode.com/blog/bypassing-cloudtrail-and-cloudwatch-monitoring-of-aws-api/</link><pubDate>Mon, 23 Jan 2017 21:13:14 +0000</pubDate><guid>https://mysteriouscode.com/blog/bypassing-cloudtrail-and-cloudwatch-monitoring-of-aws-api/</guid><description>&lt;p&gt;Since AWS released CloudWatch Logs and allowed for automated streaming of CloudTrail events into CloudWatch, monitoring&#10;API usage with CloudWatch metrics and alerts has become increasingly popular. It&amp;rsquo;s incredibly easy to set up and add&#10;custom alerts on almost any API event. But is it actually going to notify you when an unauthorized person gains access?&lt;/p&gt;</description></item><item><title>Adding more nodes to Redshift cluster doesn't always mean you get more space</title><link>https://mysteriouscode.com/blog/adding-more-nodes-to-redshift-cluster-doesnt-always-mean-you-get-more-space/</link><pubDate>Fri, 13 Jan 2017 17:33:03 +0000</pubDate><guid>https://mysteriouscode.com/blog/adding-more-nodes-to-redshift-cluster-doesnt-always-mean-you-get-more-space/</guid><description>&lt;p&gt;AWS Redshift is a big data storage (&amp;ldquo;data warehousing&amp;rdquo;) solution for analytics. Based on PostgreSQL 8, it can combine up&#10;to 128 largest nodes, giving you 2 petabytes for your data. Well, almost. You don&amp;rsquo;t get ALL that for your data.&lt;/p&gt;&#10;&lt;figure class="blog-img-max"&gt;&lt;img src="https://mysteriouscode.com/images/blog/2017/01/redshiftpic_hu_a3c1193be5b80736.png" srcset="https://mysteriouscode.com/images/blog/2017/01/redshiftpic_hu_5f70c5e4a4ca6634.webp 320w, https://mysteriouscode.com/images/blog/2017/01/redshiftpic_hu_7b932dbe59417e93.webp 640w, https://mysteriouscode.com/images/blog/2017/01/redshiftpic_hu_19c050d9b6653304.webp 960w, https://mysteriouscode.com/images/blog/2017/01/redshiftpic_hu_d09ffec6459d17ff.webp 1024w" sizes="(max-width: 800px) 100vw, 800px" loading="lazy"&gt;&lt;/figure&gt;</description></item><item><title>AWS S3 storage classes pricing is not what you think</title><link>https://mysteriouscode.com/blog/aws-s3-storage-classes-pricing-is-not-what-you-think/</link><pubDate>Mon, 02 Jan 2017 10:00:45 +0000</pubDate><guid>https://mysteriouscode.com/blog/aws-s3-storage-classes-pricing-is-not-what-you-think/</guid><description>&lt;p&gt;&lt;strong&gt;Since publishing this post, AWS reached out to us about the RR pricing. See bottom of the post for the update.&lt;/strong&gt;&lt;/p&gt;&#10;&lt;p&gt;When storing data in S3, at some point everyone asks the question about storage classes. At first glance it looks more&#10;or less simple - if you&amp;rsquo;re accessing your data less often, or it&amp;rsquo;s not very important, you can pay less. Until you look&#10;into details, find all the asterisks and compare the actual numbers.&lt;/p&gt;&#10;&lt;figure class="blog-img-max"&gt;&lt;img src="https://mysteriouscode.com/images/blog/2017/01/aws-price_hu_4c4f9ba42fec28d5.png" srcset="https://mysteriouscode.com/images/blog/2017/01/aws-price_hu_4554802647967a26.webp 320w, https://mysteriouscode.com/images/blog/2017/01/aws-price_hu_3784a107476bd3a.webp 640w, https://mysteriouscode.com/images/blog/2017/01/aws-price_hu_aa9d23d5ee3f6187.webp 960w, https://mysteriouscode.com/images/blog/2017/01/aws-price_hu_8609b9f75000252a.webp 1024w" sizes="(max-width: 800px) 100vw, 800px" loading="lazy"&gt;&lt;/figure&gt;</description></item><item><title>First thoughts after AWS Certified Security - Specialty BETA exam</title><link>https://mysteriouscode.com/blog/first-thoughts-after-aws-certified-security-specialty-beta-exam/</link><pubDate>Mon, 19 Dec 2016 13:31:58 +0000</pubDate><guid>https://mysteriouscode.com/blog/first-thoughts-after-aws-certified-security-specialty-beta-exam/</guid><description>&lt;p&gt;Last week I made an attempt at passing one of the new AWS Specialty exams - Security.&lt;/p&gt;</description></item><item><title>DHCP implementation in... PHP</title><link>https://mysteriouscode.com/blog/dhcp-implementation-in-php/</link><pubDate>Mon, 12 Dec 2016 09:00:29 +0000</pubDate><guid>https://mysteriouscode.com/blog/dhcp-implementation-in-php/</guid><description>&lt;p&gt;PHP is not usually used to implement network services - and generally for good reasons. Not because it can&amp;rsquo;t be done,&#10;but rather because it&amp;rsquo;s not what it was meant to be used for. Although, if you think that PHP simply can&amp;rsquo;t be used for&#10;anything other than serving your blog, think again. Because&#10;my &lt;a href="https://github.com/pbudzon/dhcp-php"&gt;DHCP implementation in PHP&lt;/a&gt; seems to work quite well!&lt;/p&gt;</description></item><item><title>Using PGP keys from YubiKey as SSH RSA keys on MacOS</title><link>https://mysteriouscode.com/blog/using-pgp-keys-from-yubikey-as-ssh-rsa-keys-on-macos/</link><pubDate>Mon, 05 Dec 2016 10:00:14 +0000</pubDate><guid>https://mysteriouscode.com/blog/using-pgp-keys-from-yubikey-as-ssh-rsa-keys-on-macos/</guid><description>&lt;p&gt;Recently, I became a fan of &lt;a href="https://www.yubico.com/"&gt;YubiKeys&lt;/a&gt; - hardware encryptions keys used for storage of PGP&#10;keys, FIDO U2F (two-factor authentication) and more. The PGP keys stored on the device can also be used as RSA keys for&#10;SSH authentication. The setup is quite simple on MacOS.&lt;/p&gt;</description></item><item><title>Deploying API Gateway and Lambda with CloudFormation</title><link>https://mysteriouscode.com/blog/deploying-apigateway-and-lambda-with-cloudformation/</link><pubDate>Mon, 21 Nov 2016 10:00:32 +0000</pubDate><guid>https://mysteriouscode.com/blog/deploying-apigateway-and-lambda-with-cloudformation/</guid><description>&lt;p&gt;Combination of AWS API Gateway and Lambda functions is a flag example of every &amp;ldquo;serverless infrastructure&amp;rdquo;. When&#10;deploying API Gateway with CloudFormation there are two different ways you can define your API: via Swagger template or&#10;by directly defining your methods in CloudFormation template.&lt;/p&gt;</description></item><item><title>Invalid permissions on Lambda function: fixing API Gateway in CloudFormation</title><link>https://mysteriouscode.com/blog/whats-broken-when-deploying-lambda-and-api-gateway-via-cloudformation/</link><pubDate>Mon, 14 Nov 2016 19:22:45 +0000</pubDate><guid>https://mysteriouscode.com/blog/whats-broken-when-deploying-lambda-and-api-gateway-via-cloudformation/</guid><description>&lt;p&gt;AWS Lambda and API Gateway are becoming synonymous with &amp;ldquo;serverless infrastructure&amp;rdquo; and getting more and more popular.&#10;To deploy them in repeatable way, one of the tools I recommend is CloudFormation - see &lt;a href="https://mysteriouscode.com/blog/deploying-apigateway-and-lambda-with-cloudformation/"&gt;deploying API Gateway and&#10;Lambda with CloudFormation&lt;/a&gt; for the basic&#10;setup. There are many ways you can define&#10;your API and your Lambda, but when connecting the two with CloudFormation there&amp;rsquo;s usually something that many people&#10;miss, and only notice when &lt;code&gt;{&amp;quot;message&amp;quot;: &amp;quot;Internal server error&amp;quot;}&lt;/code&gt; is thrown from their API Gateway endpoint.&lt;/p&gt;</description></item><item><title>Packer, Ansible, CentOS and requiretty</title><link>https://mysteriouscode.com/blog/packer-ansible-centos-and-requiretty/</link><pubDate>Fri, 11 Nov 2016 10:00:42 +0000</pubDate><guid>https://mysteriouscode.com/blog/packer-ansible-centos-and-requiretty/</guid><description>&lt;p&gt;If you&amp;rsquo;ve tried running Packer with CentOS on AWS, you probably noticed this:&lt;/p&gt;&#10;&lt;div class="code-block" data-lang="shell"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-shell" data-lang="shell"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt; sudo: sorry, you must have a tty to run sudo&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</description></item><item><title>How to deploy Wordpress in AWS</title><link>https://mysteriouscode.com/blog/how-to-deploy-wordpress-in-aws/</link><pubDate>Fri, 04 Nov 2016 10:00:02 +0000</pubDate><guid>https://mysteriouscode.com/blog/how-to-deploy-wordpress-in-aws/</guid><description>&lt;p&gt;I&amp;rsquo;m not talking about launching an EC2 instance, uploading the zip with WordPress and going through the installer. I&amp;rsquo;m&#10;talking about immutable infrastructure, scalable, self-healing setup of WordPress within AWS.&lt;/p&gt;</description></item><item><title>Copying RDS snapshot to another region for cross-region recovery</title><link>https://mysteriouscode.com/blog/copying-rds-snapshot-to-another-region-for-cross-region-recovery/</link><pubDate>Fri, 21 Oct 2016 10:00:17 +0000</pubDate><guid>https://mysteriouscode.com/blog/copying-rds-snapshot-to-another-region-for-cross-region-recovery/</guid><description>&lt;p&gt;&lt;strong&gt;For an updated ready-to-use CloudFormation template of this code, see newer&#10;post: &lt;a href="https://mysteriouscode.com/blog/complete-code-cross-region-rds-recovery/"&gt;Complete code: cross-region RDS recovery&lt;/a&gt;&lt;/strong&gt;&#10;.&lt;/p&gt;&#10;&lt;p&gt;Amazon RDS is a great database-as-a-service, which takes care of almost all database-related maintenance tasks for you -&#10;everything from automated backups and patching to replication and fail-overs into another availability zones.&lt;/p&gt;&#10;&lt;p&gt;Unfortunately all of this fails if the region where your RDS is hosted fails. Region-wide failures are very&#10;rare, &lt;a href="https://aws.amazon.com/message/67457/"&gt;but they do happen&lt;/a&gt;! RDS does not support cross-region replication at the&#10;moment, so you cannot simply create a replica of your database in another region (unless you host the database on an EC2&#10;instance and set up the replication yourself). The second-best option, to make sure you can restore your service quickly&#10;in another region, is to always have a copy of your latest database backup in that region. In case of RDS, that can mean&#10;copying automated snapshots. There is no option for AWS to do it automatically, but it can be easily scripted with AWS&#10;Lambda functions.&lt;/p&gt;</description></item><item><title>How I passed Red Hat Certificate of Expertise in Ansible Automation exam (EX407)</title><link>https://mysteriouscode.com/blog/how-i-passed-red-hat-certificate-of-expertise-in-ansible-automation-exam-ex407/</link><pubDate>Fri, 14 Oct 2016 10:00:38 +0000</pubDate><guid>https://mysteriouscode.com/blog/how-i-passed-red-hat-certificate-of-expertise-in-ansible-automation-exam-ex407/</guid><description>&lt;p&gt;I have recently passed Red Hat&amp;rsquo;s EX407 (Red Hat Certificate of Expertise in Ansible Automation exam) and I wanted to&#10;share my experience for anyone else who might be looking into getting that certificate. At the time of my exam, I was&#10;only a second (publicly visible) person in the UK who had that certificate. Probably because it was only made available&#10;in summer this year.&lt;/p&gt;&#10;&lt;p&gt;&#10;&#10;&lt;img src="https://mysteriouscode.com/images/blog/2016/10/redhat-ansible-search_hu_4a4f03c8a14f3f2.png" srcset="https://mysteriouscode.com/images/blog/2016/10/redhat-ansible-search_hu_fe90667755bd524e.webp 320w, https://mysteriouscode.com/images/blog/2016/10/redhat-ansible-search_hu_a2952b48a3c06ace.webp 600w" sizes="(max-width: 800px) 100vw, 800px" alt="redhat certification search results" loading="lazy"&gt;&#10;&lt;/p&gt;</description></item><item><title>Deployment pipeline, part 3: deployment onto an environment</title><link>https://mysteriouscode.com/blog/deployment-pipeline-part-3-deployment-onto-an-environment/</link><pubDate>Fri, 07 Oct 2016 10:00:01 +0000</pubDate><guid>https://mysteriouscode.com/blog/deployment-pipeline-part-3-deployment-onto-an-environment/</guid><description>&lt;p&gt;The purpose of every deployment pipeline is&amp;hellip; a deployment. So this final part of the series, will focus on just that.&#10;If you missed the&#10;intro, &lt;a href="https://mysteriouscode.com/blog/typical-ci-deployment-pipeline-overview/"&gt;check out the video where I describe a typical pipeline here&lt;/a&gt;.&#10;The other parts of this series are &lt;a href="https://mysteriouscode.com/blog/deployment-pipeline-part-1-test-phase/"&gt;part 1: test phase&lt;/a&gt;&#10;and &lt;a href="https://mysteriouscode.com/blog/deployment-pipeline-part-2-build-phase/"&gt;part 2: build phase&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;&#10;&#10;&lt;img src="https://mysteriouscode.com/images/blog/2016/10/pipeline-part-3_hu_6f843bf96444f39f.png" srcset="https://mysteriouscode.com/images/blog/2016/10/pipeline-part-3_hu_b13c94fd8d53f0b9.webp 320w, https://mysteriouscode.com/images/blog/2016/10/pipeline-part-3_hu_873dbe1b6b72d86.webp 640w, https://mysteriouscode.com/images/blog/2016/10/pipeline-part-3_hu_456e34f418b1081.webp 960w, https://mysteriouscode.com/images/blog/2016/10/pipeline-part-3_hu_b9f4a77ee51c1eb1.webp 969w" sizes="(max-width: 800px) 100vw, 800px" alt="pipeline-part-3" loading="lazy"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;Once we create an AMI that we&amp;rsquo;d like to deploy, performing a rolling update on existing instances is fairly easy. Usage&#10;of Auto scaling groups and CloudFormation makes it even easier - &lt;a href="http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-attribute-updatepolicy.html"&gt;since AWS Auto scaling groups support the rolling updates&lt;/a&gt;&#10;out of the box.&lt;/p&gt;&#10;&lt;p&gt;Or, if your applications requires blue-green deployments, using CloudFormation is almost essential.&lt;/p&gt;</description></item><item><title>Deployment pipeline, part 2: build phase</title><link>https://mysteriouscode.com/blog/deployment-pipeline-part-2-build-phase/</link><pubDate>Mon, 03 Oct 2016 09:00:58 +0000</pubDate><guid>https://mysteriouscode.com/blog/deployment-pipeline-part-2-build-phase/</guid><description>&lt;p&gt;Welcome to the second part of my series on deployment pipelines. If you missed the&#10;intro, &lt;a href="https://mysteriouscode.com/blog/typical-ci-deployment-pipeline-overview/"&gt;check out the video where I describe a typical pipeline here&lt;/a&gt;.&#10;The other parts of this series are &lt;a href="https://mysteriouscode.com/blog/deployment-pipeline-part-1-test-phase/"&gt;part 1: test phase&lt;/a&gt;&#10;and &lt;a href="https://mysteriouscode.com/blog/deployment-pipeline-part-3-deployment-onto-an-environment/"&gt;part 3: deployment onto an environment&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;&#10;&#10;&lt;img src="https://mysteriouscode.com/images/blog/2016/10/pipeline-part-2_hu_c26f3b697aa0fbd1.png" srcset="https://mysteriouscode.com/images/blog/2016/10/pipeline-part-2_hu_aacdc607f3689075.webp 279w" sizes="(max-width: 800px) 100vw, 800px" alt="pipeline-part-2" loading="lazy"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;After the test phase of the pipeline, once the quality of the code has been checked, we must build a deployable artefact&#10;for this version (commit) of the code. In case of AWS, this would be an&#10;AMI (&lt;a href="http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html"&gt;Amazon Machine Image&lt;/a&gt;), which can then be deployed&#10;as a new instance in our environment.&lt;/p&gt;</description></item><item><title>Deployment pipeline, part 1: test phase</title><link>https://mysteriouscode.com/blog/deployment-pipeline-part-1-test-phase/</link><pubDate>Fri, 30 Sep 2016 10:00:10 +0000</pubDate><guid>https://mysteriouscode.com/blog/deployment-pipeline-part-1-test-phase/</guid><description>&lt;p&gt;Welcome to the first part of my series on deployment pipelines. If you missed the&#10;intro, &lt;a href="https://mysteriouscode.com/blog/typical-ci-deployment-pipeline-overview/"&gt;check out the video where I describe a typical pipeline here.&lt;/a&gt;&lt;/p&gt;&#10;&lt;p&gt;&#10;&#10;&lt;img src="https://mysteriouscode.com/images/blog/2016/09/pipeline-part-1_hu_e6379d478f628862.png" srcset="https://mysteriouscode.com/images/blog/2016/09/pipeline-part-1_hu_6e8c42a9b6cfbec3.webp 276w" sizes="(max-width: 800px) 100vw, 800px" alt="pipeline-part-1" loading="lazy"&gt;&#10;&lt;/p&gt;&#10;&lt;p&gt;First step of a deployment pipeline, is usually a series of tests. After a commit is made, the code is checked out from&#10;the source code repository and tested. Those are usually code style tests and unit tests.&lt;/p&gt;</description></item><item><title>ELB ProxyProtocol with CloudFormation</title><link>https://mysteriouscode.com/blog/elb-proxyprotocol-with-cloudformation/</link><pubDate>Mon, 26 Sep 2016 10:12:42 +0000</pubDate><guid>https://mysteriouscode.com/blog/elb-proxyprotocol-with-cloudformation/</guid><description>&lt;p&gt;When using AWS Elastic Load Balancer with TCP listeners (not HTTP or HTTPS), the biggest problem faced by many people is&#10;the lack of client&amp;rsquo;s IP address. Since it&amp;rsquo;s TCP which works on a lower layer, the ELB does not add the X-Forwaded-For&#10;header (like it does for HTTP and HTTPS). For some time, this meant that if you used those listeners, you had no way of&#10;getting the original client&amp;rsquo;s IP address.&lt;/p&gt;</description></item><item><title>Typical CI deployment pipeline - overview</title><link>https://mysteriouscode.com/blog/typical-ci-deployment-pipeline-overview/</link><pubDate>Fri, 23 Sep 2016 00:02:37 +0000</pubDate><guid>https://mysteriouscode.com/blog/typical-ci-deployment-pipeline-overview/</guid><description>&lt;div&#10;&#9;&#9;&#9;&#9;&#9;style="position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden;"&gt;&#10;&#9;&#9;&#9;&#9;&lt;iframe&#10;&#9;&#9;&#9;&#9;&#9;src="https://player.vimeo.com/video/183889021?dnt=0"&#10;&#9;&#9;&#9;&#9;&#9;&#9;style="position: absolute; top: 0; left: 0; width: 100%; height: 100%; border:0;" allow="fullscreen"&gt;&#10;&#9;&#9;&#9;&#9;&lt;/iframe&gt;&#10;&#9;&#9;&#9;&lt;/div&gt;&#10;&#10;&lt;p&gt;More details on each deployment phase with examples, will be posted at our blog over the coming weeks, so check back&#10;soon.&lt;/p&gt;</description></item><item><title>Using Troposphere to create CloudFormation stack template</title><link>https://mysteriouscode.com/blog/using-troposphere-to-create-cloudformation-stack-template/</link><pubDate>Fri, 09 Sep 2016 15:12:49 +0000</pubDate><guid>https://mysteriouscode.com/blog/using-troposphere-to-create-cloudformation-stack-template/</guid><description>&lt;p&gt;If you&amp;rsquo;ve ever wrote &lt;a href="https://aws.amazon.com/cloudformation/"&gt;AWS CloudFormation&lt;/a&gt; template, you probably know that it&#10;can be a daunting task. Luckily, it can be much easier, if you&#10;use &lt;a href="https://github.com/cloudtools/troposphere"&gt;Python&amp;rsquo;s library &amp;ldquo;Troposphere&amp;rdquo;&lt;/a&gt;.&lt;/p&gt;&#10;&lt;p&gt;Troposphere lets you create Python objects in place of CloudFormation elements, does some basic validation of your&#10;input and generates the JSON template for CloudFormation for you. It is much easier and cleaner to use that writing JSON&#10;templates manually.&lt;/p&gt;</description></item><item><title>2a0++ misunderstanding</title><link>https://mysteriouscode.com/blog/2a0-misunderstanding/</link><pubDate>Fri, 08 Nov 2013 11:42:27 +0000</pubDate><guid>https://mysteriouscode.com/blog/2a0-misunderstanding/</guid><description>&lt;p&gt;The following eval&amp;rsquo;ed code was caused a lot of misunderstanding: &lt;a href="https://eval.in/61309"&gt;https://eval.in/61309&lt;/a&gt;. The&#10;code looks like this:&lt;/p&gt;&#10;&lt;div class="code-block" data-lang="php"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#d8dee9;background-color:#2e3440;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-php" data-lang="php"&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#6c6f74"&gt;1&lt;/span&gt;&lt;span&gt;$a &lt;span style="color:#81a1c1"&gt;=&lt;/span&gt; &lt;span style="color:#a3be8c"&gt;&amp;#34;2a0&amp;#34;&lt;/span&gt;&lt;span style="color:#eceff4"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#6c6f74"&gt;2&lt;/span&gt;&lt;span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#6c6f74"&gt;3&lt;/span&gt;&lt;span&gt;&lt;span style="color:#81a1c1;font-weight:bold"&gt;for&lt;/span&gt;&lt;span style="color:#eceff4"&gt;(&lt;/span&gt;$i &lt;span style="color:#81a1c1"&gt;=&lt;/span&gt; &lt;span style="color:#b48ead"&gt;0&lt;/span&gt;&lt;span style="color:#eceff4"&gt;;&lt;/span&gt; $i &lt;span style="color:#81a1c1"&gt;&amp;lt;&lt;/span&gt; &lt;span style="color:#b48ead"&gt;50&lt;/span&gt;&lt;span style="color:#eceff4"&gt;;&lt;/span&gt; $i&lt;span style="color:#81a1c1"&gt;++&lt;/span&gt;&lt;span style="color:#eceff4"&gt;)&lt;/span&gt; &lt;span style="color:#eceff4"&gt;{&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#6c6f74"&gt;4&lt;/span&gt;&lt;span&gt; &lt;span style="color:#81a1c1;font-weight:bold"&gt;print&lt;/span&gt; &lt;span style="color:#a3be8c"&gt;&amp;#34;&lt;/span&gt;&lt;span style="color:#a3be8c"&gt;$a&lt;/span&gt;&lt;span style="color:#ebcb8b"&gt;\n&lt;/span&gt;&lt;span style="color:#a3be8c"&gt;&amp;#34;&lt;/span&gt;&lt;span style="color:#eceff4"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#6c6f74"&gt;5&lt;/span&gt;&lt;span&gt; $a&lt;span style="color:#81a1c1"&gt;++&lt;/span&gt;&lt;span style="color:#eceff4"&gt;;&lt;/span&gt;&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span style="white-space:pre;-webkit-user-select:none;user-select:none;margin-right:0.4em;padding:0 0.4em 0 0.4em;color:#6c6f74"&gt;6&lt;/span&gt;&lt;span&gt;&lt;span style="color:#eceff4"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;</description></item><item><title>Node.js: using socket.io with cluster module</title><link>https://mysteriouscode.com/blog/node-js-using-socket-io-with-cluster-module/</link><pubDate>Sun, 26 Aug 2012 23:15:27 +0000</pubDate><guid>https://mysteriouscode.com/blog/node-js-using-socket-io-with-cluster-module/</guid><description>&lt;p&gt;I&amp;rsquo;ve been recently working on a project that uses Node.js with cluster module and socket.io and I noticed that a lot of&#10;people that try to use Node.js with socket.io have problems with how to make it work with cluster module.&lt;/p&gt;</description></item><item><title>Accessing Gmail with oAuth authorization in PHP</title><link>https://mysteriouscode.com/blog/accessing-gmail-with-oauth-authorization-in-php/</link><pubDate>Sun, 18 Dec 2011 15:00:22 +0000</pubDate><guid>https://mysteriouscode.com/blog/accessing-gmail-with-oauth-authorization-in-php/</guid><description>&lt;p&gt;Recently, I&amp;rsquo;ve joined a project that required accessing Gmail accounts using oAuth authentication with PHP. It turns&#10;out, that&amp;rsquo;s not such a very simple thing to do, especially with PHP - &lt;a href="http://code.google.com/p/google-mail-xoauth-tools/wiki/PhpSampleCode"&gt;Zend has a very nice implementation for it&lt;/a&gt;,&#10;but the wiki page is terribly old and outdated&amp;hellip; I&amp;rsquo;ve lost a few hours looking for a nice and clean solution and found&#10;a &lt;a href="https://github.com/petewarden/handmadeimap"&gt;&amp;ldquo;handmadeimap&amp;rdquo; project done by Pete Warder&lt;/a&gt; some time ago. Bad thing is,&#10;the latest commit was done in 2010. The good thing: not much has changed since then, so the code works perfectly. It&amp;rsquo;s&#10;even better to use that php-imap extension, as you need to use raw IMAP commands, which gives you the chance to use, for&#10;example, gmail&amp;rsquo;s special &lt;a href="http://code.google.com/apis/gmail/imap/#x-gm-raw"&gt;X-GM-RAW&lt;/a&gt; extension to SEARCH command.&lt;/p&gt;</description></item></channel></rss>