-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreate_aws_ec2.conf
More file actions
43 lines (42 loc) · 1.54 KB
/
create_aws_ec2.conf
File metadata and controls
43 lines (42 loc) · 1.54 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# create_aws_ec2.conf configuration file
[AWS Credentials]
# Choose which profile you want to use, leave blank for default
AWS_PROFILE=tarek-aws
# Aws account used to create objects related to the specified account
AWS_ACCOUNT_ID=123456789123
[EC2 Infos]
NAME_TAG=myDebianJessie
ENV_TAG=test
# Keypair used with ec2 instance
# Without "pem" ending
EC2_KEYPAIR=tarek-aws-myDebianJessie-ec2
EC2_AMI=ami-e079f893
EC2_INST_TYPE=t2.micro
EC2_VPC_ID=vpc-ab12cd3e
EC2_SUBNET_ID=subnet-abcd1234
EC2_AZ=eu-west-1a
# EC2 Instance IAM Role (can be empty)
EC2_IAM_ROLE=cloudwatch-logs
# Size of the hard disk (EBS) in Gigas bytes
EC2_VOLUME_SIZE=10
# Type of EBS volume ('standard'|'io1'|'gp2'|'sc1'|'st1')
EC2_VOLUME_TYPE=gp2
# UserData (can be empty)
EC2_USER_DATA=#! /bin/bash
sudo apt-get update -y
sudo DEBIAN_FRONTEND=noninteractive apt-get -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" dist-upgrade
sudo apt-get install ntp vim htop -y
cd /tmp && sudo wget https://get.docker.io -O install_docker.sh
sudo chmod +x install_docker.sh && sudo ./install_docker.sh
sudo echo "myDebianJessie" > /etc/hostname
sudo echo "127.0.1.1 myDebianJessie">> /etc/hosts
sudo reboot
# Private Ip address
EC2_PRIV_IP=192.168.1.100
# Public Ip Or Not (True|False)
EC2_HAS_PUB_IP=True
# SG like this "Inbound|Outbound protocol fromPort/sg toPort ipRange"
EC2_SG_RULES=Inbound tcp 22 22 0.0.0.0/0
#EC2_SG_RULES=Inbound tcp 22 22 0.0.0.0/0,Outbound -1 -1 -1 0.0.0.0/0
EC2_SG_NAME=sg_myDebianJessie
EC2_SG_DESC=This security group is used for myDebianJessie ec2 instance