Giter VIP home page Giter VIP logo

wendywj5 / bastion-host-starter-template Goto Github PK

View Code? Open in Web Editor NEW

This project forked from 1strategy/bastion-host-starter-template

0.0 0.0 0.0 72 KB

This template is used to create a stack that leverages ec2 autoscaling to implement a single bastion host ec2 instance and an associated security group. The security group provides secure access to the bastion host based on the provided origin cidr block and SSH port. SSH access to the bastion host is granted using the default ec2-user credential

License: Apache License 2.0

bastion-host-starter-template's Introduction

AWS CloudFormation Bastion Host Example Template


This template is used to create a CloudFormation Stack that implements a single EC2 Instance running AWS Linux 2, and an associated Security Group. The Security Group provides secure access to the bastion host based upon the provided origin cidr block and SSH port. SSH access to the Bastion Host is granted using the default ec2-user credentials associated with the AWS Linux 2 AMI, and the SSH key pair supplied via the KeyPair parameter.

The EC2 instance is created using an AutoScaling group provisioned across two subnets that are associated with two different availability zones. The AutoScaling Group is configured for a minimum of one instance, a desired count of one instance, and a maximum of one instance. The 1-1-1 AutoScaling configuration ensures the bastion host will remain available even in the event of an availability zone failure.


Getting Started


At a minimum, access to an AWS Account and permissions to deploy all of the resources defined in the template from the CloudFormation console are required. In addition, you will also require a key pair associated with the account/vpc you are deploying the host into. EC2 key pairs can be created in the console, or from the aws cli (see example below).

If you would like to deploy the template from the commandline a set of CLI credentials with the permissions to deploy all of the resources defined in the template and the installation and configuration of AWS CLI is required.

Prerequisites



Deploying via AWS CLI


Create a param-overrides.json file to store the template parameter values.

Example:

[
   "VpcId=vpc-123456789abcdefgh",
   "KeyPair=MyKeyPair",
   "Subnet1=subnet-123456789abcdefgh",
   "Subnet2=subnet-abcdefghi12345678",
   "InstanceType=t3.micro",
   "SourceCidr=1.1.1.1/32",
   "SshPort=22"
]

Create the tags.json file and populate with all necessary tags.

Example:

[
    "Business_Unit=1Strategy",
    "Owner=John Doe",
    "Project=Bastion Host"
]

Deploy the template to your account/environment:

aws cloudformation deploy \
   --template-file bastion_host.yaml \
   --stack-name JohnDoeBastionHost \
   --tags file://tags.json \
   --region "us-east-1" \
   --parameter-overrides file://param-overrides.json

Authors



License


Copyright 2019 1Strategy

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


References


bastion-host-starter-template's People

Contributors

ramblingbiped avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.