You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using our existing CloudFormation template, configure it to accept a parameter to change the instance type, AMI (typed), and add another security group rule that allows incoming traffic on port 443.
524
+
Write a CloudFormation template that does the following:
525
+
526
+
- `AWSTemplateFormatVersion`defined to `2010-09-09`.
527
+
- `Description`defined to `Lab stack.`.
528
+
- Accepts a parameter called `DesiredCapacity`, that is a `Number`, and defaults to 0.
529
+
- Accepts a parameter called `MinSize`, that is a `Number`, and defaults to 0.
530
+
- Accepts a parameter called `MaxSize`, that is a `Number`, that defaults to 1.
531
+
- Accepts a parameter called `AmiId`, that is a `AWS::EC2::Image::Id`, that defaults to `ami-f2d3638a `.
532
+
- Accepts a parameter called `InstanceType`, that is a `String`, that defaults to `t2.micro`. It should restrict the options to `["t2.micro", "t2.medium"]`.
533
+
- Accepts a parameter called `VpcId`, that is a `AWS::EC2::VPC::Id`.
534
+
- Accepts a parameter called `DefaultKeyPair` that is a `AWS::EC2::KeyPair::KeyName`.
535
+
- Accepts a parameter called `SubnetIds`, that is a `List<AWS::EC2::Subnet::Id>`.
536
+
- Creates a security group named `LabSg` which has:
537
+
+ Egress rule to MySQL (3306) on CIDR block `0.0.0.0/0`.
538
+
+ Egress rule to HTTP (80) on CIDR block `0.0.0.0/0`.
539
+
+ Egress rule to HTTPS (443) on CIDR block `0.0.0.0/0`.
540
+
+ Ingress rule to HTTP (80) on CIDR block `0.0.0.0/0`.
541
+
+ Ingress rule to HTTP (443) on CIDR block `0.0.0.0/0`.
542
+
- Create a launch configuration named `LabLaunchConfig` which:
543
+
+ References `DefaultKeyPair`
544
+
+ References `AmiId`
545
+
+ References `LabSg`
546
+
+ References `InstanceType`
547
+
- Create a auto scaling group named `LabAsg` which:
0 commit comments