ec2_templater 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +13 -0
- data/.rspec +2 -0
- data/.rubocop.yml +12 -0
- data/.travis.yml +4 -0
- data/CODE_OF_CONDUCT.md +13 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +21 -0
- data/README.md +110 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/ec2_templater.gemspec +33 -0
- data/example/config.yml +19 -0
- data/example/haproxy.cfg.erb +49 -0
- data/exe/ec2_templater +4 -0
- data/fixtures/vcr_cassettes/Executing_ec2_templater_with_example_config/will_write_the_rendered_template.yml +268 -0
- data/fixtures/vcr_cassettes/Filtered_Ec2_List_on_matching_tags/.yml +168 -0
- data/fixtures/vcr_cassettes/Filtered_Ec2_List_on_matching_tags/when_filters_do_not_match/.yml +53 -0
- data/fixtures/vcr_cassettes/ec2_run_instance.yml +764 -0
- data/fixtures/vcr_cassettes/ec2_terminate_instance.yml +65 -0
- data/lib/ec2_templater.rb +20 -0
- data/lib/ec2_templater/command_line.rb +22 -0
- data/lib/ec2_templater/ec2_grouper.rb +20 -0
- data/lib/ec2_templater/filtered_ec2_list.rb +40 -0
- data/lib/ec2_templater/monitor.rb +30 -0
- data/lib/ec2_templater/renderer.rb +33 -0
- data/lib/ec2_templater/runner.rb +20 -0
- data/lib/ec2_templater/version.rb +3 -0
- metadata +218 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ce28d946921545408313d670058a762cd3ba13b0
|
4
|
+
data.tar.gz: 5469b510ffbc2cde01062857e5cf3661e9d1dbc0
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 6ccca5749ad9dd9e5ed04ce397a9f04eb31dc3746ad159aa666e14040d095bb4e203a7ac294bf332936e5d8bc2437d1dd668e636d309f89bb6992ec283d5ffdf
|
7
|
+
data.tar.gz: ac03808aa36c0a2f97bab99ee130d6a4d226b8a7ee357ea233aa217d07247b0d97ab6e45276e9656fc755f2ba6a40876fb9c4fc48c4ef1825e593b075e50073a
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
AllCops:
|
2
|
+
Exclude:
|
3
|
+
- bin/**
|
4
|
+
- ec2_templater.gemspec
|
5
|
+
|
6
|
+
# Follow the Jim Weirich school of thought on usage of do/end vs. {...}:
|
7
|
+
# http://devblog.avdi.org/2011/07/26/the-procedurefunction-block-convention-in-ruby/
|
8
|
+
Blocks:
|
9
|
+
Enabled: false
|
10
|
+
|
11
|
+
Documentation:
|
12
|
+
Enabled: false
|
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.
|
4
|
+
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, or religion.
|
6
|
+
|
7
|
+
Examples of unacceptable behavior by participants include the use of sexual language or imagery, derogatory comments or personal attacks, trolling, public or private harassment, insults, or other unprofessional conduct.
|
8
|
+
|
9
|
+
Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. Project maintainers who do not follow the Code of Conduct may be removed from the project team.
|
10
|
+
|
11
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers.
|
12
|
+
|
13
|
+
This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.0.0, available at [http://contributor-covenant.org/version/1/0/0/](http://contributor-covenant.org/version/1/0/0/)
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2015 Adam Davies
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,110 @@
|
|
1
|
+
# Ec2Templater
|
2
|
+
|
3
|
+
Ec2Templater provides a means of EC2 service discovery by templating your
|
4
|
+
server config.
|
5
|
+
|
6
|
+
It works by periodically querying AWS for the list of running EC2 instances,
|
7
|
+
rendering a template, then running a notify command if it has changed.
|
8
|
+
Using this setup you can provide, for example, a haproxy config that
|
9
|
+
updates based on instances that are available filtered by tag.
|
10
|
+
|
11
|
+
For a full example, see the 'example' directory.
|
12
|
+
|
13
|
+
Note: AWS_REGION must be set by ENV var.
|
14
|
+
|
15
|
+
## Groupings
|
16
|
+
|
17
|
+
You must provide a way of grouping EC2's by configuring groups.
|
18
|
+
|
19
|
+
These groups are configured with a 'name' you can reference in your template,
|
20
|
+
and a list of EC2 filters as described in the AWS documentation.
|
21
|
+
|
22
|
+
## Notification
|
23
|
+
|
24
|
+
Finally, a notify command will be called when the rendered template has
|
25
|
+
changed, enabling you to SIGHUP your server, or do a reload as required.
|
26
|
+
|
27
|
+
## Configuration
|
28
|
+
|
29
|
+
Provided config can include:
|
30
|
+
|
31
|
+
template: template ERB source
|
32
|
+
target: target file to write rendered template to
|
33
|
+
interval: time in seconds between renders
|
34
|
+
notify_cmd: cmd to execute on change
|
35
|
+
vars: (optional) hash of vars to make available to the renderer
|
36
|
+
groups: hash of group names to ec2 filters, will be made available
|
37
|
+
to the template as '@groups', with values changed to instances
|
38
|
+
|
39
|
+
The filters should match those defined for the describe-instances api call.
|
40
|
+
http://docs.aws.amazon.com/cli/latest/reference/ec2/describe-instances.html
|
41
|
+
|
42
|
+
In your template, you can access groups as '@groups' which will
|
43
|
+
be a copy of the above hash with ec2 instances for each group name
|
44
|
+
in place of the filters.
|
45
|
+
|
46
|
+
The returned instances are <Types::Instance> from awssdk. See:
|
47
|
+
http://docs.aws.amazon.com/sdkforruby/api/Aws/EC2/Types/Instance.html
|
48
|
+
|
49
|
+
Example:
|
50
|
+
|
51
|
+
---
|
52
|
+
template: '/etc/haproxy_templater/haproxy.erb.cfg'
|
53
|
+
target: '/etc/haproxy/haproxy.cfg'
|
54
|
+
interval: 60
|
55
|
+
notify_cmd: 'service haproxy reload'
|
56
|
+
vars:
|
57
|
+
other_vars: value
|
58
|
+
groups:
|
59
|
+
site_backends:
|
60
|
+
tag:Environment: Production
|
61
|
+
tag:Role: app
|
62
|
+
kibana_backends:
|
63
|
+
tag:Environment: Production
|
64
|
+
tag:Role: log_index
|
65
|
+
|
66
|
+
Example @groups content:
|
67
|
+
|
68
|
+
{
|
69
|
+
site_backends: [ec2_instance, ...],
|
70
|
+
kibana_backends: [ec2_instance, ..]
|
71
|
+
}
|
72
|
+
|
73
|
+
Example invocation:
|
74
|
+
|
75
|
+
$ AWS_REGION=ap-southeast-2 bundle exec ec2_templater --config example/config.yml
|
76
|
+
|
77
|
+
## Installation
|
78
|
+
|
79
|
+
Install the gem into your server either as a specific user, or system wide.
|
80
|
+
|
81
|
+
```ruby
|
82
|
+
gem install 'ec2_templater'
|
83
|
+
```
|
84
|
+
|
85
|
+
## Usage
|
86
|
+
|
87
|
+
Run the daemon via the executable "ec2_templater" and provide the configuration
|
88
|
+
file with "-c":
|
89
|
+
|
90
|
+
```ec2_templater -c /etc/ec2_templater/config.yml```
|
91
|
+
|
92
|
+
## Development
|
93
|
+
|
94
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
95
|
+
|
96
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
97
|
+
|
98
|
+
Note that the specs are built to run an EC2 instance, then terminate it,
|
99
|
+
and the AWS API interactions have been recorded with VCR for fast playback.
|
100
|
+
To regenerate, start with an empty AWS account, set VCR to record :all rather
|
101
|
+
than :none, and rm -rf ./fixtures
|
102
|
+
|
103
|
+
## Contributing
|
104
|
+
|
105
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/reinteractive/ec2_templater. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](contributor-covenant.org) code of conduct.
|
106
|
+
|
107
|
+
|
108
|
+
## License
|
109
|
+
|
110
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require 'bundler/setup'
|
4
|
+
require 'ec2_templater'
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require 'irb'
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'ec2_templater/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = 'ec2_templater'
|
8
|
+
spec.version = Ec2Templater::VERSION
|
9
|
+
spec.authors = ['Adam Davies']
|
10
|
+
spec.email = ['adzdavies@gmail.com', 'rubygems@reinteractive.net']
|
11
|
+
|
12
|
+
spec.summary = 'EC2 service discovery by templating your server config'
|
13
|
+
spec.description = 'Ec2Templater provides a means of EC2 service discovery by templating your server config. It works by periodically querying AWS for the list of running EC2 instances, rendering a template, then running a notify command if it has changed. Using this setup you can provide, for example, a haproxy config that updates based on instances that are available filtered by tag'
|
14
|
+
spec.homepage = "https://github.com/reinteractive/ec2_templater"
|
15
|
+
spec.license = 'MIT'
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
|
+
spec.bindir = 'exe'
|
19
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
|
+
spec.require_paths = ['lib']
|
21
|
+
|
22
|
+
spec.add_runtime_dependency 'aws-sdk', '~> 2.2'
|
23
|
+
spec.add_runtime_dependency 'erubis', '~> 2.7'
|
24
|
+
spec.add_runtime_dependency 'clamp', '~> 1.0'
|
25
|
+
|
26
|
+
spec.add_development_dependency 'bundler', '~> 1.10'
|
27
|
+
spec.add_development_dependency 'rake', '~> 10.0'
|
28
|
+
spec.add_development_dependency 'rspec', '~> 3.4'
|
29
|
+
spec.add_development_dependency 'vcr', '~> 2.9'
|
30
|
+
spec.add_development_dependency 'webmock', '~> 1.24'
|
31
|
+
spec.add_development_dependency 'rubocop', '~> 0.37'
|
32
|
+
spec.add_development_dependency 'pry-byebug', '~> 3.3'
|
33
|
+
end
|
data/example/config.yml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
template: './example/haproxy.cfg.erb'
|
2
|
+
target: '/tmp/ec2_templated.haproxy.cfg'
|
3
|
+
interval: 60
|
4
|
+
notify_cmd: 'touch /tmp/ec2_templater_has_run'
|
5
|
+
|
6
|
+
vars:
|
7
|
+
app_port: 3000
|
8
|
+
monitoring_port: 9494
|
9
|
+
|
10
|
+
groups:
|
11
|
+
prod_app_servers:
|
12
|
+
tag:Environment: Production
|
13
|
+
tag:Role: app
|
14
|
+
staging_app_servers:
|
15
|
+
tag:Environment: Staging
|
16
|
+
tag:Role: app
|
17
|
+
monitoring_servers:
|
18
|
+
tag:Environment: Production
|
19
|
+
tag:Role: app
|
@@ -0,0 +1,49 @@
|
|
1
|
+
global
|
2
|
+
daemon
|
3
|
+
maxconn 256
|
4
|
+
|
5
|
+
defaults
|
6
|
+
mode http
|
7
|
+
timeout connect 5000ms
|
8
|
+
timeout client 50000ms
|
9
|
+
timeout server 50000ms
|
10
|
+
|
11
|
+
frontend app_server
|
12
|
+
mode http
|
13
|
+
maxconn 4096
|
14
|
+
bind 0.0.0.0:80
|
15
|
+
|
16
|
+
# Backends: hdr_end for ends with, and "-i" to ignore case
|
17
|
+
<%- unless @groups[:prod_app_servers].empty? -%>
|
18
|
+
use_backend prod-app if { hdr_end(host) -i -- prod.example.com }
|
19
|
+
<%- end -%>
|
20
|
+
<%- unless @groups[:staging_app_servers].empty? -%>
|
21
|
+
use_backend staging-app if { hdr_end(host) -i -- staging.example.com }
|
22
|
+
<%- end -%>
|
23
|
+
<%- unless @groups[:monitoring_servers].empty? -%>
|
24
|
+
use_backend monitoring if { hdr_end(host) -i -- monitoring.example.com }
|
25
|
+
<%- end -%>
|
26
|
+
|
27
|
+
<%- unless @groups[:prod_app_servers].empty? -%>
|
28
|
+
backend prod-app
|
29
|
+
description Prod app servers
|
30
|
+
<%- for server in @groups[:prod_app_servers] -%>
|
31
|
+
server <%= server.private_dns_name %> <%= server.private_ip_address%>:<%= @app_port %> maxconn 20 check
|
32
|
+
<%- end -%>
|
33
|
+
<%- end -%>
|
34
|
+
|
35
|
+
<%- unless @groups[:staging_app_servers].empty? -%>
|
36
|
+
backend staging-app
|
37
|
+
description Staging app server
|
38
|
+
<%- for server in @groups[:staging_app_servers] -%>
|
39
|
+
server <%= server.private_dns_name %> <%= server.private_ip_address%>:<%= @app_port %> maxconn 20 check
|
40
|
+
<%- end -%>
|
41
|
+
<%- end -%>
|
42
|
+
|
43
|
+
<%- unless @groups[:monitoring_servers].empty? -%>
|
44
|
+
backend monitoring
|
45
|
+
description Monitoring app servers
|
46
|
+
<%- for server in @groups[:monitoring_servers] -%>
|
47
|
+
server <%= server.private_dns_name %> <%= server.private_ip_address%>:<%= @monitoring_port %> maxconn 20 check
|
48
|
+
<%- end -%>
|
49
|
+
<%- end -%>
|
data/exe/ec2_templater
ADDED
@@ -0,0 +1,268 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://ec2.ap-southeast-2.amazonaws.com/
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: Action=DescribeInstances&Filter.1.Name=instance-state-name&Filter.1.Value.1=running&Filter.2.Name=tag%3AEnvironment&Filter.2.Value.1=Production&Filter.3.Name=tag%3ARole&Filter.3.Value.1=app&Version=2015-10-01
|
9
|
+
headers:
|
10
|
+
Content-Type:
|
11
|
+
- application/x-www-form-urlencoded; charset=utf-8
|
12
|
+
Accept-Encoding:
|
13
|
+
- ''
|
14
|
+
User-Agent:
|
15
|
+
- aws-sdk-ruby2/2.2.3 ruby/2.2.3 x86_64-darwin14
|
16
|
+
X-Amz-Date:
|
17
|
+
- 20151207T062038Z
|
18
|
+
Host:
|
19
|
+
- ec2.ap-southeast-2.amazonaws.com
|
20
|
+
X-Amz-Content-Sha256:
|
21
|
+
- 02d625ecee1ab192a8c957dc89cb6baaa132a63351f2ca1981592ce03a234e30
|
22
|
+
Authorization:
|
23
|
+
- "<AUTHORIZATION>"
|
24
|
+
Content-Length:
|
25
|
+
- '208'
|
26
|
+
Accept:
|
27
|
+
- "*/*"
|
28
|
+
response:
|
29
|
+
status:
|
30
|
+
code: 200
|
31
|
+
message: OK
|
32
|
+
headers:
|
33
|
+
Content-Type:
|
34
|
+
- text/xml;charset=UTF-8
|
35
|
+
Transfer-Encoding:
|
36
|
+
- chunked
|
37
|
+
Vary:
|
38
|
+
- Accept-Encoding
|
39
|
+
Date:
|
40
|
+
- Mon, 07 Dec 2015 06:20:29 GMT
|
41
|
+
Server:
|
42
|
+
- AmazonEC2
|
43
|
+
body:
|
44
|
+
encoding: UTF-8
|
45
|
+
string: |-
|
46
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
47
|
+
<DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2015-10-01/">
|
48
|
+
<requestId>48412e3e-96f0-4c19-8a53-d9776903950d</requestId>
|
49
|
+
<reservationSet/>
|
50
|
+
</DescribeInstancesResponse>
|
51
|
+
http_version:
|
52
|
+
recorded_at: Mon, 07 Dec 2015 06:20:38 GMT
|
53
|
+
- request:
|
54
|
+
method: post
|
55
|
+
uri: https://ec2.ap-southeast-2.amazonaws.com/
|
56
|
+
body:
|
57
|
+
encoding: UTF-8
|
58
|
+
string: Action=DescribeInstances&Filter.1.Name=instance-state-name&Filter.1.Value.1=running&Filter.2.Name=tag%3AEnvironment&Filter.2.Value.1=Staging&Filter.3.Name=tag%3ARole&Filter.3.Value.1=app&Version=2015-10-01
|
59
|
+
headers:
|
60
|
+
Content-Type:
|
61
|
+
- application/x-www-form-urlencoded; charset=utf-8
|
62
|
+
Accept-Encoding:
|
63
|
+
- ''
|
64
|
+
User-Agent:
|
65
|
+
- aws-sdk-ruby2/2.2.3 ruby/2.2.3 x86_64-darwin14
|
66
|
+
X-Amz-Date:
|
67
|
+
- 20151207T062038Z
|
68
|
+
Host:
|
69
|
+
- ec2.ap-southeast-2.amazonaws.com
|
70
|
+
X-Amz-Content-Sha256:
|
71
|
+
- 888b2a3ded69af237b9163c3b8c04fbe3198dd20ae9ee87473e0fe5ba0c71d8d
|
72
|
+
Authorization:
|
73
|
+
- "<AUTHORIZATION>"
|
74
|
+
Content-Length:
|
75
|
+
- '205'
|
76
|
+
Accept:
|
77
|
+
- "*/*"
|
78
|
+
response:
|
79
|
+
status:
|
80
|
+
code: 200
|
81
|
+
message: OK
|
82
|
+
headers:
|
83
|
+
Content-Type:
|
84
|
+
- text/xml;charset=UTF-8
|
85
|
+
Transfer-Encoding:
|
86
|
+
- chunked
|
87
|
+
Vary:
|
88
|
+
- Accept-Encoding
|
89
|
+
Date:
|
90
|
+
- Mon, 07 Dec 2015 06:20:30 GMT
|
91
|
+
Server:
|
92
|
+
- AmazonEC2
|
93
|
+
body:
|
94
|
+
encoding: UTF-8
|
95
|
+
string: |-
|
96
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
97
|
+
<DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2015-10-01/">
|
98
|
+
<requestId>e9f999ec-f203-453b-b10f-88d47ef734b2</requestId>
|
99
|
+
<reservationSet>
|
100
|
+
<item>
|
101
|
+
<reservationId>r-694f58b5</reservationId>
|
102
|
+
<ownerId>492770473521</ownerId>
|
103
|
+
<groupSet/>
|
104
|
+
<instancesSet>
|
105
|
+
<item>
|
106
|
+
<instanceId>i-e094e03f</instanceId>
|
107
|
+
<imageId>ami-187a247b</imageId>
|
108
|
+
<instanceState>
|
109
|
+
<code>16</code>
|
110
|
+
<name>running</name>
|
111
|
+
</instanceState>
|
112
|
+
<privateDnsName>ip-172-31-3-155.ap-southeast-2.compute.internal</privateDnsName>
|
113
|
+
<dnsName>ec2-52-62-79-7.ap-southeast-2.compute.amazonaws.com</dnsName>
|
114
|
+
<reason/>
|
115
|
+
<keyName>the_adam</keyName>
|
116
|
+
<amiLaunchIndex>0</amiLaunchIndex>
|
117
|
+
<productCodes/>
|
118
|
+
<instanceType>t2.micro</instanceType>
|
119
|
+
<launchTime>2015-12-07T06:19:43.000Z</launchTime>
|
120
|
+
<placement>
|
121
|
+
<availabilityZone>ap-southeast-2a</availabilityZone>
|
122
|
+
<groupName/>
|
123
|
+
<tenancy>default</tenancy>
|
124
|
+
</placement>
|
125
|
+
<monitoring>
|
126
|
+
<state>disabled</state>
|
127
|
+
</monitoring>
|
128
|
+
<subnetId>subnet-5ff7683a</subnetId>
|
129
|
+
<vpcId>vpc-d4cd70b1</vpcId>
|
130
|
+
<privateIpAddress>172.31.3.155</privateIpAddress>
|
131
|
+
<ipAddress>52.62.79.7</ipAddress>
|
132
|
+
<sourceDestCheck>true</sourceDestCheck>
|
133
|
+
<groupSet>
|
134
|
+
<item>
|
135
|
+
<groupId>sg-6ec8860b</groupId>
|
136
|
+
<groupName>default</groupName>
|
137
|
+
</item>
|
138
|
+
</groupSet>
|
139
|
+
<architecture>x86_64</architecture>
|
140
|
+
<rootDeviceType>ebs</rootDeviceType>
|
141
|
+
<rootDeviceName>/dev/sda1</rootDeviceName>
|
142
|
+
<blockDeviceMapping>
|
143
|
+
<item>
|
144
|
+
<deviceName>/dev/sda1</deviceName>
|
145
|
+
<ebs>
|
146
|
+
<volumeId>vol-ccf64a06</volumeId>
|
147
|
+
<status>attached</status>
|
148
|
+
<attachTime>2015-12-07T06:19:46.000Z</attachTime>
|
149
|
+
<deleteOnTermination>true</deleteOnTermination>
|
150
|
+
</ebs>
|
151
|
+
</item>
|
152
|
+
</blockDeviceMapping>
|
153
|
+
<virtualizationType>hvm</virtualizationType>
|
154
|
+
<clientToken/>
|
155
|
+
<tagSet>
|
156
|
+
<item>
|
157
|
+
<key>Role</key>
|
158
|
+
<value>app</value>
|
159
|
+
</item>
|
160
|
+
<item>
|
161
|
+
<key>Environment</key>
|
162
|
+
<value>Staging</value>
|
163
|
+
</item>
|
164
|
+
</tagSet>
|
165
|
+
<hypervisor>xen</hypervisor>
|
166
|
+
<networkInterfaceSet>
|
167
|
+
<item>
|
168
|
+
<networkInterfaceId>eni-f14ccd96</networkInterfaceId>
|
169
|
+
<subnetId>subnet-5ff7683a</subnetId>
|
170
|
+
<vpcId>vpc-d4cd70b1</vpcId>
|
171
|
+
<description/>
|
172
|
+
<ownerId>492770473521</ownerId>
|
173
|
+
<status>in-use</status>
|
174
|
+
<macAddress>02:6f:05:18:b7:c5</macAddress>
|
175
|
+
<privateIpAddress>172.31.3.155</privateIpAddress>
|
176
|
+
<privateDnsName>ip-172-31-3-155.ap-southeast-2.compute.internal</privateDnsName>
|
177
|
+
<sourceDestCheck>true</sourceDestCheck>
|
178
|
+
<groupSet>
|
179
|
+
<item>
|
180
|
+
<groupId>sg-6ec8860b</groupId>
|
181
|
+
<groupName>default</groupName>
|
182
|
+
</item>
|
183
|
+
</groupSet>
|
184
|
+
<attachment>
|
185
|
+
<attachmentId>eni-attach-5dfdda63</attachmentId>
|
186
|
+
<deviceIndex>0</deviceIndex>
|
187
|
+
<status>attached</status>
|
188
|
+
<attachTime>2015-12-07T06:19:43.000Z</attachTime>
|
189
|
+
<deleteOnTermination>true</deleteOnTermination>
|
190
|
+
</attachment>
|
191
|
+
<association>
|
192
|
+
<publicIp>52.62.79.7</publicIp>
|
193
|
+
<publicDnsName>ec2-52-62-79-7.ap-southeast-2.compute.amazonaws.com</publicDnsName>
|
194
|
+
<ipOwnerId>amazon</ipOwnerId>
|
195
|
+
</association>
|
196
|
+
<privateIpAddressesSet>
|
197
|
+
<item>
|
198
|
+
<privateIpAddress>172.31.3.155</privateIpAddress>
|
199
|
+
<privateDnsName>ip-172-31-3-155.ap-southeast-2.compute.internal</privateDnsName>
|
200
|
+
<primary>true</primary>
|
201
|
+
<association>
|
202
|
+
<publicIp>52.62.79.7</publicIp>
|
203
|
+
<publicDnsName>ec2-52-62-79-7.ap-southeast-2.compute.amazonaws.com</publicDnsName>
|
204
|
+
<ipOwnerId>amazon</ipOwnerId>
|
205
|
+
</association>
|
206
|
+
</item>
|
207
|
+
</privateIpAddressesSet>
|
208
|
+
</item>
|
209
|
+
</networkInterfaceSet>
|
210
|
+
<ebsOptimized>false</ebsOptimized>
|
211
|
+
</item>
|
212
|
+
</instancesSet>
|
213
|
+
</item>
|
214
|
+
</reservationSet>
|
215
|
+
</DescribeInstancesResponse>
|
216
|
+
http_version:
|
217
|
+
recorded_at: Mon, 07 Dec 2015 06:20:38 GMT
|
218
|
+
- request:
|
219
|
+
method: post
|
220
|
+
uri: https://ec2.ap-southeast-2.amazonaws.com/
|
221
|
+
body:
|
222
|
+
encoding: UTF-8
|
223
|
+
string: Action=DescribeInstances&Filter.1.Name=instance-state-name&Filter.1.Value.1=running&Filter.2.Name=tag%3AEnvironment&Filter.2.Value.1=Production&Filter.3.Name=tag%3ARole&Filter.3.Value.1=app&Version=2015-10-01
|
224
|
+
headers:
|
225
|
+
Content-Type:
|
226
|
+
- application/x-www-form-urlencoded; charset=utf-8
|
227
|
+
Accept-Encoding:
|
228
|
+
- ''
|
229
|
+
User-Agent:
|
230
|
+
- aws-sdk-ruby2/2.2.3 ruby/2.2.3 x86_64-darwin14
|
231
|
+
X-Amz-Date:
|
232
|
+
- 20151207T062038Z
|
233
|
+
Host:
|
234
|
+
- ec2.ap-southeast-2.amazonaws.com
|
235
|
+
X-Amz-Content-Sha256:
|
236
|
+
- 02d625ecee1ab192a8c957dc89cb6baaa132a63351f2ca1981592ce03a234e30
|
237
|
+
Authorization:
|
238
|
+
- "<AUTHORIZATION>"
|
239
|
+
Content-Length:
|
240
|
+
- '208'
|
241
|
+
Accept:
|
242
|
+
- "*/*"
|
243
|
+
response:
|
244
|
+
status:
|
245
|
+
code: 200
|
246
|
+
message: OK
|
247
|
+
headers:
|
248
|
+
Content-Type:
|
249
|
+
- text/xml;charset=UTF-8
|
250
|
+
Transfer-Encoding:
|
251
|
+
- chunked
|
252
|
+
Vary:
|
253
|
+
- Accept-Encoding
|
254
|
+
Date:
|
255
|
+
- Mon, 07 Dec 2015 06:20:30 GMT
|
256
|
+
Server:
|
257
|
+
- AmazonEC2
|
258
|
+
body:
|
259
|
+
encoding: UTF-8
|
260
|
+
string: |-
|
261
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
262
|
+
<DescribeInstancesResponse xmlns="http://ec2.amazonaws.com/doc/2015-10-01/">
|
263
|
+
<requestId>df37c62c-c5db-4b82-8ad7-81ca7a1d92c8</requestId>
|
264
|
+
<reservationSet/>
|
265
|
+
</DescribeInstancesResponse>
|
266
|
+
http_version:
|
267
|
+
recorded_at: Mon, 07 Dec 2015 06:20:38 GMT
|
268
|
+
recorded_with: VCR 2.9.3
|