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
Parameters: | |
SSHLocation: | |
Description: "Allow SSH to instance from this IP" | |
Type: "String" | |
VpcId: | |
Description: VpcId for the SG | |
Type: AWS::EC2::VPC::Id | |
Resources: | |
InstanceSecurityGroup: | |
Type: "AWS::EC2::SecurityGroup" |
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
--- | |
Description: "A text description for the template usage" | |
Parameters: | |
Resources: | |
Outputs: | |
AWSTemplateFormatVersion: "2010-09-09" |
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
Resources: | |
InstanceSecurityGroup: | |
Type: "AWS::EC2::SecurityGroup" | |
Properties: | |
VpcId: | |
GroupDescription: | |
SecurityGroupIngress: |
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
Ec2Instance: | |
Type: "AWS::EC2::Instance" | |
Properties: | |
KeyName: | |
ImageId: | |
Tags: | |
UserData: | |
NetworkInterfaces: |
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
Parameters: | |
KeyPair: | |
Description: "The EC2 Key Pair to allow SSH access to the instance" | |
Type: "String" | |
ImageId: | |
Description: "The ImageId for EC2 Instances" | |
Type: "String" | |
PublicSubnet: | |
Description: "Public Subnet to Launch Instance" | |
Type: "AWS::EC2::Subnet::Id" |
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
Outputs: | |
InstanceId: | |
Description: "The InstanceId of the newly created EC2 instance" | |
Value: | |
Ref: "Ec2Instance" |
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
--- | |
Description: "Create an EC2 instance" | |
Parameters: | |
KeyPair: | |
Description: "The EC2 Key Pair to allow SSH access to the instance" | |
Type: "String" | |
ImageId: | |
Description: "The ImageId for EC2 Instances" | |
Type: "String" | |
SSHLocation: |
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 | |
yum update -y | |
yum install httpd | |
cat <<EOF > /var/www/html/index.html | |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Garrett's Webpage</title> |
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 | |
# Install Homebrew | |
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" | |
# Install pip | |
sudo easy_install pip | |
# Install git | |
brew install git |
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
import psycopg2 | |
def execute_postgres(p_db_name, p_user, p_pass, p_query): | |
conn = None | |
try: | |
# connect to the PostgreSQL server | |
print('Attempting to connect...') | |
conn = psycopg2.connect("dbname=" + p_db_name + " user=" + p_user + " password=" + p_pass) |
OlderNewer