All Projects → jdhollis → Bastions On Demand

jdhollis / Bastions On Demand

Licence: epl-1.0
Create and destroy bastions on demand with Fargate.

Projects that are alternatives of or similar to Bastions On Demand

Ebs bckup
Stars: ✭ 32 (-40.74%)
Mutual labels:  lambda, terraform, hcl
Terraform Ecs Fargate
Source code for a tutorial on Medium I published - "Deploying Containers on Amazon’s ECS using Fargate and Terraform: Part 2"
Stars: ✭ 208 (+285.19%)
Mutual labels:  ecs, terraform, hcl
Aws Ecs Airflow
Run Airflow in AWS ECS(Elastic Container Service) using Fargate tasks
Stars: ✭ 107 (+98.15%)
Mutual labels:  ecs, terraform, hcl
Terraform Aws Ecs Fargate
Terraform module which creates ECS Fargate resources on AWS.
Stars: ✭ 35 (-35.19%)
Mutual labels:  ecs, terraform, hcl
Terraform Ecs Fargate
A Terraform template used for provisioning web application stacks on AWS ECS Fargate
Stars: ✭ 293 (+442.59%)
Mutual labels:  ecs, terraform, hcl
Ecs Pipeline
☁️ 🐳 ⚡️ 🚀 Create environment and deployment pipelines to ECS Fargate with CodePipeline, CodeBuild and Github using Terraform
Stars: ✭ 85 (+57.41%)
Mutual labels:  ecs, terraform, hcl
Terraform Fargate Example
Example repository to run an ECS cluster on Fargate
Stars: ✭ 206 (+281.48%)
Mutual labels:  ecs, terraform, hcl
Terraform Aws Ecs Codepipeline
Terraform Module for CI/CD with AWS Code Pipeline and Code Build for ECS https://cloudposse.com/
Stars: ✭ 85 (+57.41%)
Mutual labels:  ecs, terraform, hcl
Terraform Aws Labs
Terraform template for AWS provider ☁️
Stars: ✭ 146 (+170.37%)
Mutual labels:  lambda, terraform, hcl
Hello Lambda
🔥 An example of a Python (AWS) Lambda exposed with API Gateway, configured with Terraform.
Stars: ✭ 114 (+111.11%)
Mutual labels:  lambda, terraform, hcl
Terraform Ecs Autoscale Alb
ECS cluster with instance and service autoscaling configured and running behind an ALB with path based routing set up
Stars: ✭ 60 (+11.11%)
Mutual labels:  ecs, terraform, hcl
Lambda Deployment Example
Automated Lambda Deployments with Terraform & CodePipeline
Stars: ✭ 25 (-53.7%)
Mutual labels:  lambda, terraform, hcl
Terraform Aws Airship Ecs Service
Terraform module which creates an ECS Service, IAM roles, Scaling, ALB listener rules.. Fargate & AWSVPC compatible
Stars: ✭ 139 (+157.41%)
Mutual labels:  ecs, terraform, hcl
Terraform Aws Ecs Container Definition
Terraform module to generate well-formed JSON documents (container definitions) that are passed to the aws_ecs_task_definition Terraform resource
Stars: ✭ 217 (+301.85%)
Mutual labels:  ecs, terraform, hcl
Infrastructure As Code Talk
Sample code for the talk "Infrastructure-as-code: running microservices on AWS with Docker, ECS, and Terraform"
Stars: ✭ 520 (+862.96%)
Mutual labels:  ecs, terraform, hcl
Terraform Aws Alb
Terraform module to provision a standard ALB for HTTP/HTTP traffic
Stars: ✭ 53 (-1.85%)
Mutual labels:  ecs, terraform, hcl
K8s Digitalocean Terraform
Deploy latest Kubernetes cluster on DigitalOcean using Terraform
Stars: ✭ 33 (-38.89%)
Mutual labels:  terraform, hcl
Terraform Reference
Terraform reference / skel Control Repo for building for building multi-tier services
Stars: ✭ 33 (-38.89%)
Mutual labels:  terraform, hcl
Terraform Aws Vpc Peering Multi Account
Terraform module to provision a VPC peering across multiple VPCs in different accounts by using multiple providers
Stars: ✭ 52 (-3.7%)
Mutual labels:  terraform, hcl
Karch
A Terraform module to create and maintain Kubernetes clusters on AWS easily, relying entirely on kops
Stars: ✭ 38 (-29.63%)
Mutual labels:  terraform, hcl

Bastions on Demand

This is a fully functional example of how to create and destroy bastion instances on demand using Fargate.

For an in-depth guide to this example, check out "Bastions on Demand" on my site.

Preliminaries

Before you being, you will need to install:

Everything in this repo assumes use of the default AWS profile. You can easily override that assumption with the AWS_PROFILE environment variable.

You can configure your credentials with aws configure.

You will also need to upload your public SSH key to your IAM user using either the AWS Console or the CLI (if you haven't already).

Setup

If you haven't previously configured a CloudWatch role for API Gateway, then use the api-gateway-logger module to do so now:

cd api-gateway-logger
terraform init
terraform plan -out plan
terraform apply plan && rm plan
cd ..

This is a global account setting, so you should only have to do it once. Note that destroying the module's resources with Terraform will remove the role, but it will not reset the CloudWatch role setting for API Gateway.

Now we're ready to create the service.

terraform init
./service/bin/build.sh  # Build the Lambda functions
terraform apply plan && rm plan

Once the Terraform successfully applies, fire up Docker (if you don't already have it running). Then, build and push the bastion image with:

./bastion/bin/login.sh  # Log into ECR
./bastion/bin/build.sh  # Build & tag the Docker image
./bastion/bin/push.sh   # Push the tagged image to ECR

Finally, we need to make certain the necessary Ruby dependencies are installed:

cd service
bundle
cd ..

You should now be able to create and destroy bastions with:

./service/bin/create-bastion.sh
./service/bin/destroy-bastion.sh

Once a bastion is running, you'll find its IP address in service/.bastion-ip.

You can ssh into the bastion with:

ssh [email protected]$(cat service/.bastion-ip)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].