The Leading Cloud Operations Optimization Service
US Toll Free(800) 505-9638
  • CUSTOMERS
  • BLOG
  • CONTACT
  • LOGIN
  • SIGN UP
  • CUSTOMERS
  • BLOG
  • CONTACT
  • LOGIN
  • SIGN UP
  • CUSTOMERS
  • BLOG
  • CONTACT
  • LOGIN
  • SIGN UP
  • AWS RESELLERS
  • SOLUTIONS
    • Newvem for AWS
      • How it Works
      • Utilization Heat Map
      • Business Views of AWS
      • Cloud Baseline
        • Assets
        • Costs
        • Risks
      • AWS Support
        • Support Center
        • Community Forums
        • Knowledge Center
          • How-to Guides
          • Community Articles
          • Amazon Cloud Computing Services
          • AWS Cloud Support
          • AWS Reserved Instances
          • AWS Console
          • AWS EC2
          • Amazon Elastic Compute Cloud
          • EC2 Instances
          • Understanding Amazon AMI
        • Proficiency Level
          • Beginner
          • Advanced
          • Professional
        • Cloud Partners
        • Cloud Experts
      • Cloud Insight by Topic
        • Capacity
        • Utilization
        • Availability
        • Security
        • Financial Efficiency
      • Advanced Analytic Tools
        • Baseline Insights
        • Premium Insights
        • Business Groups
        • Reserved Instances
        • S3 Analytics
      • Cloud Baseline by Role
        • C-Level Cockpit
        • IT Managers View
        • Operators View
        • Developers View
      • Cloud Insight by AWS Service
        • Amazon EC2
        • Amazon S3
      • iPhone / iPad App
    • Newvem for Azure
      • Azure Beta Program
      • Knowledge Center
  • FEATURES
    • Free Cloud Care Features
    • Premium Cloud Care Features
  • PRICING
  • AZURE BETA
  • AWS RESELLERS
  • SOLUTIONS
    • Newvem for AWS
      • How it Works
      • Utilization Heat Map
      • Business Views of AWS
      • Cloud Baseline
        • Assets
        • Costs
        • Risks
      • AWS Support
        • Support Center
        • Community Forums
        • Knowledge Center
          • How-to Guides
          • Community Articles
          • Amazon Cloud Computing Services
          • AWS Cloud Support
          • AWS Reserved Instances
          • AWS Console
          • AWS EC2
          • Amazon Elastic Compute Cloud
          • EC2 Instances
          • Understanding Amazon AMI
        • Proficiency Level
          • Beginner
          • Advanced
          • Professional
        • Cloud Partners
        • Cloud Experts
      • Cloud Insight by Topic
        • Capacity
        • Utilization
        • Availability
        • Security
        • Financial Efficiency
      • Advanced Analytic Tools
        • Baseline Insights
        • Premium Insights
        • Business Groups
        • Reserved Instances
        • S3 Analytics
      • Cloud Baseline by Role
        • C-Level Cockpit
        • IT Managers View
        • Operators View
        • Developers View
      • Cloud Insight by AWS Service
        • Amazon EC2
        • Amazon S3
      • iPhone / iPad App
    • Newvem for Azure
      • Azure Beta Program
      • Knowledge Center
  • FEATURES
    • Free Cloud Care Features
    • Premium Cloud Care Features
  • PRICING
  • AZURE BETA
  • AWS RESELLERS
  • SOLUTIONS
    • Newvem for AWS
      • How it Works
      • Utilization Heat Map
      • Business Views of AWS
      • Cloud Baseline
        • Assets
        • Costs
        • Risks
      • AWS Support
        • Support Center
        • Community Forums
        • Knowledge Center
          • How-to Guides
          • Community Articles
          • Amazon Cloud Computing Services
          • AWS Cloud Support
          • AWS Reserved Instances
          • AWS Console
          • AWS EC2
          • Amazon Elastic Compute Cloud
          • EC2 Instances
          • Understanding Amazon AMI
        • Proficiency Level
          • Beginner
          • Advanced
          • Professional
        • Cloud Partners
        • Cloud Experts
      • Cloud Insight by Topic
        • Capacity
        • Utilization
        • Availability
        • Security
        • Financial Efficiency
      • Advanced Analytic Tools
        • Baseline Insights
        • Premium Insights
        • Business Groups
        • Reserved Instances
        • S3 Analytics
      • Cloud Baseline by Role
        • C-Level Cockpit
        • IT Managers View
        • Operators View
        • Developers View
      • Cloud Insight by AWS Service
        • Amazon EC2
        • Amazon S3
      • iPhone / iPad App
    • Newvem for Azure
      • Azure Beta Program
      • Knowledge Center
  • FEATURES
    • Free Cloud Care Features
    • Premium Cloud Care Features
  • PRICING
  • AZURE BETA
  • Newvem for AWS
  • Cloud Care Features
  • Newvem for Azure

Creating an AWS CloudFormation Template

Subscribe to Our Weekly Newsletter
Submit

You are now subscribed!



Watch Newvem's Video
Sign Up for FREE

Most Popular Posts

  • Are You an AWS Cloud Expert? Find Out Now!
  • What’s CPU Steal Time?
  • Dissecting Amazon Elastic Load Balancer (ELB): 18 Facts You Should Know
  • The 10 Most Common Amazon’s AWS Usage Mistakes
  • The 5 Biggest Security Mistakes Users Make in Amazon’s Cloud

Tags

Amazon Cloud Services AWS Cloud Backup Best Practices Cloud Capacity CloudFront CloudWatch Consumption Cost Efficiency EBS EC2 ELB High Availability How-to Guide IAM Management and Control S3 Security Security Groups Utilization

Creating an AWS CloudFormation Template

Firstly, you will be required to create a template based on the resources that you’ve just created. You will be using a tool known as CloudFormer, which collects all information about your running resources, and then creates a template. CloudFormer is actually a prototype that helps you in getting started. You will then make a few tweaks to the template before creating your new stack. You can visit the AWS Forums to learn how to run the tool. After generating the template and making the tweaks, you will have something that looks like the following:

{

“AWSTemplateFormatVersion”: “2020-09-09″,

“Resources”: {

“elbMyLB”: {

“Type”: “AWS::ElasticLoadBalancing::LoadBalancer”,

“Properties”: {

“AvailabilityZones”: [

"us-east-1b",

"us-east-1c"

],

“HealthCheck”: {

“HealthyThreshold”: “2″,

“Interval”: “30″,

“Target”: “HTTP:80/”,

“Timeout”: “5″,

“UnhealthyThreshold”: “2″

},

“Listeners”: [

{

"InstancePort": "80",

"LoadBalancerPort": "80",

"Protocol": "HTTP",

"PolicyNames": [

]

}

]

}

},

“distd18k4jybr69gw2cloudfrontnet”: {

“Type”: “AWS::CloudFront::Distribution”,

“Properties” : {

“DistributionConfig” : {

“S3Origin” : {

“DNSName”: “webapplication.s3.amazonaws.com”

},

“Enabled” : “true”,

“Logging” : {

“Bucket” : “webapplication.s3.amazonaws.com”,

“Prefix” : “webapp-logging/”

}

}

}

},

“asgMyAutoScalingGroup”: {

“Type”: “AWS::AutoScaling::AutoScalingGroup”,

“Properties”: {

“AvailabilityZones”: [

"us-east-1b",

"us-east-1c"

],

“Cooldown”: “300″,

“DesiredCapacity”: “1″,

“MaxSize”: “1″,

“MinSize”: “1″,

“LaunchConfigurationName”: {

“Ref”: “lcMyLC”

},

“LoadBalancerNames”: [

{

"Ref": "elbMyLB"

}

]

}

},

“lcMyLC”: {

“Type”: “AWS::AutoScaling::LaunchConfiguration”,

“Properties”: {

“ImageId”: “ami-498d5520″,

“InstanceType”: “t1.micro”,

“KeyName”: “mykeypair”,

“SecurityGroups”: [

{

"Ref": "sgwebappsecuritygroup"

}

]

}

},

“aspMyScaleUpPolicy” : {

“Type” : “AWS::AutoScaling::ScalingPolicy”,

“Properties” : {

“AdjustmentType” : “ChangeInCapacity”,

“AutoScalingGroupName” : { “Ref” : “asgMyAutoScalingGroup” },

“Cooldown” : “300″,

“ScalingAdjustment” : “1″

}

},

“cwCPUAlarmHigh”: {

“Type”: “AWS::CloudWatch::Alarm”,

“Properties”: {

“AlarmDescription”: “Scale-up if CPU > 60% for 10 minutes”,

“MetricName”: “CPUUtilization”,

“Namespace”: “AWS/EC2″,

“Statistic”: “Average”,

“Period”: “300″,

“EvaluationPeriods”: “2″,

“Threshold”: “60″,

“AlarmActions”: [ { "Ref": "aspMyScaleUpPolicy" } ],

“Dimensions”: [

{

"Name": "AutoScalingGroupName",

"Value": { "Ref": "asgMyAutoScalingGroup" }

}

],

“ComparisonOperator”: “GreaterThanThreshold”

}

},

“rdsmydbinstance”: {

“Type”: “AWS::RDS::DBInstance”,

“Properties”: {

“AllocatedStorage”: “5″,

“BackupRetentionPeriod”: “1″,

“DBInstanceClass”: “db.m1.small”,

“DBName”: “MyDatabase”,

“DBParameterGroupName”: “default.mysql5.1″,

“Engine”: “mysql”,

“EngineVersion”: “5.1.57″,

“MasterUsername”: “awsuser”,

“MasterUserPassword”: “awsuser”,

“Port”: “3306″,

“PreferredBackupWindow”: “07:00-07:30″,

“PreferredMaintenanceWindow”: “sat:04:00-sat:04:30″,

“MultiAZ”: “true”,

“DBSecurityGroups”: [

{

"Ref": "dbsgmydbsecuritygroup"

}

]

}

},

“s3webapplication”: {

“Type”: “AWS::S3::Bucket”

},

“sgwebappsecuritygroup”: {

“Type”: “AWS::EC2::SecurityGroup”,

“Properties”: {

“GroupDescription”: “for web app”,

“SecurityGroupIngress”: [

{

"IpProtocol": "tcp",

"FromPort": "80",

"ToPort": "80",

"SourceSecurityGroupName": "amazon-elb-sg",

"SourceSecurityGroupOwnerId": "amazon-elb"

},

{

"IpProtocol": "tcp",

"FromPort": "3389",

"ToPort": "3389",

"CidrIp": "0.0.0.0/0"

}

]

}

},

“dbsgmydbsecuritygroup”: {

“Type”: “AWS::RDS::DBSecurityGroup”,

“Properties”: {

“GroupDescription”: “security group for my web app”,

“DBSecurityGroupIngress”: [

{

"EC2SecurityGroupName": {

"Ref": "sgwebappsecuritygroup"

},

"EC2SecurityGroupOwnerId": "123456789012"

}

]

}

}

},

“Description”: “”

}

 

Now, you will want to make some changes to this template before launching your new environment. Also, you only launched one Amazon EC2 instance in this tutorial. However, it is a good practice to launch multiple instances across multiple Availability Zones (you will want to update your Auto Scaling group to launch multiple instances).You may also want to launch a new environment with your custom AMI. Finally, you will update your database information (to include your database name and password).

 

Subscribe to Our Weekly Newsletter
Submit

You are now subscribed!



Watch Newvem's Video
Sign Up for FREE

Most Popular Posts

  • Are You an AWS Cloud Expert? Find Out Now!
  • What’s CPU Steal Time?
  • Dissecting Amazon Elastic Load Balancer (ELB): 18 Facts You Should Know
  • The 10 Most Common Amazon’s AWS Usage Mistakes
  • The 5 Biggest Security Mistakes Users Make in Amazon’s Cloud

Tags

Amazon Cloud Services AWS Cloud Backup Best Practices Cloud Capacity CloudFront CloudWatch Consumption Cost Efficiency EBS EC2 ELB High Availability How-to Guide IAM Management and Control S3 Security Security Groups Utilization

Top
12

2021 Hot Cloud
Computing Company

Company

  • About Newvem
  • On Bloomberg TV
  • Profit from the Cloud
  • In the News
  • Our Team
  • Jobs
  • Our Clients
  • Press Release
  • Terms of Use
  • Privacy Policy
  • White Paper

Hot Topics

  • Cloud Smart Meter
  • AWS Infographic
  • Reserved Instance Marketplace
  • 10 AWS Usage Mistakes
  • 5 AWS Security Mistakes
  • AWS Usage Tips
  • Amazon S3 Analytics

Solutions

  • Cloud Smart Meter App
  • AWS Reserved Instances Calculator
  • S3 Analytic Tool
  • How It Works
  • How to Get Started
  • AWS Support
  • C-Level View
  • IT Manager View
  • Cloud Operator View
  • Developer View
  • AWS cloud for the enterprise
  • Analytics for Azure

CloudPedia

  • CloudPedia
  • Cloud Radar
  • AWS Getting Started Guide
  • Prepare for AWS Outages
  • Best Practice Insights
  • Effective AWS EC2
  • AWS Financial Efficiency
  • AWS Availability
  • AWS Security
  • AWS Training
  • AWS Usage Tips

Contact Us

  • Support
  • Contact Us

Stay connected

© 2020 - 2022. Newvem Insight Ltd. All Rights Reserved.