AWS main components:
- S3 (Simple storage service)
- SQS (Simple Queue Service)
- EC2 (Elastic Compute Cloud)
- Elastic Beanstalk - PaaS
- EBS (Elastic Block Store) - block storage
- Instance store-based AMIs - are similar to ephemeral boot drive of openstack.
- CloudFormation - orchestration tool (like puppet) from Amazon similar to Heat for OpenStack
- CloudFront - CDN feature of Amazon Web services cloud
- ELB (Elastic Load Balancer)
- Amazon DynamoDB - NoSQL DB from Amazon
S3 - containers
(called buckets) - object storage
For eg. Netflix uses
S3 to store movies which are then streamed to their customers.
Using AWS CLI: -
Installing on Mac/Linux is pretty easy if you already have pip installed:
$ pip install awscli
To get started and create an ubuntu instance all using the CLI:
- Create a key pair to use for accessing the VM
$ aws ec2
create-key-pair --key-name watshkeydev --query 'KeyMaterial' --output text >
watshkeydev.pem
$ chmod 400
watshkeydev.pem
- Create security group and create a rule in the group to allow your CIDR subnet address or single IP to access the VM. With 0.0.0.0/0 we allow any host to be able to connect which is fine for test setup as we still require the private key to be able to ssh to VM.
$ aws ec2
create-security-group --group-name devenv-sg --description "security group
for development environment in EC2"
$ aws ec2
authorize-security-group-ingress --group-name devenv-sg --protocol tcp --port
22 --cidr 0.0.0.0/0
- Launch the VM instance
$ aws ec2
run-instances --image-id ami-29ebb519
--count 1 --instance-type t2.micro --key-name devenv-key --security-groups
devenv-sg --query 'Instances[0].InstanceId'
"i-b0b0ac89"
The image id is that
of Ubuntu 14.04.1 Trusty release.
This step will take some time so wait and in between if you want yoy can poll for the VM status with the following command:
$ aws ec2 describe-instances --instance-ids i-b0b0ac89 --query 'Reservations[0].Instances[0].State.Name'
"running"
Once it is running proceed to the next step.
- Connect to the VM
$ aws ec2
describe-instances --instance-ids i-b0b0ac89 --query
'Reservations[0].Instances[0].PublicIpAddress'
"x.y.z.k"
$ ssh -i
watshkeydev.pem ubuntu@x.y.z.k
- Start/stop the instance remotely
$ aws ec2
stop-instances --instance-ids i-b0b0ac89
$ aws ec2
start-instances --instance-ids i-b0b0ac89
No comments:
Post a Comment