AWSTemplateFormatVersion: 2010-09-09 Description: | AWS CloudFormation Sample Template vpc_multiple_subnets, web server, RDS, Autoscaling group adn ALB: Sample template showing how to create an architecture included VPC with multiple subnets. There are two public, two private subnets and one AZ has NAT Instance (it can be used as bastion host) and public subnets routed internet gateway. Both Subnets has contains an EC2 instance behind the load balancer and also basic web server application writte with Django. Autoscaling group is defined for tagte tarkking policy which is set up %80 CPU utilization. Cloudfront is served as cache. This app, send data to the RDS which is located private subnet and also just specific EC2 can reach RDS instance. **WARNING** This template creates an Amazon EC2 instance. You will be billed for the AWS resources used if you create a stack from this template. !!!Please do not forget to change userdata based on your GitHub repository!!! Parameters: VpcCidr: Type: String Description: VPC CIDR. (e.g. 10.0.0.10/16) AllowedPattern: "^(10|172|192)\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\/(16|17|18|19|20|21|22|23|24|25|26|27|28)$" ConstraintDescription: must be valid IPv4 CIDR block (/16 to /28). Default: 10.0.0.10/16 # Public Subnet A PublicSubnetACIDRBlock: Type: String Description: Subnet CIDR for Public Subnet A, (e.g. 10.0.10.10/24) AllowedPattern: "^(10|172|192)\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\/(16|17|18|19|20|21|22|23|24|25|26|27|28)$" ConstraintDescription: must be valid IPv4 CIDR block (/16 to /28). Default: 10.0.10.10/24 # Public Subnet B PublicSubnetBCIDRBlock: Type: String Description: Subnet CIDR for Public Subnet B, (e.g. 10.0.11.10/24) AllowedPattern: "^(10|172|192)\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\/(16|17|18|19|20|21|22|23|24|25|26|27|28)$" ConstraintDescription: must be valid IPv4 CIDR block (/16 to /28). Default: 10.0.20.10/24 # Private Subnet A PrivateSubnetACIDRBlock: Type: String Description: Subnet CIDR for Private Subnet A, (e.g. 10.0.20.10/24) AllowedPattern: "^(10|172|192)\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\/(16|17|18|19|20|21|22|23|24|25|26|27|28)$" ConstraintDescription: must be valid IPv4 CIDR block (/16 to /28). Default: 10.0.11.10/24 # Private Subnet B PrivateSubnetBCIDRBlock: Type: String Description: Subnet CIDR for Private Subnet B, (e.g. 10.0.21.10/24) AllowedPattern: "^(10|172|192)\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\/(16|17|18|19|20|21|22|23|24|25|26|27|28)$" ConstraintDescription: must be valid IPv4 CIDR block (/16 to /28). Default: 10.0.21.10/24 KeyName: Description: The EC2 Key Pair to allow SSH access to the instance Type: "AWS::EC2::KeyPair::KeyName" NotificationEMail: Description: EMail address to notify with Amazon Simple Notification Service if there are any scaling operations Type: String AllowedPattern: ([a-zA-Z0-9_\-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([a-zA-Z0-9\-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?) ConstraintDescription: must be a valid email address. Default: youremail@gmail.com ReadScalingMin: Type: "Number" Default: 3 WriteScalingMin: Type: "Number" Default: 3 BucketName: AllowedPattern: "[a-zA-Z][a-zA-Z0-9]*" ConstraintDescription: must begin with a letter and contain only alphanumeric characters. Default: devenesblog Description: S3 Bucket name configuration file of blog application MaxLength: "64" MinLength: "1" Type: String DBName: AllowedPattern: "[a-zA-Z][a-zA-Z0-9]*" ConstraintDescription: must begin with a letter and contain only alphanumeric characters. Default: database1 Description: Capstone database name MaxLength: "64" MinLength: "1" Type: String DBUser: AllowedPattern: "[a-zA-Z][a-zA-Z0-9]*" ConstraintDescription: must begin with a letter and contain only alphanumeric characters. Description: Database admin account username for RDS Default: admin MaxLength: "16" MinLength: "1" Type: String DBPassword: NoEcho: "true" Description: Password MySQL database access must be between 8 and 41 characters long Type: String MinLength: "8" MaxLength: "41" AllowedPattern: "[a-zA-Z0-9]*" ConstraintDescription: must contain only alphanumeric characters. Default: Devenes1234 PolicyTargetValue: Description: Please enter your Target value that triggers the Autoscaling Default: "80" Type: String MyDomainName: Type: AWS::Route53::HostedZone::Id Description: The DNS name of an existing Amazon Route 53 hosted zone e.g. enes.com CapstoneSubDomainName: Type: String Description: The full domain name e.g. aws.enes.com AllowedPattern: (?!-)[a-zA-Z0-9-.]{1,63}(?