{ "AWSTemplateFormatVersion": "2010-09-09", "Resources": { "myVPC": { "Type": "AWS::EC2::VPC", "Properties": { "CidrBlock": "10.200.0.0/16", "InstanceTenancy": "default", "EnableDnsSupport": "true", "EnableDnsHostnames": "false", "Tags": [ { "Key": "Name", "Value": "alexardsVPC" } ] } }, "myPublicSubnet1": { "Type": "AWS::EC2::Subnet", "Properties": { "CidrBlock": "10.200.10.0/24", "AvailabilityZone": "us-east-1a", "MapPublicIpOnLaunch" : "true", "VpcId": { "Ref": "myVPC" }, "Tags": [ { "Key": "Name", "Value": "alexardsPublicSubnet1" } ] } }, "myPublicSubnet2": { "Type": "AWS::EC2::Subnet", "Properties": { "CidrBlock": "10.200.12.0/24", "AvailabilityZone": "us-east-1b", "MapPublicIpOnLaunch" : "true", "VpcId": { "Ref": "myVPC" }, "Tags": [ { "Key": "Name", "Value": "alexardsPublicSubnet2" } ] } }, "myPublicSubnet3": { "Type": "AWS::EC2::Subnet", "Properties": { "CidrBlock": "10.200.13.0/24", "AvailabilityZone": "us-east-1c", "MapPublicIpOnLaunch" : "true", "VpcId": { "Ref": "myVPC" }, "Tags": [ { "Key": "Name", "Value": "alexardsPublicSubnet3" } ] } }, "myDBSubnetGrp": { "Type" : "AWS::RDS::DBSubnetGroup", "Properties" : { "DBSubnetGroupDescription" : "DB Subnet Group for RDS databases", "DBSubnetGroupName" : "alexardsDBSubnetGrp", "SubnetIds" : [ {"Ref": "myPublicSubnet1"}, {"Ref": "myPublicSubnet2"}, {"Ref": "myPublicSubnet3"} ], "Tags" : [ { "Key": "Name", "Value": "alexardsDBSubnetGrp" } ] } }, "myIGW": { "Type": "AWS::EC2::InternetGateway", "Properties": { "Tags": [ { "Key": "Name", "Value": "alexardsIGW" } ] } }, "myPublicRouteTable1": { "Type": "AWS::EC2::RouteTable", "Properties": { "VpcId": { "Ref": "myVPC" }, "Tags": [ { "Key": "Name", "Value": "alexardsPublicRouteTable1" } ] } }, "myPublicRouteTable2": { "Type": "AWS::EC2::RouteTable", "Properties": { "VpcId": { "Ref": "myVPC" }, "Tags": [ { "Key": "Name", "Value": "alexardsPublicRouteTable2" } ] } }, "myPublicRouteTable3": { "Type": "AWS::EC2::RouteTable", "Properties": { "VpcId": { "Ref": "myVPC" }, "Tags": [ { "Key": "Name", "Value": "alexardsPublicRouteTable3" } ] } }, "myBastionSecGrp": { "Type": "AWS::EC2::SecurityGroup", "Properties": { "GroupName": "alexardsBastionSecGrp", "GroupDescription": "Security Group for the bastion", "VpcId": { "Ref": "myVPC" }, "Tags": [ { "Key": "Name", "Value": "alexardsBastionSecGrp" } ] } }, "myDBOracleSecGrp": { "Type": "AWS::EC2::SecurityGroup", "Properties": { "GroupName": "alexardsOracleSecGrp", "GroupDescription": "Security Group for Oracle databases", "VpcId": { "Ref": "myVPC" }, "Tags": [ { "Key": "Name", "Value": "alexardsOracleSecGrp" } ] } }, "myLabGWAttachment": { "Type": "AWS::EC2::VPCGatewayAttachment", "Properties": { "VpcId": { "Ref": "myVPC" }, "InternetGatewayId": { "Ref": "myIGW" } } }, "myPubSubAssociation1": { "Type": "AWS::EC2::SubnetRouteTableAssociation", "Properties": { "RouteTableId": { "Ref": "myPublicRouteTable1" }, "SubnetId": { "Ref": "myPublicSubnet1" } } }, "myPubSubAssociation2": { "Type": "AWS::EC2::SubnetRouteTableAssociation", "Properties": { "RouteTableId": { "Ref": "myPublicRouteTable2" }, "SubnetId": { "Ref": "myPublicSubnet2" } } }, "myPubSubAssociation3": { "Type": "AWS::EC2::SubnetRouteTableAssociation", "Properties": { "RouteTableId": { "Ref": "myPublicRouteTable3" }, "SubnetId": { "Ref": "myPublicSubnet3" } } }, "myPublicRoute1": { "Type": "AWS::EC2::Route", "Properties": { "DestinationCidrBlock": "0.0.0.0/0", "RouteTableId": { "Ref": "myPublicRouteTable1" }, "GatewayId": { "Ref": "myIGW" } }, "DependsOn": "myLabGWAttachment" }, "myPublicRoute2": { "Type": "AWS::EC2::Route", "Properties": { "DestinationCidrBlock": "0.0.0.0/0", "RouteTableId": { "Ref": "myPublicRouteTable2" }, "GatewayId": { "Ref": "myIGW" } }, "DependsOn": "myLabGWAttachment" }, "myPublicRoute3": { "Type": "AWS::EC2::Route", "Properties": { "DestinationCidrBlock": "0.0.0.0/0", "RouteTableId": { "Ref": "myPublicRouteTable3" }, "GatewayId": { "Ref": "myIGW" } }, "DependsOn": "myLabGWAttachment" }, "myBastionRoute1": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { "GroupId": { "Ref": "myBastionSecGrp" }, "IpProtocol": "tcp", "FromPort": "22", "ToPort": "22", "CidrIp": "0.0.0.0/0" } }, "myDBOracleRoute1": { "Type": "AWS::EC2::SecurityGroupIngress", "Properties": { "GroupId": { "Ref": "myDBOracleSecGrp" }, "IpProtocol": "tcp", "FromPort": "1521", "ToPort": "1521", "CidrIp": "0.0.0.0/0" } }, "myEgressRoute1": { "Type": "AWS::EC2::SecurityGroupEgress", "Properties": { "GroupId": { "Ref": "myBastionSecGrp" }, "IpProtocol": "-1", "CidrIp": "0.0.0.0/0" } }, "myEgressRoute3": { "Type": "AWS::EC2::SecurityGroupEgress", "Properties": { "GroupId": { "Ref": "myDBOracleSecGrp" }, "IpProtocol": "-1", "CidrIp": "0.0.0.0/0" } } }, "Outputs": { "myPublicSubnet1" : { "Value" : { "Ref" : "myPublicSubnet1" } }, "myBastionSecGrp" : { "Value" : { "Ref" : "myBastionSecGrp" } }, "myDBOracleSecGrp" : { "Value" : { "Ref" : "myDBOracleSecGrp" } } }, "Description": "alexards_network" }