Guide To Know Advanced Level in Bootstrapping on AWS This 2018
This publication will review the hosting process for a high availability corporate site using the Windows Server 2012 machine image (AMI) and will start installing Internet Information Services (IIS), urlrewrite, and our site. . We do not need a golden image, since we launch software every week. We also want to make sure that it is a high availability solution, so we need to analyze the sizing groups and repeatability.
Stack of high availability cloud training for web servers
HIGH-AVAILABILITY CLOUD TRAINING PILE FOR WEB SERVERS
Our high availability solution will contain a load balancer and a minimum of two instances of Elastic Compute Cloud (EC2) in multiple availability zones (AZ). In this case, our stack will be created using CloudFormation and, using that, we can repeat the process in various environments. Let's make some assumptions, too. Here provides Best aws training in bangalore
VIDEO 1.1 AWS COURSE IN BANGALORE
The site source code was created and compressed into files with the build number as a name, ie - 1.zip
The previous build was uploaded to Simple Storage Service (S3)
Appropriate permissions for the S3 access instance and the objects have already been applied
The process
We start with a blank template of CloudFormation
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "",
"Parameters" : {
},
"Resources" : {
},
"Outputs" : {
}
}
We start with the basics: the first thing we need is an elastic load balancer. We have defined this in the "Features" section of the template.
...
"Resources" : {
"WebLoadBalancer" : {
"Type" : "AWS::ElasticLoadBalancing::LoadBalancer",
"Properties" : {
"AvailabilityZones" : {"Fn::GetAZs" : ""},
"Listeners" : [{
"LoadBalancerPort" : "80",
"InstancePort" : "80",
"Protocol" : "HTTP"
}]
}
}
}
The second thing we need are instances that will respond to the load balancer. However, an important point here is that although CloudFormation allows us to instantiate directly, we do not want to do so. In doing so, we have lost the ability offered by the AWS Magic Sauce to ensure that a minimum number of instances is executed. So, instead, we need two pieces. A scaling group to manage instance availability and a startup configuration to allow the scaling group to start new instances. We'll start with the scheduling group. Best aws training in chennai
"WebServerScalingGroup" : {
"Type" : "AWS::AutoScaling::AutoScalingGroup",
"Properties" : {
"AvailabilityZones" : { "Fn::GetAZs" : "" },
"LaunchConfigurationName" : { "Ref" : "WebServerLaunchConfiguration" },
"MinSize" : "2",
"MaxSize" : "4",
"LoadBalancerNames" : [{"Ref" : "WebLoadBalancer"}]
}
}
VIDEO 1.2 AMAZON
The above code snippet creates a scaling group on all free zones (Fn :: GetAZs) with a minimum of two instances and a maximum of four instances. It will respond to the WebLoadBalancer requests we defined earlier and, when necessary, will initiate new instances using the Web server configuration configuration that we will define below. And that's where it gets tricky. First, we'll use a default AMI for Windows Server 2012 so that when AWS updates it, we can only connect to the latest version. Out of the box, this is missing IIS, and also, critically for us, the UrlRewrite module. Installing IIS is relatively easy, since Windows provides administration through PowerShell, but installing UrlRewrite and our source code becomes a bit more difficult. We will start with the basic CloudFormation script and, using the user data, we will start installing IIS.
"WebServerLaunchConfiguration" : {
"Type" : "AWS::AutoScaling::LaunchConfiguration",
"Properties" : {
"IamInstanceProfile" : { "Ref" : "WebServerProfile" },
"ImageId" : "ami-1223b028",
"InstanceType" : "m1.small",
"KeyName" : "production",
"SecurityGroups" : ["web", "rdp"],
"UserData" : { "Fn::Base64" : { "Fn::Join" : ["", [
"<script>\n",
"powershell.exe add-windowsfeature web-webserver -includeallsubfeature -logpath $env:temp\\webserver_addrole.log \n",
"powershell.exe add-windowsfeature web-mgmt-tools -includeallsubfeature -logpath $env:temp\\mgmttools_addrole.log \n",
"cfn-init.exe -v -s ", {"Ref" : "AWS::StackId"}, " -r WebServerLaunchConfiguration --region ", {"Ref" : "AWS::Region"}, "\n",
"</script>\n",
"<powershell>\n",
"new-website -name Test -port 80 -physicalpath c:\\inetpub\\Test -ApplicationPool \".NET v4.5\" -force \n",
"remove-website -name \"Default Web Site\" \n",
"start-website -name Test \n",
"</powershell>"
]]}
"Metadata" : {
"BuildNumber" : { "Ref" : "BuildNumber" },
"AWS::CloudFormation::Authentication" : {
"default" : {
"type" : "s3",
"buckets" : ["test-production-artifacts"],
"roleName" : { "Ref" : "BuildAccessRole" }
}
},
"AWS::CloudFormation::Init" : {
"config" : {
"sources" : {
"c:\\inetpub\\test" : {"Fn::Join" : ["",[
"https://artifacts.s3.amazonaws.com/", {"Ref":"BuildNumber"},".zip"
]]}
},
"packages" : {
"msi" : {
"urlrewrite" : "http://download.microsoft.com/download/6/7/D/67D80164-7DD0-48AF-86E3-DE7A182D6815/rewrite_2.0_rtw_x64.msi"
}
},
}
}
}
}
},
The previous model is a fairly standard release configuration for a basic installation. Customization comes when we start looking at the UserData property. User data must be passed as a Base64 string; therefore, the enigmatic command Fn :: Base64 at the top. (Be legal if AWS can simply accept straight sequences and encode them, if necessary). The code included in the <script> tags runs as a batch file, and the code included in <powershell> runs through powershell. Both batch and powershell scripts run with elevated privileges. I used both types mainly for illustration.
The first part of the script installs the web server components and all their secondary roles and logs into the temporary administrators folder. This is the default Windows PowerShell script for IIS. The second component is cfn-init. This is an auxiliary script that parses the AWS :: CloudFormation :: Init section of the provided metadata. In the Metadata section, we include a build number that is appended to each instance and is provided as a parameter to the cloud build script.
There is also a "source" element, which is a link to a dynamically created zip file according to the build number, that is, http://artifacts.s3.amazonaws.com/1.zip that represents build 1. The cfn-init script knows how to expand the zip file in the location provided by the property name. The next element is the package property and the urlrewrite property provides a download msi for the UrlRewrite module. Cfn-init will run this msi and install the module on our previously configured server.
After you complete the script components: such as IIS configuration, source code installation, and module installation, the boot process is moved to the power box section. Once again, going back to the basic configuration of IIS, we created a new site that points to the source download folder, removed the previous folder and started it. The final part is to add the build number as a parameter to the "parameters" section. This represents the name of the file (without the .zip extension).
"Parameters" : {
"BuildNumber" : {
"Type" : "Number"
}
},
So to launch a new build, you can now copy 2.zip to s3 and run a cloud training update by passing 2 in the build parameter. Once this is done, delete each server and the automatic escalation group will automatically create new servers, but this time they will install the 2.zip on the site.
FIG1.2 AMAZON WEB SERVICES TRAINING
![]() |
| FIG1.1 AWS TRAINING IN BANGALORE |
Stack of high availability cloud training for web servers
HIGH-AVAILABILITY CLOUD TRAINING PILE FOR WEB SERVERS
Our high availability solution will contain a load balancer and a minimum of two instances of Elastic Compute Cloud (EC2) in multiple availability zones (AZ). In this case, our stack will be created using CloudFormation and, using that, we can repeat the process in various environments. Let's make some assumptions, too. Here provides Best aws training in bangalore
VIDEO 1.1 AWS COURSE IN BANGALORE
The site source code was created and compressed into files with the build number as a name, ie - 1.zip
The previous build was uploaded to Simple Storage Service (S3)
Appropriate permissions for the S3 access instance and the objects have already been applied
The process
We start with a blank template of CloudFormation
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "",
"Parameters" : {
},
"Resources" : {
},
"Outputs" : {
}
}
We start with the basics: the first thing we need is an elastic load balancer. We have defined this in the "Features" section of the template.
...
"Resources" : {
"WebLoadBalancer" : {
"Type" : "AWS::ElasticLoadBalancing::LoadBalancer",
"Properties" : {
"AvailabilityZones" : {"Fn::GetAZs" : ""},
"Listeners" : [{
"LoadBalancerPort" : "80",
"InstancePort" : "80",
"Protocol" : "HTTP"
}]
}
}
}
The second thing we need are instances that will respond to the load balancer. However, an important point here is that although CloudFormation allows us to instantiate directly, we do not want to do so. In doing so, we have lost the ability offered by the AWS Magic Sauce to ensure that a minimum number of instances is executed. So, instead, we need two pieces. A scaling group to manage instance availability and a startup configuration to allow the scaling group to start new instances. We'll start with the scheduling group. Best aws training in chennai
"WebServerScalingGroup" : {
"Type" : "AWS::AutoScaling::AutoScalingGroup",
"Properties" : {
"AvailabilityZones" : { "Fn::GetAZs" : "" },
"LaunchConfigurationName" : { "Ref" : "WebServerLaunchConfiguration" },
"MinSize" : "2",
"MaxSize" : "4",
"LoadBalancerNames" : [{"Ref" : "WebLoadBalancer"}]
}
}
The above code snippet creates a scaling group on all free zones (Fn :: GetAZs) with a minimum of two instances and a maximum of four instances. It will respond to the WebLoadBalancer requests we defined earlier and, when necessary, will initiate new instances using the Web server configuration configuration that we will define below. And that's where it gets tricky. First, we'll use a default AMI for Windows Server 2012 so that when AWS updates it, we can only connect to the latest version. Out of the box, this is missing IIS, and also, critically for us, the UrlRewrite module. Installing IIS is relatively easy, since Windows provides administration through PowerShell, but installing UrlRewrite and our source code becomes a bit more difficult. We will start with the basic CloudFormation script and, using the user data, we will start installing IIS.
"WebServerLaunchConfiguration" : {
"Type" : "AWS::AutoScaling::LaunchConfiguration",
"Properties" : {
"IamInstanceProfile" : { "Ref" : "WebServerProfile" },
"ImageId" : "ami-1223b028",
"InstanceType" : "m1.small",
"KeyName" : "production",
"SecurityGroups" : ["web", "rdp"],
"UserData" : { "Fn::Base64" : { "Fn::Join" : ["", [
"<script>\n",
"powershell.exe add-windowsfeature web-webserver -includeallsubfeature -logpath $env:temp\\webserver_addrole.log \n",
"powershell.exe add-windowsfeature web-mgmt-tools -includeallsubfeature -logpath $env:temp\\mgmttools_addrole.log \n",
"cfn-init.exe -v -s ", {"Ref" : "AWS::StackId"}, " -r WebServerLaunchConfiguration --region ", {"Ref" : "AWS::Region"}, "\n",
"</script>\n",
"<powershell>\n",
"new-website -name Test -port 80 -physicalpath c:\\inetpub\\Test -ApplicationPool \".NET v4.5\" -force \n",
"remove-website -name \"Default Web Site\" \n",
"start-website -name Test \n",
"</powershell>"
]]}
"Metadata" : {
"BuildNumber" : { "Ref" : "BuildNumber" },
"AWS::CloudFormation::Authentication" : {
"default" : {
"type" : "s3",
"buckets" : ["test-production-artifacts"],
"roleName" : { "Ref" : "BuildAccessRole" }
}
},
"AWS::CloudFormation::Init" : {
"config" : {
"sources" : {
"c:\\inetpub\\test" : {"Fn::Join" : ["",[
"https://artifacts.s3.amazonaws.com/", {"Ref":"BuildNumber"},".zip"
]]}
},
"packages" : {
"msi" : {
"urlrewrite" : "http://download.microsoft.com/download/6/7/D/67D80164-7DD0-48AF-86E3-DE7A182D6815/rewrite_2.0_rtw_x64.msi"
}
},
}
}
}
}
},
The previous model is a fairly standard release configuration for a basic installation. Customization comes when we start looking at the UserData property. User data must be passed as a Base64 string; therefore, the enigmatic command Fn :: Base64 at the top. (Be legal if AWS can simply accept straight sequences and encode them, if necessary). The code included in the <script> tags runs as a batch file, and the code included in <powershell> runs through powershell. Both batch and powershell scripts run with elevated privileges. I used both types mainly for illustration.
![]() |
| FIG1.1.A AWS TRAINING IN BANGALORE |
The first part of the script installs the web server components and all their secondary roles and logs into the temporary administrators folder. This is the default Windows PowerShell script for IIS. The second component is cfn-init. This is an auxiliary script that parses the AWS :: CloudFormation :: Init section of the provided metadata. In the Metadata section, we include a build number that is appended to each instance and is provided as a parameter to the cloud build script.
There is also a "source" element, which is a link to a dynamically created zip file according to the build number, that is, http://artifacts.s3.amazonaws.com/1.zip that represents build 1. The cfn-init script knows how to expand the zip file in the location provided by the property name. The next element is the package property and the urlrewrite property provides a download msi for the UrlRewrite module. Cfn-init will run this msi and install the module on our previously configured server.
After you complete the script components: such as IIS configuration, source code installation, and module installation, the boot process is moved to the power box section. Once again, going back to the basic configuration of IIS, we created a new site that points to the source download folder, removed the previous folder and started it. The final part is to add the build number as a parameter to the "parameters" section. This represents the name of the file (without the .zip extension).
"Parameters" : {
"BuildNumber" : {
"Type" : "Number"
}
},
So to launch a new build, you can now copy 2.zip to s3 and run a cloud training update by passing 2 in the build parameter. Once this is done, delete each server and the automatic escalation group will automatically create new servers, but this time they will install the 2.zip on the site.
FIG1.2 AMAZON WEB SERVICES TRAINING
AWS TRAINING IN CHENNAI | AMAZON WEB SERVICES TRAINING IN CHENNAI | AWS TRAINING IN VELACHERY | AWS TRAINING IN TAMBARAM | AWS TRAINING IN SHOLINGANALLUR | AWS TRAINING IN ANNA NAGAR | AWS TRAINING IN CHENNAI |
AWS TRAINING IN BANGALORE | AMAZON WEB SERVICES TRAINING IN BANGALORE | AWS TRAINING IN RAJAJI NAGAR| AWS TRAINING IN BTM | AWS TRAINING IN MARATHAHALLI | AWS TRAINING IN JAYANAGAR | AMAZON WEB SERVICES TRAINING IN PUNE | BEST AWS TRAINING IN PUNE | AWS ONLINE TRAINING | AWS ONLINE COURSE TRAINING



Your topic is very nice and helpful to us … Thank you for the information you wrote.
ReplyDeleteLearn Hadoop Training from the Industry Experts we bridge the gap between the need of the industry. Softgen Infotech provide the Best Hadoop Training in Bangalore with 100% Placement Assistance. Book a Free Demo Today.
Big Data Analytics Training in Bangalore
Tableau Training in Bangalore
Data Science Training in Bangalore
Workday Training in Bangalore
AWS is an certification course, without knowing the basics it is difficult to understand the whole concept. Click here to visit cognex technology for AWS training and certification course.
ReplyDelete