Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

AWS CloudFormation template with single & redundant system

6,921 views

Published on

* Use CloudFormation to create Stacks composed of VPC, Internet Gateway, Route Table, ELB, EC2 Instance, EBS Volumes
* Single pattern with EC2 Instances WEB server and DB server with the same AZ
* Redundant pattern with EC2 Instances WEB server and DB server with multi-AZ

Published in: Technology
  • My brother found Custom Writing Service ⇒ www.WritePaper.info ⇐ and ordered a couple of works. Their customer service is outstanding, never left a query unanswered.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Have u ever tried external professional writing services like ⇒ www.HelpWriting.net ⇐ ? I did and I am more than satisfied.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • You can hardly find a student who enjoys writing a college papers. Among all the other tasks they get assigned in college, writing essays is one of the most difficult assignments. Fortunately for students, there are many offers nowadays which help to make this process easier. The best service which can help you is ⇒ HelpWriting.net ⇐
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD FULL BOOKS, INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

AWS CloudFormation template with single & redundant system

  1. 1. AWS CloudFormation template with single & redundant system 3/1/2014 Naoya Hashimoto
  2. 2. Table of Contents • • • • • • • • • Overview System Architecture - Network System Architecture - EC2 Template Structure - Dependency & Resources Template Structure - Function Template Structure - RPM packages Operation Manual - AWS CLI (1) Operation Manual - AWS CLI (2) Operation Manual - AWS CLI (3)
  3. 3. Overview • • • • • Use CloudFormation to create Stacks composed of VPC, Internet Gateway, Route Table, ELB, EC2 Instance, EBS Volumes Single pattern with EC2 Instances WEB server and DB server with the same AZ Redundant pattern with EC2 Instances WEB server and DB server with multi-AZ Install LAMP package with Cloud-init Add & resize another EBS Volumes for WEB server and DB Server Stack – redundant pattern Stack – single pattern AWS CloudFormation Amazon VPC Elastic Load Balancing WEB on Instance Availability Zone Internet Gateway DB on Instance WEB on Instance DB on Instance Availability Zone Elastic Load Balancing DB on Instance WEB on Instance Route Table Availability Zone 2014/3/1 3
  4. 4. System Architecture - Network vpc.template Name AvailabilityZone Role SubnetPublicVarA00 ap-northeast-1a ELB SubnetPublicVarC01 ap-northeast-1c ELB SubnetPublicVarA02 ap-northeast-1a Instances in AutoScaling Group SubnetPublicVarC03 ap-northeast-1c Instances in AutoScaling Group SubnetPublicFixA08 ap-northeast-1a Instances in Fixed IP address SubnetPublicFixC09 ap-northeast-1c Instances in Fixed IP address 2014/3/1 4
  5. 5. System Architecture - EC2 cloudformation-single.template vpc.template ec2-single.template cloudformation-redundant.template vpc.template ec2-redundant.template 2014/3/1 5
  6. 6. Template Structure - Dependency & Resources Single Redundant ① cloudformation-redundant.template ① cloudformation-single.template AWS::CloudFormation::Stack AWS::CloudFormation::Stack ② vpc.template AWS::EC2::InternetGateway AWS::EC2::NetworkAcl AWS::EC2::NetworkAclEntry AWS::EC2::Route AWS::EC2::RouteTable ③ ec2-single.template AWS::EC2::Subnet AWS::EC2::SubnetNetworkAclAssociation AWS::EC2::SubnetRouteTableAssociation AWS::EC2::VPC AWS::EC2::VPCGatewayAttachment AWS::CloudFormation::WaitCondition AWS::CloudFormation::WaitConditionHandle AWS::EC2::EIP AWS::EC2::Instance AWS::EC2::SecurityGroup AWS::ElasticLoadBalancing::LoadBalancer ③ ec2-redundant.template AWS::CloudFormation::WaitCondition AWS::CloudFormation::WaitConditionHandle AWS::EC2::EIP AWS::EC2::Instance AWS::EC2::SecurityGroup AWS::ElasticLoadBalancing::LoadBalancer 2014/3/1 6
  7. 7. Template Structure - Function overview Single Redundant cloudformation-redundant.template cloudformation-single.template Base template for single, redundant pattern Add output values from nested stacks Input key to the following items(values): VPC CIDR, Instance Type, Volume Size, SSH KeyName, SecurityGroup CIDR(Customer’s GW, Office GW, Monitoring Server’s GW), DB Root Password Pass the parameters to the nested stack Output the parameters VPC CIDR, Subnet ID , Instance Type, Instance ID, EIP, Volume Size, SecurityGroup CIDR(Customer GW, Own Office GW, Monitoring Server GW) vpc.template Common template for single, redundant pattern Create the following resources: VPC, Subnet, Network ACL, Internet GW, Routing Table ec2-single.template ec2-redundant.template EC2 resource template for single, redundant pattern Create the following resources: Instance, EBS Volume, ELB, EIP, Security Groups Install Apache, PHP, MySQL Enable/Disable the services will be started automatically upon boot Create a linux user, opuser for Attach another EBS Volumes, create file system and resize them 2014/3/1 7
  8. 8. Template Structure - RPM packages • Common o gcc, gcc-c++, make, wget, unzip, git, ntp, openssl o sendmail, postfix • WEB Server o mod_ssl, httpd, httpd-devel, httpd-tools • DB Server o mysql, mysql-devel, mysql-embedded-devel, mysql-libs, mysql-server ※Using MySQL Community repository(http://repo.mysql.com/mysql-communityrelease-el6.rpm) to install MySQL via yum on CentOS. 2014/3/1 8
  9. 9. Operation Manual - AWS CLI (1) Precondition • Login to Amazon Linux AMI to deploy stack. • Grant IAM Role with administrator privilege on the instance. 2014/3/1 9
  10. 10. Operation Manual - AWS CLI (2) • Template PATH on github https://github.com/hashnao/aws-cloudformation/tree/master/EC2 • Validate template $ git clone https://github.com/hashnao/aws-cloudformation $ cd aws-cloudformation-master/EC2/ $ aws cloudformation validate-template --template-body file://$PWD/cloudformation-single.template • Create Stack $ aws cloudformation create-stack --capabilities CAPABILITY_IAM --template-body file://$PWD/cloudformation-single.template --stack-name <Stack Name> --parameters ParameterKey=CustomerName,ParameterValue=<Character string> --parameters ParameterKey=DBRootPasssword,ParameterValue=<Character string> --parameters ParameterKey=InstanceTypeDB,ParameterValue=<Instance Type> --parameters ParameterKey=InstanceTypeWeb,ParameterValue=<Instance Type> --parameters ParameterKey=KeyName,ParameterValue=<SSH KeyName> --parameters ParameterKey=SecurityGroupCidrCustomer,ParameterValue=<CIDR> --parameters ParameterKey=SecurityGroupCidrMonitor,ParameterValue=<CIDR> --parameters ParameterKey=SecurityGroupCidrOffice,ParameterValue=<CIDR> --parameters ParameterKey=VolumeSizeDB,ParameterValue=<Number> --parameters ParameterKey=VolumeSizeDB,ParameterValue=<Number> --parameters ParameterKey=VPCCIDR,ParameterValue=<1st and 2nd octet> • Describe stack $ aws cloudformation describe-stacks --stack-name <Stack Name> • List stack resource $ aws cloudformation list-stack-resources --stack-name <Stack Name> • Describe Stack Events $ aws cloudformation describe-stack-events --stack-name <Stack Name> 2014/3/1 10
  11. 11. Operation Manual - AWS CLI (3) ※Sample command with parameters • Create Stack $ aws cloudformation create-stack --capabilities CAPABILITY_IAM --template-body file://$PWD/cloudformation-single.template --stack-name samplesingle --parameters ParameterKey=CustomerName,ParameterValue=samplesingle --parameters ParameterKey=DBRootPasssword,ParameterValue=mysql00 --parameters ParameterKey=InstanceTypeDB,ParameterValue=t1.micro --parameters ParameterKey=InstanceTypeWeb,ParameterValue=t1.micro --parameters ParameterKey=KeyName,ParameterValue=default --parameters ParameterKey=SecurityGroupCidrCustomer,ParameterValue=0.0.0.0/0 --parameters ParameterKey=SecurityGroupCidrMonitor,ParameterValue=0.0.0.0/0 --parameters ParameterKey=SecurityGroupCidrOffice,ParameterValue=0.0.0.0/0 --parameters ParameterKey=VolumeSizeDB,ParameterValue=10 --parameters ParameterKey=VolumeSizeDB,ParameterValue=10 --parameters ParameterKey=VPCCIDR,ParameterValue=10.0 2014/3/1 11
  12. 12. Now, OpsWorks is waiting! 2014/3/1 12

×