Skip to content

paulojeronimo/gs-rest-service-aws

Repository files navigation

Scripts to create an AWS EC2 instance that runs gs-rest-service

2. Creation

Create some files and do initial configurations with the following command:

$ ./create

Source aws-variables before using any of the following vagrant commands.

$ source aws-variables

Type the following if you want to see if the variables were correctly configured:

$ echo $ACCESS_KEY_ID
$ echo $SECRET_ACCESS_KEY

Execute the following commands to start vagrant provision and wait for this process finishes.

$ vagrant box add aws-dummy https://github.com/mitchellh/vagrant-aws/raw/master/dummy.box

$ vagrant up

Expected output:

Bringing machine 'gs-rest-service' up with 'aws' provider...
==> gs-rest-service: Warning! The AWS provider doesn't support any of the Vagrant
==> gs-rest-service: high-level network configurations (`config.vm.network`). They
==> gs-rest-service: will be silently ignored.
==> gs-rest-service: Launching an instance with the following settings...
==> gs-rest-service:  -- Type: t2.micro
==> gs-rest-service:  -- AMI: ami-0739f8cdb239fe9ae
==> gs-rest-service:  -- Region: us-east-1
==> gs-rest-service:  -- Keypair: vagrant
==> gs-rest-service:  -- Security Groups: ["vagrant"]
==> gs-rest-service:  -- Block Device Mapping: []
==> gs-rest-service:  -- Terminate On Shutdown: false
==> gs-rest-service:  -- Monitoring: false
==> gs-rest-service:  -- EBS optimized: false
==> gs-rest-service:  -- Source Destination check:
==> gs-rest-service:  -- Assigning a public IP address in a VPC: false
==> gs-rest-service:  -- VPC tenancy specification: default
==> gs-rest-service: Waiting for instance to become "ready"...
==> gs-rest-service: Waiting for SSH to become available...
==> gs-rest-service: Machine is booted and ready for use!
==> gs-rest-service: Running provisioner: shell...
    gs-rest-service: Running: inline script
    gs-rest-service: Cloning into 'provision-scripts'...
    gs-rest-service: Loading configuration file /home/ubuntu/provision-scripts/config.sample ...
    gs-rest-service: Provision pipeline "install" started by ubuntu at /home/ubuntu/provision-scripts ...
    gs-rest-service: Updating packages cache ...
    gs-rest-service: Installing utility packages ...
    gs-rest-service: Installing dotfiles (https://github.com/paulojeronimo/dotfiles) into /home/ubuntu ...
    gs-rest-service: Provision finishes with success!

3. Information

$ ./aws-ip-address
34.207.190.179

$ ./aws-dns-name
ec2-34-207-190-179.compute-1.amazonaws.com

4. Access

Using vagrant:

$ vagrant ssh

Using ssh:

$ ssh -i vagrant.pem ubuntu@$(./aws-ip-address)

5. Removal

Use vagrant to destroy the vm:

$ vagrant destroy

Wait until machine is destroyed (check the status using the following command):

$ vagrant status

5.1. Optional steps

Remove configurations maded in aws and the local generated files:

$ ./remove

Remove the dummy box:

$ vagrant box remove aws-dummy

6. Problems and Solutions

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages