AWSTemplateFormatVersion: '2010-09-09' Description: > Wild Rydes Asynchronous Messaging Workshop - Lab 0 Template to setup the AWS Cloud9 environment for the workshop. Parameters: Cloud9CidrBlock: Description: The CIDR block range for your Cloud9 IDE VPC Type: String Default: 10.43.0.0/28 GitRepositoryURL: Description: The Git repository URL for the project we are cloning Type: String Default: https://github.com/aws-samples/asynchronous-messaging-workshop.git Resources: SamTemplateArtifactS3Bucket: Type: AWS::S3::Bucket DeletionPolicy: Delete VPC: Type: AWS::EC2::VPC Properties: CidrBlock: !Ref Cloud9CidrBlock EnableDnsSupport: true EnableDnsHostnames: true Tags: - Key: Name Value: !Sub "${AWS::StackName}-VPC" InternetGateway: Type: AWS::EC2::InternetGateway Properties: Tags: - Key: Name Value: !Sub "${AWS::StackName}-InternetGateway" AttachGateway: Type: AWS::EC2::VPCGatewayAttachment Properties: VpcId: !Ref 'VPC' InternetGatewayId: !Ref 'InternetGateway' RouteTable: Type: AWS::EC2::RouteTable Properties: VpcId: !Ref 'VPC' Tags: - Key: Name Value: !Sub "${AWS::StackName}-RouteTable" Route: Type: AWS::EC2::Route DependsOn: AttachGateway Properties: RouteTableId: !Ref 'RouteTable' DestinationCidrBlock: '0.0.0.0/0' GatewayId: !Ref 'InternetGateway' PublicSubnet1: Type: AWS::EC2::Subnet Properties: VpcId: !Ref 'VPC' CidrBlock: !Ref Cloud9CidrBlock AvailabilityZone: !Select - '0' - !GetAZs '' Tags: - Key: Name Value: !Sub "${AWS::StackName}-PublicSubnet1" PublicSubnet1RouteTableAssociation: Type: AWS::EC2::SubnetRouteTableAssociation Properties: SubnetId: !Ref PublicSubnet1 RouteTableId: !Ref RouteTable Cloud9: Type: AWS::Cloud9::EnvironmentEC2 Properties: AutomaticStopTimeMinutes: 30 Description: Wild Rydes Async Messaging Workspace InstanceType: t2.micro Name: !Sub "WildRydesAsyncMessaging-${AWS::StackName}" Repositories: - PathComponent: /wild-rydes-async-messaging RepositoryUrl: !Ref GitRepositoryURL SubnetId: !Ref PublicSubnet1 ImageId: amazonlinux-2-x86_64 Outputs: Cloud9DevEnvUrl: Description: Cloud9 Development Environment Value: !Sub "https://${AWS::Region}.console.aws.amazon.com/cloud9/ide/${Cloud9}"