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 -y | |
service httpd start | |
chkconfig httpd on | |
echo "<html><h1>This is Webserver X</h1></html>" > /var/www/html/index.html |
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 php php-mysql -y | |
cd /var/www/html | |
echo "healthy" > healthy.html | |
wget https://wordpress.org/wordpress-5.1.1.tar.gz | |
tar -xzf wordpress-5.1.1.tar.gz | |
cp -r wordpress/* /var/www/html/ | |
rm -rf wordpress | |
rm -rf wordpress-5.1.1.tar.gz |
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
sudo su - # operation requires root privileges | |
lsblk # to see devices and mounts, MOUNTPOINT is empty for the new device | |
NEW_DEVICE=xvdf # change as appropriate | |
# to mount a new device | |
file -s /dev/${NEW_DEVICE} # will display "data" if no file system is present | |
mkfs -t ext4 /dev/${NEW_DEVICE} # will install ext4 on device | |
mkdir /filesystem | |
mount /dev/${NEW_DEVICE} /filesystem |
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 php php-mysql -y | |
chkconfig httpd on | |
service httpd start | |
echo "<?php phpinfo();?>" > /var/www/html/index.php | |
cd /var/www/html | |
wget https://s3.amazonaws.com/acloudguru-production/connect.php |
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
#Install CodeDeploy agent on your EC2 instance: | |
sudo yum update -y | |
sudo yum install ruby | |
sudo yum install wget | |
cd /home/ec2-user | |
wget https://aws-codedeploy-eu-central-1.s3.amazonaws.com/latest/install | |
chmod +x ./install | |
sudo ./install auto | |
sudo service codedeploy-agent status | |
#Create your application.zip and load it into CodeDeploy: |
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
# as per https://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-basics.html | |
sudo yum update -y | |
sudo amazon-linux-extras install docker | |
sudo service docker start | |
sudo usermod -a -G docker ec2-user |
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
# Ubuntu ONLY! Amazon Linux instructions here: | |
# (https://docs.aws.amazon.com/AmazonECS/latest/developerguide/docker-basics.html#install_docker) | |
curl -fsSL https://get.docker.com -o get-docker.sh | |
sh get-docker.sh | |
sudo usermod -a -G docker ubuntu | |
sudo reboot |
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 | |
############# | |
# 1. Copy this script into EC2 User Data | |
# 2. Enable Cloudwatch detailed monitoring | |
# Usage: "curl localhost:80/?workload=1000" | |
############# | |
yum update -y | |
curl --silent --location https://rpm.nodesource.com/setup_10.x | 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
# assumes a data stream named "demo-stream" with one shard exists | |
# inspect data stream and copy identity SHARD_ID variable (e.g. ShardId-????) | |
aws kinesis list-streams | |
STREAM_NAME=demo-stream | |
aws kinesis describe-stream --stream-name ${STREAM_NAME} | |
SHARD_ID=shardId-000000000000 | |
# add four records |
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
# assumes a kinesis firehose delivery system is in place (e.g. demo-firehose-stream) | |
# NodeJS Lambda function to append CRs as follows with a timeout > 1 min | |
# Configure this to deposit results in S3 | |
console.log('Loading function'); | |
exports.handler = async (event, context) => { | |
/* Process the list of records and transform them */ |
OlderNewer