
{ | |
"AWSTemplateFormatVersion": "2010-09-09", | |
"Description": "EC2-SecurityGroup-ElasticIP", | |
"Parameters": { | |
"VPC": { | |
"Description": "The default VPC", | |
"Type": "AWS::EC2::VPC::Id" | |
}, | |
"Subnet": { | |
"Description": "A public subnet of VPC.", | |
"Type": "AWS::EC2::Subnet::Id" | |
}, | |
"KeyPair": { | |
"Description": "A SSH key pair.", | |
"Type": "AWS::EC2::KeyPair::KeyName" | |
} | |
}, | |
"Mappings": { | |
"RegionMap": { | |
"eu-west-1": {"AMI": "ami-bff32ccc"}, | |
"ap-southeast-1": {"AMI": "ami-c9b572aa"}, | |
"ap-southeast-2": {"AMI": "ami-48d38c2b"}, | |
"eu-central-1": {"AMI": "ami-bc5b48d0"}, | |
"ap-northeast-2": {"AMI": "ami-249b554a"}, | |
"ap-northeast-1": {"AMI": "ami-383c1956"}, | |
"us-east-1": {"AMI": "ami-60b6c60a"}, | |
"sa-east-1": {"AMI": "ami-6817af04"}, | |
"us-west-1": {"AMI": "ami-d5ea86b5"}, | |
"us-west-2": {"AMI": "ami-f0091d91"} | |
} | |
}, | |
"Resources": { | |
"EC2Instance": { | |
"Type": "AWS::EC2::Instance", | |
"Properties": { | |
"ImageId": {"Fn::FindInMap": ["RegionMap", {"Ref": "AWS::Region"}, "AMI"]}, | |
"InstanceType": "t2.nano", | |
"NetworkInterfaces": [{ | |
"AssociatePublicIpAddress": "true", | |
"DeviceIndex": "0", | |
"GroupSet": [{"Ref": "SecurityGroup"}], | |
"SubnetId": {"Ref": "Subnet"} | |
}], | |
"Tags": [{ | |
"Key": "Name", | |
"Value": "ssh-bastion-host" | |
}], | |
"KeyName": {"Ref": "KeyPair"} | |
} | |
}, | |
"ElasticIP": { | |
"Type": "AWS::EC2::EIP", | |
"Properties": { | |
"InstanceId": {"Ref": "EC2Instance"}, | |
"Domain": "vpc" | |
} | |
}, | |
"SecurityGroup": { | |
"Type": "AWS::EC2::SecurityGroup", | |
"Properties": { | |
"GroupDescription": "ssh-bastion-host", | |
"VpcId": {"Ref": "VPC"}, | |
"SecurityGroupIngress": [{ | |
"CidrIp": "0.0.0.0/0", | |
"FromPort": 22, | |
"IpProtocol": "tcp", | |
"ToPort": 22 | |
}] | |
} | |
} | |
}, | |
"Outputs": { | |
"SSHBastionHost": { | |
"Description": "Public IP address of SSH bastion host.", | |
"Value": {"Ref": "ElasticIP"} | |
} | |
} | |
} |









I’m a DevOps/SRE/DevSecOps/Cloud Expert passionate about sharing knowledge and experiences. I am working at Cotocus. I blog tech insights at DevOps School, travel stories at Holiday Landmark, stock market tips at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at I reviewed , and SEO strategies at Wizbrand.
Please find my social handles as below;
Rajesh Kumar Personal Website
Rajesh Kumar at YOUTUBE
Rajesh Kumar at INSTAGRAM
Rajesh Kumar at X
Rajesh Kumar at FACEBOOK
Rajesh Kumar at LINKEDIN
Rajesh Kumar at PINTEREST
Rajesh Kumar at QUORA
Rajesh Kumar at WIZBRAND