Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2019
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 KB | None | 0 0
  1. {
  2. "AWSTemplateFormatVersion": "2010-09-09",
  3. "Description": "EC2-SecurityGroup-ElasticIP",
  4. "Parameters": {
  5. "VPC": {
  6. "Description": "The default VPC",
  7. "Type": "AWS::EC2::VPC::Id"
  8. },
  9. "Subnet": {
  10. "Description": "A public subnet of VPC.",
  11. "Type": "AWS::EC2::Subnet::Id"
  12. },
  13. "KeyPair": {
  14. "Description": "A SSH key pair.",
  15. "Type": "AWS::EC2::KeyPair::KeyName"
  16. }
  17. },
  18. "Mappings": {
  19. "RegionMap": {
  20. "eu-west-1": {"AMI": "ami-bff32ccc"},
  21. "ap-southeast-1": {"AMI": "ami-c9b572aa"},
  22. "ap-southeast-2": {"AMI": "ami-48d38c2b"},
  23. "eu-central-1": {"AMI": "ami-bc5b48d0"},
  24. "ap-northeast-2": {"AMI": "ami-249b554a"},
  25. "ap-northeast-1": {"AMI": "ami-383c1956"},
  26. "us-east-1": {"AMI": "ami-60b6c60a"},
  27. "sa-east-1": {"AMI": "ami-6817af04"},
  28. "us-west-1": {"AMI": "ami-d5ea86b5"},
  29. "us-west-2": {"AMI": "ami-f0091d91"}
  30. }
  31. },
  32. "Resources": {
  33. "EC2Instance": {
  34. "Type": "AWS::EC2::Instance",
  35. "Properties": {
  36. "ImageId": {"Fn::FindInMap": ["RegionMap", {"Ref": "AWS::Region"}, "AMI"]},
  37. "InstanceType": "t2.nano",
  38. "NetworkInterfaces": [{
  39. "AssociatePublicIpAddress": "true",
  40. "DeviceIndex": "0",
  41. "GroupSet": [{"Ref": "SecurityGroup"}],
  42. "SubnetId": {"Ref": "Subnet"}
  43. }],
  44. "Tags": [{
  45. "Key": "Name",
  46. "Value": "ssh-bastion-host"
  47. }],
  48. "KeyName": {"Ref": "KeyPair"}
  49. }
  50. },
  51. "ElasticIP": {
  52. "Type": "AWS::EC2::EIP",
  53. "Properties": {
  54. "InstanceId": {"Ref": "EC2Instance"},
  55. "Domain": "vpc"
  56. }
  57. },
  58. "SecurityGroup": {
  59. "Type": "AWS::EC2::SecurityGroup",
  60. "Properties": {
  61. "GroupDescription": "ssh-bastion-host",
  62. "VpcId": {"Ref": "VPC"},
  63. "SecurityGroupIngress": [{
  64. "CidrIp": "0.0.0.0/0",
  65. "FromPort": 22,
  66. "IpProtocol": "tcp",
  67. "ToPort": 22
  68. }]
  69. }
  70. }
  71. },
  72. "Outputs": {
  73. "SSHBastionHost": {
  74. "Description": "Public IP address of SSH bastion host.",
  75. "Value": {"Ref": "ElasticIP"}
  76. }
  77. }
  78. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement