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 a DB Security Group

Newvem Analytics

Newvem Analytics analyzes, reveals, and recommends powerful insights on your AWS Cloud. Start using it for free:

By Signing up you signify that you have read and agree to the Terms of service and Privacy Policy.

Some of Our Clients

Home»
AWS

Deleting your Elastic Load Balancer

Once your load balancer becomes available, AWS will bill you for each hour (or partial hour) that you keep the load balancer running. So, if you’ve decided that you no longer need the load balancer, you should delete it.

To delete your load balancer:

  • Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.

 Deleting your Elastic Load Balancer - 1

  • In the “Navigation” pane, click “US East (Virginia)”, under “Regions”.
  • Select the check box next to the load balancer you want to delete under “Load Balancers”, and click “Delete”.
  • Click on the “Yes, Delete” button once the confirmation message appears.

 Deleting your Elastic Load Balancer - 2

Elastic Load Balancing will then delete the load balancer. You stop incurring charges for a load balancer as soon as it is deleted.

Caution: Even after deleting a load balancer, the Amazon EC2 instances associated it continue to run, and so you will continue to incur charges.

 

Read more »

Deleting Your CloudWatch Alarm

If you decide that you no longer need the alarm, you can delete it. To do so:

  • Open the Amazon CloudWatch console at https://console.aws.amazon.com/cloudwatch/.

 Deleting Your CloudWatch Alarm - 1

  • In the “Navigation” pane, click “US East (Virginia)” under “Regions”.
  • Now, you should select the check box next to the alarm that you want to delete, and then click on the “Delete” button.
  • Click on the “Yes, Delete” button once the confirmation box appears.

Deleting Your CloudWatch Alarm - 2

Read more »

Creating an AWS CloudFormation Stack

Now that your AWS CloudFormation template has been modified, we will create a new stack to launch your new environment. You have the ability to verify that your new stack works before launching it, by cleaning up all your AWS resources, except for your custom AMI and key pair. For further instructions on cleaning up your resources, please refer to the section “Cleaning Up Your Resources”.

Note: AWS CloudFormation is a free service. However, charges are incurred by you for the AWS resources you include in your stacks. For further information about AWS pricing, please visit the details page for each of the products on http://aws.amazon.com/pricing.

Here is the procedure to create an AWS CloudFormation stack:

  • Firstly, you will be required to launch the “Create Stack Wizard”:
    • Open the AWS CloudFormation console at https://console.aws.amazon.com/cloudformation/.
    • In the “Navigation” pane, you will need to select “US East (Virginia)” from the “Region” drop-down menu.
    • Now, in the “Stacks” page also, please select “US East (Virginia)” from the “Region” drop-down menu.
    • Click on “Create New Stack”. The “SELECT TEMPLATE” page of the “Create Stack Wizard” will appear.

Creating an AWS CloudFormation Stack - select template - 1

  • You will now be required to select a template:
    • On the “SELECT TEMPLATE” page of the “Create Stack Wizard”, you will be required to type a stack name in the “Stack Name” box.
    • Now, click on “Upload a Template URL”, and type in the location where you have saved your modified template.
    • Click on the “Show Advanced Options” button.
    • Select “Create a new SNS topic” from the “Amazon SNS Topic” drop-down menu. By doing so, you will always receive email notifications whenever resources are created or deleted.
    • Type “CRM” in the “New topic” name box.
    • Type your e-mail address in the “Email” box, and accept all the other default values.
    • Click on “Continue”.

The “REVIEW” page of the “Create Stack Wizard” will appear.

 Creating an AWS CloudFormation Stack - review - 2

  • Now, you can review your settings. You can thus make changes to the settings by clicking on the edit link for any specific step in the process.
  • Click on the “Create Stack” button.

         A confirmation window will appear.

Creating an AWS CloudFormation Stack - Create stack - 3

Read more »

Modifying an AWS Cloud Formation Template

Now, since the template has already been created, we will modify it, to enable you to launch a new environment with the custom AMI. By doing so, you will have multiple instances spanned across multiple Availability Zones. Here is the procedure to launch a new stack with a modified template:

  • Open the template that you’ve just created using CloudFormer.
  • Update the CloudDistribution group to include DistributionConfig and the Loggingportion.
“distd18k4jybr69gw2cloudfrontnet” : { “Type” : “AWS::CloudFront::Distribution”, “Properties” : { “DistributionConfig” : { “S3Origin” : { “DNSName”: “webapplication.s3.amazonaws.com” }, “Enabled” : “true”, “Logging” : { “Bucket” : “webapplication.s3.amazonaws.com”, “Prefix” : “webapp-logging/” } } } },

In the Auto-Scaling group, update the “Max Size”, “Min Size”, and “Desired Capacity” to 2. 

“asgMyAutoScalingGroup”: { “Type”: “AWS::AutoScaling::AutoScalingGroup”, “Properties”: { “AvailabilityZones”: [ "us-east-1b", "us-east-1c" ], “Cooldown”: “300″, “DesiredCapacity”: “2″, “MaxSize”: “2″, “MinSize”: “2″, “LaunchConfigurationName”: { “Ref”: “lcMyLC” }, “LoadBalancerNames”: [ { "Ref": "elbMyLB" } ] } },
  •  
  • Update the Image ID in the “Launch Configuration” group to the custom AMI that you had created in the Creating a Custom AMI section.

Note: Your AMI ID will be different from the one you see below.

“lcMyLC”: { “Type”: “AWS::AutoScaling::LaunchConfiguration”, “Properties”: { “ImageId”: “ami-576ca43e”, “InstanceType”: “t1.micro”, “KeyName”: “mykeypair”, “SecurityGroups”: [ { "Ref": "sgwebappsecuritygroup" } ] } },
  • Now, update the following parameters in the Database group:
    • Update “DBName” to mydb.
    • Update “MasterUserPassword” to the master password you specifed in the Adding Amazon RDS section. 
“rdsawsworkshop”: { “Type”: “AWS::RDS::DBInstance”, “Properties”: { “AllocatedStorage”: “5″, “BackupRetentionPeriod”: “1″, “DBInstanceClass”: “db.m1.small”, “DBName”: “mydb”, “DBParameterGroupName”: “default.mysql5.1″, “Engine”: “mysql”, “EngineVersion”: “5.1.57″, “MasterUsername”: “awsuser”, “MasterUserPassword”: “mypassword”, “Port”: “3306″, “PreferredBackupWindow”: “08:30-09:00″, “PreferredMaintenanceWindow”: “fri:03:30-fri:04:00″, “MultiAZ”: “true”, “DBSecurityGroups”: [ { "Ref": "dbsgmydbsecuritygroup" } ] } },

 

Read more »

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).

 

Read more »

Creating an AMI from a Running Amazon EBS-backed Instance

The following steps will instruct you on how to create an AMI from a running Amazon EBS-backed Instance:

  • Firstly, open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
  • Now, in the “Navigation” pane select “US East (Virginia)” from the “Region” drop-down menu.
  • Click on “Instances” in the “Navigation” pane.
  • Right-click on your running instance on the “Instances” page, and select “Create Image (EBS AMI)”.

The “Create Image” dialog box will appear.

  • You will now be required to fill-in a unique image name and an optional description for it (not more than 255 characters), and click on “Create This Image”.

Tip: If one is familiar with Amazon EC2 instance store-backed AMIs, the image name        replaces the manifest name, which uniquely identifies each Amazon EC2 instance store- backed AMI (e.g., s3_bucket/something_of_your_choice.manifest.xml).

Creating an AMI from a Running Amazon EBS-backed Instance - 1

Amazon EC2 will automatically power down the instance, take images of any volumes     that were attached, create and register the AMI, and then reboot the instance.

If you go to the AMIs page and view the AMI’s status, you will see that the status is shown as “pending” while the new AMI is being created.

Creating an AMI from a Running Amazon EBS-backed Instance - 2

Once your new AMI’s status shows “available”, you should go to the “Snapshots” page, and view the snapshot that was created for the new AMI. Any instance that will be        launched by you from the new AMI will use this snapshot for its root device volume. You also have the option to update your Auto-Scaling group with the new AMI (we will      do this as part of the AWS CloudFormation step).

Creating an AMI from a Running Amazon EBS-backed Instance - 3

 

 

Read more »

Modifying the Application

We are now ready to modify the application in order to publish our images to Amazon S3 automatically. We will also use Amazon RDS to index our content which is stored in Amazon S3.

Note: We will be modifying the code from the web server, so that the webmaster’s S3 credentials are not exposed to end users.

We will be modifying the application in the following ways:

  • Updating your web.config file
  • Modifying your code so that it points to your Amazon CloudFront distribution or Amazon S3 bucket
  • Modifying your code so that it points to your Amazon RDS file

 Here’s the procedure to update your web.config file:

  • Open the web.config file, and replace the text that says “Enter your access/secret key here” with the actual values. 

<appSettings>

<add key=”PublicKey” value=”Enter your access key here”/>

<add key=”SecretKey” value=”Enter your secret key here”/>

</appSettings>

Note: In production, we would always encrypt web.config, but that would be out of scope   for this tutorial exercise. Furthermore, it is always a good practice to use one’s AWS Identity and Access Management (IAM) user accounts, instead of the master credentials.

Here is the procedure to modify the code so that it points to your Amazon CloudFront distribution or Amazon S3 bucket:

  • Open “default.aspx.cs” on your Amazon EC2 instance, and replace “http://your-non-dotted-bucket-name.s3.amazonaws.com/” with the name of your Amazon CloudFront distribution or Amazon S3 bucket. (For ex: In the section Creating a CloudFront Distribution, our Amazon CloudFront distribution is d18k4jybr69gw2.cloudfront.net.)

 default.aspx - 1

  • Open “default.aspx.cs” and replace “your-non-dotted-bucket-name” with the name of your Amazon S3 bucket. “For ex: In the section Creating an Amazon S3 Bucket, our Amazon S3 bucket is webapplication.)

Note: You should ensure that you don’t forget the trailing slash for your Amazon S3 bucket or your Amazon CloudFront distribution.

public partial class _Default : System.Web.UI.Page

{

public string PhotoGalleryBaseUrl = “http://d18k4jybr69gw2.cloudfront.net/”;

…

private const string ImageBucketName = “webapplication”;

}

If you had skipped creating the CloudFront distribution, you will have to enter your          Amazon S3 bucket, as shown in the following example:

public partial class _Default : System.Web.UI.Page

{

public string PhotoGalleryBaseUrl = “http://webapplication.s3.amazon

aws.com/”;

…

private const string ImageBucketName = “webapplication”;

}

Note: This code will publish images to your Amazon S3 bucket and set the permissions on each file to be public (readable by everyone).

Here’s the procedure to modify the code so that it points to your Amazon RDS database:

  • Open “default.aspx.cs” and replace the text for the following variables with the actual values. These values are used to build your connection string using MySQL Connector/.NET.
    • Database endpoint
    • Database master user ID
    • Database master password
    • Database name

modify the code so that it points to your Amazon RDS database - 2 

public partial class _Default : System.Web.UI.Page

{

private string dbinstance = “mydbinstance.cgwxy4t1e0xb.us-east-

1.rds.amazonaws.com”;

private string userid =”awsuser”;

private string password =”mypassword”;

private string database =”mydb”;

}

It is time to deploy your sample website now.

Follow these steps to restart your website:

  • Navigate to “Default Web Site” in the IIS Manager, and right-click on it.
  • Select “Manage Web Site” and click on “Restart”.
  • Find the DNS address of the load balancer:
    • In the AWS Management Console, click on the “Amazon EC2” tab.
    • In the “Navigation” pane, click on “Load Balancers”.
    • In the “Load Balancers” pane, click on “MyLB”, and note the public DNS in the bottom pane.

Find the DNS address of the load balancer - 3

    • Now, you need to type the DNS address of the load balancer in your web browser to verify that your application is still working.
    • There are no images in the current Amazon RDS database, and so there will be no images seen. You should upload images (less than or equal to 4 MB) to the website, and check whether they are being displayed correctly.

Note: You may not be connected to your Amazon RDS database if you’re having trouble in displaying the images. Ensure that you’ve typed your Amazon EC2 security group correctly while authorizing access for the database security group. You should try to re-authorize your Amazon EC2 security group if the problem persists.

Congratulations! You have been successful in deploying a sample web application using Amazon Web Services. Now, if you decide you want to launch more instances in the future, there is no need to customize each one.

Let us now move on, and create a custom Amazon Machine Image (AMI) with all the configuration changes we’ve just made.

 

Read more »

Setting Up an Auto-Scaled and Load-Balanced Amazon EC2 Application

The following steps will instruct you on how to set up an auto-scaled, load-balanced Amazon EC2 Application:

1)     Firstly, you will need to open a command prompt window on your computer.

(In Microsoft Windows, this can be done by starting the command prompt application (You can start it from the Start menu by clicking on Programs, then clicking on Accessories, and finally clicking on Command Prompt)).

2)     Now, you will need to use the Auto Scaling “as-create-launch-config” command.

For this particular example, we will be using a publicly available Windows AMI, running Microsoft Windows Server 2008 and Microsoft Internet Information Services (IIS).We will use a “t1.micro” instance type, and use the security group and key pair that we have already created in the previous steps. In this particular example, the key pair file is located in the same directory in which we are creating our Auto Scaling group. Also, we will not be specifying a region, as we are using the default region, US East (Virginia).

Note: The AMI being used in this particular example is a part of the AWS Free Usage Tier. Those eligible for the free tier will not be charged for launching the Amazon EC2 instance. However, if you are ineligible for the AWS Free Usage Tier, the charges incurred in this example are still minimal. For further information regarding Amazon EC2 pricing, please refer to the Amazon Elastic Compute Cloud (Amazon EC2) details page.

PROMPT> as-create-launch-config MyLC -image-id ami-498d5520 -instance-typet1.micro -group webappsecuritygroup -key mykeypair 

Auto Scaling will return the following:

OK-Created launch config 

Note: For ease, you can copy/paste the commands from the document into the command line window. To successfully copy/paste the contents in the command line window, use the right-click button on your mouse. If you still have trouble in getting the commands to work, please ensure that the command was pasted correctly.

3)    You will now be using the Auto Scaling “as-create-auto-scaling-group” command.

In this particular example, we will be using two Availability Zones. This is a very good way of building fault-tolerant applications, for if one Availability Zone experiences an outage, traffic will automatically be routed to another Availability Zone. Also, the number of instances being launched in the Auto-Scaling group will be automatically, and evenly, distributed across the Availability Zones.

PROMPT>as-create-auto-scaling-group MyAutoScalingGroup -launch-configuration MyLC -availability-zones us-east-1b, us-east-1c -min-size 1 -max-size 1 -load-balancers MyLB 

Auto Scaling will return an output which is similar to the following example output:

OK-Created AutoScalingGroup 

4)      Now, we will use the Auto Scaling “as-put-scaling-policy” command, and create a policy that will enlarge your fleet of instances.

PROMPT>as-put-scaling-policy MyScaleUpPolicy -auto-scaling-group MyAutoScal

ingGroup -adjustment=1 -type ChangeInCapacity -cooldown 300

Auto Scaling will again return an output similar to the following example output:

POLICY-ARN arn:aws:autoscaling:us-east-1:012345678901:scalingPolicy:cbe7da4e-5d00-4882-900a 2f8113431e30:autoScalingGroupName/MyAutoScalingGroup:policyName/MyScaleUpPolicy 

Note: In this particular example, we are only creating a scale-out policy to save time. However, you should create a scale-in policy as well. Auto-Scaling helps in decreasing the number of instances when an application doesn’t need the resources, thus saving you money. To successfully create a scale-in policy, change the policy name, and also change the adjustment from 1 to -1.

5)      Finally, we will verify the existence of your Auto Scaling group, by using the “as-describe-auto-scaling-groups” command.

PROMPT>as-describe-auto-scaling-groups MyAutoScalingGroup -headers 

Auto-Scaling will return the following:

AUTO-SCALING-GROUP GROUP-NAME LAUNCH-CONFIG AVAILABILITY-ZONES

MIN-SIZE MAX-SIZE DESIRED-CAPACITY

AUTO-SCALING-GROUP MyAutoScalingGroup MyLC us-east-1b,us-east-

1c 1 1 1

INSTANCE INSTANCE-ID AVAILABILITY-ZONE STATE STATUS LAUNCH-CONFIG

INSTANCE i-xxxxxxxx us-east-1c InService Healthy MyLC

Congratulations! You have just launched an auto-scaled and load-balanced Amazon EC2 application. For further information on Auto-Scaling, please refer to the Auto-Scaling   Documentation. Costs will be incurred by you as long as your Amazon EC2 instances are running. To terminate these instances, please refer to the How to Terminate EC2 Instances section.

 

Read more »

Connecting to Your Amazon EC2 Instance

The first step towards connecting a Windows instance is to retrieve the initial administrator password, and use it with Remote Desktop. To do this, you will need contents of the private key file that you created previously in the Creating a Key Pair section (For ex: mykeypair.pem).

Note: It may take up to 30 minutes to get the original password from the moment you launched your Amazon EC2 instance.

1)      Firstly, you need to connect to your Windows instance. To do so:

  • Retrieve the auto-generated administrator password:
    • Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
    • Locate the instance on the “Instances” page.
    • Right-click on the instance and select “Get Windows Password”.

The “Retrieve Default Windows Administrator Password” dialog box appears (it can take a few minutes before the password is available).

 Connecting to Your Amazon EC2 Instance - Retrieve - 1

You need to click on the “Browse” button to locate your private key file.

Connecting to Your Amazon EC2 Instance - Retrieve - 2

  • Click on the “Decrypt Password” button. Upon doing so, the console will return the default administrator password for the instance.
  • Now you should save the password. You need it to successfully connect to the instance.

Note: This step will only work for a new Amazon EC2 instance. Once you have changed    the administrator password, or created a custom AMI, you will need to remember the password.

 2)      The next step is to connect to the instance using Remote Desktop:

  •  Start the Remote Desktop application (from the Start menu, select All Programs, then select Accessories, and finally click on “Remote Desktop Connection”).
    •  Note: Most modern Windows OS (from Windows XP onwards) already include the Remote Desktop application. However, if you’re using an older version of Windows, you can download the application from the Microsoft website.
  • Select “Options”, and make sure that a domain is not specified.
  • Enter the public DNS name of the instance, and click on the “Connect” button.

 Connecting to Your Amazon EC2 Instance - My instances - 3

  • Log-in using “Administrator” (without the quotes) as the username, and input the administrator password you that you have just received.

Note: You also have the option to copy and paste the password (using Ctrl+C and Ctrl+V).

You have now successfully connected to your instance, and can work with it in the same way you would work with any other Windows server.

Caution: It is recommended that you change the Windows administrator password from the default value once you’ve connected to any new Windows instance that has just been launched.

Also, you should start by ensuring that you can connect to the server with Internet Information Services (IIS) Manager.

Here’s how to connect to the server with IIS Manager:

  • From your Amazon EC2 instance, click “Start”.
  • Click “Administrative Tools”.
  • Click “Internet Information Services (IIS) Manager”.
  • Expand the “localhost” node.
  • Expand the “Sites” node.

Connecting to Your Amazon EC2 Instance - connect to the server with IIS Manager - 4

  • Right-click on “Default Web Site”.
  • Select “Manage Web Site” and click “Start”.
  • Finally, paste the public DNS address of your load balancer into your browser, to ascertain that you can connect to the site.

 Connecting to Your Amazon EC2 Instance - paste the public DNS address  - 5

Now that we have ensured that the server is working properly, we can move on to the next step, of deploying a sample application to our Amazon EC2 instance.

Deploying a Sample Application

In this section, we will download a sample ASP.NET application, grant write access to the appropriate folders and files, and also configure IIS so that it points to the new application on our Amazon EC2 instance.

Here’s the procedure through which you can download the sample application:

1)      Create a folder called ImageGallery on your root directory (c:\ImageGallery). This will serve as a folder for the sample application.

2)      Add the website location for the BaseImageGallery application to the trusted sites list on your Amazon EC2 instance:

  • Run Internet Explorer from the Start menu in the Amazon EC2 instance.
  • Click on the gear icon (on the top right corner).
  • Click on “Internet Options”.
  • Click on the “Security tab”.
  • Click on “Trusted Sites”, and then click “Sites”.
  • Add https://s3.amazonaws.com, and click “Close”.
  • Click on the “Advanced” tab.
  • Scroll down to the “Security” section.
  • Un-check “Do not save encrypted pages to disk”, and click “OK”.

3)     Now, we are going to download the application:

  • Using Internet Explorer from your Amazon EC2 instance, type https://s3.amazonaws.com/aws-sdk-samples/.NET/BaseImageGallery.zip (without quotes) on your browser.

Note: This URL is case-sensitive, and the zip file is a .NET application.

  • Once the “File Download” dialog box appears, click “Save”. You need to save the file to c:\ImageGallery.

 Note: If you are receiving an error stating that Internet Explorer is unable to download the file, close the error dialog, and try downloading the application again in the same browser window.

  • Now, you are required to paste the contents of the ImageGallery folder (which is found inside the zip file) into C:/ImageGallery, so that the individual files sit directly under it.

Connecting to Your Amazon EC2 Instance - ImageGallery folder - 6 

Here’s the procedure to modify the physical path of your default website:

  • Open IIS Manager on your Amazon EC2 instance, and navigate to the Default Website once again.
  • Right-click on “Default Web Site”.
  • Select “Manage Web Site”, and click on “Advanced Settings”.
  • In the “Physical Path” box, type “c:\ImageGallery” (without the quotes), and then click “OK”.

 Connecting to Your Amazon EC2 Instance - Physical Path - 7

Read more »

Creating a DB Security Group

1)      The first step towards creating a DB Security Group is to provide a name and description:

  • Sign-in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.
  • In the “Navigation” pane select “US East” from the “Region” drop-down menu.
  • Click “DB Security Groups” in the “Navigation” list on the left side of the window.
  • Click the “Create DB Security Group” button.

The “Create DB Security Group” window will appear.

  • You need to type the name of your new DB Security Group in the “DB Security Group” text box. For this particular example, we will type “mydbsecuritygroup” (without the quotes).
  • You also have to type a description for your DB Security Group in the “Description” text box.
  • Click on the “Yes, Create” button.

2)      Now, you will need to authorize your Amazon EC2 security group, and grant it access to your DB Security Group:

  • Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.
  • In the “Navigation pane” you need to select “US East” from the “Region” drop-down menu.
  • Now, click on “DB Security Groups” in the “Navigation” list (on the left side of the window), and select “mydbsecuritygroup”.
  • Select “EC2 security group” in the drop-down menu on the “Connection Type” column.
  • In the “Details” column, you should click “webappsecuritygroup” in the “EC2 Security Group” list.
  • In the “Details” column, your AWS Account ID will appear in the “AWS Account ID” box. To change the AWS Account ID, click “Change”, and type your AWS Account ID in the “AWS Account ID” box.

Note: You should make sure that all hyphens have been removed while typing your account ID.

  • Now, you need to click “Add” in the “Actions” column.

Authorization will take place in a few minutes. Once the security group is authorized, the “Status” column will say “Authorized”. Now, we will move on and launch your first Amazon RDS database.

3)      Here is how you can launch an instance by starting the launch wizard:

  • Sign in to the AWS Management Console and open the Amazon RDS console at https://console.aws.amazon.com/rds/.
  • Now, click on the “Amazon RDS” tab in the AWS Management Console

Note: The AWS Management Console will log you out automatically if you pause for a long time while carrying out this procedure. However, you can stay logged in by clicking “Settings” (in the top right corner of the console window), and clearing the “Sign out on inactivity” check box.

  • Now, you need to select “US East” from the “Region” drop-down menu in the “Navigation” pane.
  • To start the “Launch DB Instance Wizard”, click “Launch Database Instance” from the Amazon RDS Console Dashboard

The wizard will automatically open on the “ENGINE SELECTION” page.

Launch DB Instance wizard

  • Click the “Select” button (next to the MySQL database engine).

The wizard will continue to the “DB Instance Details” page. The first page of the wizard always displays a list of DB Instance Classes in the “DB   Instance Class” drop - down list. The CPU and memory capacity of your DB Instance is defined by DB Instance Class.

Launch DB Instance wizard 2

  • On the “DB INSTANCE DETAILS” page, you are required to specify your DB Instance details (as shown in the following table), and then click on the “Continue” button.

For this parameter…

Do this
License Model Keep the default: general-public-license.
DB Engine Version Keep the default: 5.1.57 (default).
DB Instance Class Select db.m1.small.
Multi-AZ Deployment Keep the default setting of Yes. Although the Multi-AZ deployment is more expensive, it is a best practice.
Auto Minor Version Upgrade Keep the default setting of Yes for this example.The Auto Minor Version Upgrade option enables your DB Instance to receive minor engine version upgrades automatically when they become available.
Allocated Storage You can specify how much storage in gigabytes you want initially allocated for your DB Instance. For this example, type 5.
DB Instance Identifier The DB Instance is a name for your DB Instance that is unique for your account in a Region.Type mydbinstance in the DB Instance Identifier text box.
Master Username Type a name for your master user in the Master Usernametext box.You use the master user name to log on to your DBInstance with all database privileges.
Master Password

Type a password for your master user in the Master User

Password text box.

 

 

 

 

 

 

 

 

 

 

 

 

Important Note: Your password can only contain 4 to 16 alphanumeric characters.

Upon clicking the “Continue” button, the “ADDITIONAL CONFIGURATION” page will appear.

Launch DB Instance wizard 3

  • Type “mydb” (without quotes) into the “Database Name” text box. The database name is provided by you so that Amazon RDS can create a default database on your DB Instance. Amazon RDS will not create a database on your DB Instance if you skip this step.
  • Select “mydbsecuritygroup” in the “DB Security Groups” box.
  • For all the other parameters available on this page, accept the default values, and then click the “Continue” button.

The “MANAGEMENT OPTIONS” page will be seen now. This page is used to specify maintenance and backup options for your DB Instance.

  • For this particular example, we will accept all the default values, and click on the “Continue” button.

The “REVIEW” panel will appear now.

4)      Now it is time to review all the options for your DB Instance.

  • Click “Back” to return to previous pages if you need to correct any options.
  • After checking to ensure that all your options are entered correctly, click on the “Launch DB Instance” button to launch your new DB Instance.

A message will appear saying “Your DB Instance is being created”. Be patient as this process can take a few minutes to complete.

  • Click “Close”.

The “My DB Instances” panel will appear now. Your DB Instance will appear in the list on this page with the status “creating”, until your DB Instance is finally created, and is ready for use.

         Once your DB Instance status changes to “available”, you will be billed for each hour in which your DB Instance is running, even if it is idle.

Read more »

  • 1
  • 2
  • 3
  • Older Posts →
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.