This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws lightsail open-instance-public-ports \ | |
--instance-name 'LightsailDemo' \ | |
--port-info fromPort='3030',toPort='3030',protocol='tcp' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 - |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aws lightsail create-key-pair \ | |
--key-pair-name 'lightsail_demo' \ | |
--query 'privateKeyBase64' \ | |
--output text > 'demo.key' | |
chmod 700 "demo.key" |