--- AWSTemplateFormatVersion: "2010-09-09" Description: Nested stacks for GLE blog Parameters: S3BucketName: AllowedPattern: ^[0-9a-zA-Z]+([0-9a-zA-Z-.]*[0-9a-zA-Z])*$ ConstraintDescription: Bucket name can include numbers, lowercase letters, uppercase letters, periods (.), and hyphens (-). It cannot start or end with a hyphen (-). Description: S3 bucket name for the Nested Stacks. S3 bucket name can include numbers, lowercase letters, uppercase letters, and hyphens (-). It cannot start or end with a hyphen (-). Type: String AvailabilityZones: Type: List Description: The list of Availability Zones to use for the subnets in the VPC. VPCName: Type: String Description: The name of the VPC. Default: cfn-workshop-vpc VPCCidr: Type: String Description: The CIDR block for the VPC. AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$ ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/16-28 Default: 10.0.0.0/16 PublicSubnet1Cidr: Type: String Description: The CIDR block for the public subnet located in Availability Zone 1. AllowedPattern: ^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])(\/([0-9]|[1-2][0-9]|3[0-2]))$ ConstraintDescription: CIDR block parameter must be in the form x.x.x.x/16-28 Default: 10.0.0.0/24 Resources: VpcStack: Type: AWS::CloudFormation::Stack Properties: TemplateURL: !Sub https://${S3BucketName}.s3.amazonaws.com/vpc.yaml TimeoutInMinutes: 20 Parameters: AvailabilityZones: Fn::Join: - ',' - !Ref AvailabilityZones VPCCidr: !Ref VPCCidr VPCName: !Ref VPCName PublicSubnet1Cidr: !Ref PublicSubnet1Cidr IamStack: Type: AWS::CloudFormation::Stack Properties: TemplateURL: !Sub https://${S3BucketName}.s3.amazonaws.com/iam.yaml TimeoutInMinutes: 10 EC2Stack: Type: AWS::CloudFormation::Stack Properties: TemplateURL: !Sub https://${S3BucketName}.s3.amazonaws.com/ec2.yaml TimeoutInMinutes: 20 Parameters: VpcId: !GetAtt VpcStack.Outputs.VpcId SubnetId: !GetAtt VpcStack.Outputs.PublicSubnet1 WebServerInstanceProfile: !GetAtt IamStack.Outputs.WebServerInstanceProfile RGStack: Type: AWS::CloudFormation::Stack Properties: TemplateURL: !Sub https://${S3BucketName}.s3.amazonaws.com/rg.yaml TimeoutInMinutes: 20 Parameters: StackId: !GetAtt EC2Stack.Outputs.StackId