Skip to content

AwsInstanceConnectHelper is a Capistrano3 plugin for EC2 Instance Connect deployment bundled with some AWS EC2 rake templates.

License

Notifications You must be signed in to change notification settings

sunnyfounder/aws_instance_connect_helper

Repository files navigation

AwsInstanceConnectHelper

AwsInstanceConnectHelper is a Capistrano3 plugin for EC2 Instance Connect deployment bundled with some AWS EC2 rake templates. This is intended as an internal plugin and is therefore not open for contributions, and Sunnyfounder is not responsible for any unintended consequences.

Setup & Usage

Add this line to your application's Gemfile:

group :development do
  gem 'aws_instance_connect_helper', git: 'git@github.com:sunnyfounder/aws_instance_connect_helper.git', tag: 'v0.1.0'
end

Prerequisites

This Gem is intended to be used along with an authorization key saved on your profile (normally located at ~/.aws/credentials)

EC2 Instances on your AWS should be tagged with the according tags:

  • Project (Differentiating different projects, eg. core-web, analytics...)
  • Environment (eg. production, staging, development...)
  • Function (For setting different Capistrano Roles, eg. web, api, shadow...)
  • Name (An unique identifier)

1. Capistrano3 Plugin

  1. Add this line to your application's Capfile
require 'aws_instance_connect_helper/capistrano3'
  1. Configurate the helper (potentially at lib/capistrano/tasks/aws_helper.rake)
namespace :load do
  task :defaults do
    set :aws_helper_project, 'core-web'
    set :aws_helper_functions, %w[web shadow]
    set :aws_helper_env, proc { fetch :stage }
  end
end
  1. Invoke aws_helper:setup from your config/deploy.rb or config/deploy/ENVIROMENT.rb and easily deploy to servers with Instance Connect.
invoke 'aws_helper:setup'
servers = fetch :FUNCTION_servers

2. SSH Helper

  1. Add this line to your application's Rakefile
spec = Gem::Specification.find_by_name 'aws_instance_connect_helper'
Dir["#{spec.gem_dir}/lib/tasks/*.rake"].each { |file| load file }
  1. Access EC2 instances with Instance Connect easily with rake aws:access

About

AwsInstanceConnectHelper is a Capistrano3 plugin for EC2 Instance Connect deployment bundled with some AWS EC2 rake templates.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •