I'm completely new to AWS so sorry for asking some lame questions.
This is a part of my ecs.yml file which I'm trying to deploy via CloudFormation:
AWSTemplateFormatVersion: "2010-09-09" Parameters: SubnetID: Type: String Resources: VPC: Type: AWS::EC2::VPC Properties: CidrBlock: '10.0.0.0/16' PublicSubnetOne: Type: AWS::EC2::Subnet Properties: AvailabilityZone: Fn::Select: - 0 - Fn::GetAZs: { Ref: 'AWS::Region' } VpcId: !Ref 'VPC' CidrBlock: '10.0.1.0/24' MapPublicIpOnLaunch: true ... Service: Type: AWS::ECS::Service Properties: ServiceName: tui-task-service Cluster: !Ref Cluster TaskDefinition: !Ref TaskDefinition DesiredCount: 1 LaunchType: FARGATE NetworkConfiguration: AwsvpcConfiguration: AssignPublicIp: ENABLED Subnets: - !Ref SubnetID SecurityGroups: - !GetAtt ContainerSecurityGroup.GroupId At the moment I pass an existing subnet id (I assume it comes from the VPC which is created by default when you create an AWS account) like this:
aws cloudformation create-stack --stack-name my-deployment --template-body file://ecs.yml \ --capabilities CAPABILITY_NAMED_IAM \ --parameters 'ParameterKey=SubnetID,ParameterValue=subnet-069412dc3b3a4a639' I want to reference the subnet I create at the beginning of the template, how exactly do I do that? I tried !GetAtt PublicSubnetOne, but not sure which property to reference.