Skip to content

Instantly share code, notes, and snippets.

View mince27's full-sized avatar

Dave Mincemoyer mince27

View GitHub Profile
@mince27
mince27 / get-instance.sh
Last active May 22, 2018 09:24
AWS Lightsail get instance info
# Full description of instance
aws lightsail get-instance --instance-name 'LightsailDemo'
# Return only the IP
aws lightsail get-instance --instance-name 'LightsailDemo' --query 'instance.privateIpAddress' --output text
# Connect
ssh -i demo.key ec2-user@<IP_ADDRESS>
@mince27
mince27 / open-instance-port.sh
Created January 11, 2017 16:37
AWS Lightsail open port
aws lightsail open-instance-public-ports \
--instance-name 'LightsailDemo' \
--port-info fromPort='3030',toPort='3030',protocol='tcp'
@mince27
mince27 / userdata.sh
Last active October 17, 2017 01:21
User Data file for configuring a Lightsail instance
#!/bin/bash
readonly APP_HOME='/opt'
readonly NODE_SRC='https://rpm.nodesource.com/setup_6.x'
readonly SOURCE_REPO='https://github.com/stelligent/chat-app'
yum update -y
yum install -y git
echo 'Installing node'
curl --silent --location "$NODE_SRC" | bash -
@mince27
mince27 / create-instances.sh
Created January 11, 2017 16:35
AWS Lightsail Create Instance
aws lightsail create-instances \
--instance-names 'LightsailDemo' \
--availability-zone 'us-east-1b' \
--blueprint-id 'amazon_linux_2016_09_0' \
--bundle-id 'micro_1_0' \
--user-data file://'userdata.sh' \
--key-pair-name 'lightsail_demo'
@mince27
mince27 / create-key-pair.sh
Created January 11, 2017 16:34
AWS Lightsail Create Key Pair
aws lightsail create-key-pair \
--key-pair-name 'lightsail_demo' \
--query 'privateKeyBase64' \
--output text > 'demo.key'
chmod 700 "demo.key"