Showing posts from August, 2018

Deploy Docker Image with AWS ECS (Part 1)

One of the things I have been working on is to help our developers to containerize their applications and deploy them to AWS ECS.  In this post, I will walk through the steps to upload a Docker image to AWS ECR (Elastic Container Repository). As the first step, we need to provision the ECR with CloudFormation template. Below is a simple CFN template written in YAML. AWSTemplateFormatVersion: "2010-09-09" Description: > Play stack Parameters: RepoName: Default: tomrepo Description: ECR Repoistory Name Type: String # required ConstraintDescription: must be a name Resources: myrepo: Type: AWS::ECR::Repository Properties: RepositoryName: !Ref RepoName mycluster: Type: AWS::ECS::Cluster Properties: ClusterName: tomecscluster Outputs: AWSTemplateFormatVersion: Description: Tempalte version Value: "1.0" Deploy the CFN template with AWS CLI comm

Azure - Update Existing RSG with ARM Template

Do you ever find yourself face this kind the situation: You are told to provision new resources with ARM templates to an existing resource group that already has VMs and vNets built and running. How can you add new subnets and VMs to the resource group without breaking those ones already there? Unlike AWS Cloud Formation Templates, Microsoft ARM Templates do not provide “Update” option for past deployments. In order to modify the existing environment, the usual option is to make the change through CLI, PowerShell or Azure portal. But what if you somehow have to make the change through ARM template? One way to do this is to create a template that enlists all existing resources and then add changes to it. Below is a lab setup I created through portal. Assume there is a requirement to create another subnet in the same vNet. First, we use Azure Resource Group’s Automation script feature to generate a ARM template based on the existing resources. Reformat and Cleanup ARM Template Next, down