Skip to content

Instantly share code, notes, and snippets.

View tamarabartlett's full-sized avatar

Tamara Bartlett tamarabartlett

View GitHub Profile
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Create a security group for EC2 instances",
"Resources" : {
"PingAndSshSecurityGroupStelligentBlog" : {
"Type" : "AWS::EC2::SecurityGroup",
"Properties" : {
"GroupDescription" : "Security group that does not allow ping",
"SecurityGroupIngress" : [
{ "IpProtocol" : "tcp", "FromPort" : "22", "ToPort" : "22", "CidrIp" : "0.0.0.0/0" }
{
"AWSTemplateFormatVersion" : "2010-09-09",
"Description" : "Create a single EC2 instance in AWS",
"Resources" : {
"InstanceOneStelligentBlog" : {
"Type" : "AWS::EC2::Instance",
"Properties" : {
"InstanceType" : "t1.micro",
"SecurityGroupIds" : ["this-is-the-security-group-output"],
"ImageId" : "ami-7f77b31f",
ping -c 1 $1 > /dev/null 2>&1
RETVAL=$?
if [ $RETVAL -eq 0 ];
then
echo "Test Passed"
else
echo "Test Failed"
fi
@tamarabartlett
tamarabartlett / movePing.sh
Created April 20, 2017 16:59
SCP a Ping Test
$ scp -i stelligent-blog-test.pem ping-test.sh ec2-user@public-DNS-from-aws-console:~/
@tamarabartlett
tamarabartlett / logon.sh
Created April 20, 2017 17:00
Log onto instance cmd
$ ssh -i "stelligent-blog-test.pem" ec2-user@public-DNS-from-aws-consoleRed
$ ./ping-test.sh public-DNS-of-the-other-ec2-instance-from-aws-console
@tamarabartlett
tamarabartlett / security-group-ingress.template
Created April 20, 2017 17:03
Just a snippet of a security group that can ping
"SecurityGroupIngress" : [
{ "IpProtocol" : "tcp", "FromPort" : "22", "ToPort" : "22", "CidrIp" : "0.0.0.0/0" },
{ "IpProtocol" : "icmp", "FromPort" : "-1", "ToPort" : "-1", "CidrIp" : "0.0.0.0/0" }
]

Keybase proof

I hereby claim:

  • I am tamarabartlett on github.
  • I am tamarabartlett (https://keybase.io/tamarabartlett) on keybase.
  • I have a public key ASBP3ENLdOKm5v4WiNZYOeftjLjclOpoKqT-ieFdjBi0JAo

To claim this, I am signing this object: