sudo -H pip install awscli --ignore-installed six
Collecting awscli [..]
Installing collected packages: pyasn1, rsa, futures, jmespath, six, python-dateutil, docutils, botocore, s3transfer, colorama, awscli Successfully installed awscli-1.10.19 botocore-1.4.10 colorama-0.3.3 docutils-0.12 futures-3.0.5 jmespath-0.9.0 pyasn1-0.1.9 python-dateutil-1.5 rsa-3.3 s3transfer-0.0.1 six-1.4.1
aws configure
AWS Access Key ID [None]: ***
AWS Secret Access Key [None]: ******
Default region name [None]: **-****-1
Default output format [None]: table
====
aws ec2 create-key-pair --key-name MyKey --query 'KeyMaterial' --output text > ~/.ssh/mykey.pem
chmod 400 ~/.ssh/mykey.pem
aws ec2 create-security-group --group-name fw-kbit-web --description "Default kbit.io Firewall"
aws ec2 authorize-security-group-ingress --group-name fw-kbit-web --protocol tcp --port 80 --cidr 0.0.0.0/0
aws ec2 authorize-security-group-ingress --group-name fw-kbit-web --protocol tcp --port 22 --cidr 0.0.0.0/0
- Ubuntu: ami-0fb83963
- Free-tier Instance: t2.micro
aws ec2 run-instances --image-id ami-0fb83963 --count 1 --instance-type t2.micro --key-name MyKey --security-groups fw-kbit-web
KEY | VALUE |
---|---|
InstanceId | i-0ffac8ea9f6ea0619 |
InstanceType | t2.micro |
- Description
- MacAddress
- NetworkInterfaceId
- OwnerId
- PrivateDnsName
- PrivateIpAddress
- SourceDestCheck
- Status
- SubnetId
- VpcId
aws ec2 create-volume --size 20 --region sa-east-1 --availability-zone sa-east-1a --volume-type gp2
aws ec2 attach-volume --volume-id vol-5b4f77fa --instance-id i-0ffac8ea9f6ea0619 --device /dev/sdf
aws ec2 allocate-address --domain standard
aws ec2 associate-address --instance-id i-0ffac8ea9f6ea0619 --public-ip ##.###.##.##
ssh -i .ssh/mykey.pem ubuntu@##.###.##.##
ubuntu@ip-###-##-##-###:~$
====
aws s3api create-bucket --bucket bucketName --region sa-east-1
A client error (BucketAlreadyExists) occurred when calling the CreateBucket operation: The requested bucket name is not available. The bucket namespace is shared by all users of the system. Please select a different name and try again.
aws s3api create-bucket --bucket randomNameToAvoidDuplicates --region sa-east-1
====
aws ec2 create-security-group --group-name fw-kbit-db --description "Default kbit.io Firewall DB"
aws ec2 authorize-security-group-ingress --group-name fw-kbit-db --protocol tcp --port 3306 --cidr ##internalIP##
- Free-tier: db.t2.micro
- Free-tire: 20GB
- Define your Security Group
- Disable MultiAZ
aws rds create-db-instance --db-instance-identifier ##Identifier## --allocated-storage 20 --db-instance-class db.t2.micro --engine mysql --master-username ##USER## --master-user-password ##PASSWORD## --availability-zone sa-east-1a --vpc-security-group-ids sg-2b1c154e --storage-type gp2 --no-multi-az
[client]
host=##identifier##.rds.host
user=##USER##
password=##PASSWORD##