AWSTemplateFormatVersion: 2010-09-09 Parameters: ECSDesiredCount: Type: Number Mappings: ImageMap: us-east-1: HVM: ami-04b9e92b5572fa0d1 us-east-2: HVM: ami-0d5d9d301c853a04a us-west-1: HVM: ami-0dd655843c87b6930 us-west-2: HVM: ami-06d51e91cea0dac8d ap-south-1: HVM: ami-0123b531fc646552f ap-northeast-1: HVM: ami-0cd744adeca97abb1 ap-northeast-2: HVM: ami-00379ec40a3e30f87 ap-southeast-1: HVM: ami-061eb2b23f9f8839c ap-southeast-2: HVM: ami-00a54827eb7ffcd3c ca-central-1: HVM: ami-0d0eaed20348a3389 eu-central-1: HVM: ami-0cc0a36f626a4fdf5 eu-west-1: HVM: ami-02df9ea15c1778c9c eu-west-2: HVM: ami-0be057a22c63962cb eu-west-3: HVM: ami-0bb607148d8cf36fb eu-north-1: HVM: ami-1dab2163 sa-east-1: HVM: ami-02c8813f1ea04d4ab Resources: VPC: Type: AWS::CloudFormation::Stack Properties: TemplateURL: ./vpc.yml Parameters: ImageId : !FindInMap - ImageMap - !Ref 'AWS::Region' - HVM Pipeline: Type: AWS::CloudFormation::Stack Properties: TemplateURL: ./pipeline.yml Parameters: WebAppASG: !GetAtt VPC.Outputs.WebAppASG ECSCluster: !GetAtt ECS.Outputs.Cluster ECSService: !GetAtt ECS.Outputs.Service ECS: Type: AWS::CloudFormation::Stack Properties: TemplateURL: ./fargate.yml Parameters: VPC: !GetAtt VPC.Outputs.VPC Image: !Sub "${AWS::AccountId}.dkr.ecr.${AWS::Region}.amazonaws.com/swift-app:latest" ECSDesiredCount: !Ref ECSDesiredCount PublicSubnetA: !GetAtt VPC.Outputs.PublicSubnetA PublicSubnetB: !GetAtt VPC.Outputs.PublicSubnetB PrivateSubnetA: !GetAtt VPC.Outputs.PrivateSubnetA PrivateSubnetB: !GetAtt VPC.Outputs.PrivateSubnetB Outputs: EcsLbUrl: Value: !GetAtt ECS.Outputs.EcsLbUrl Ec2LbUrl: Value: !GetAtt VPC.Outputs.Ec2LbUrl S3ArtifactBucket: Value: !GetAtt Pipeline.Outputs.ArtifactStoreS3Location AppImage: Value: !GetAtt Pipeline.Outputs.AppImage CodeBuildImage: Value: !GetAtt Pipeline.Outputs.CodeBuildImage