Class: VagrantPlugins::AwsRoute53::Action::SetIp
- Inherits:
-
Object
- Object
- VagrantPlugins::AwsRoute53::Action::SetIp
- Defined in:
- lib/vagrant-aws-route53/action/set_ip.rb
Instance Method Summary collapse
- #call(environment) ⇒ Object
-
#initialize(app, environment) ⇒ SetIp
constructor
A new instance of SetIp.
Constructor Details
#initialize(app, environment) ⇒ SetIp
Returns a new instance of SetIp.
7 8 9 |
# File 'lib/vagrant-aws-route53/action/set_ip.rb', line 7 def initialize(app, environment) @app = app end |
Instance Method Details
#call(environment) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/vagrant-aws-route53/action/set_ip.rb', line 11 def call(environment) config = environment[:machine].config provider_config = environment[:machine].provider_config access_key_id = provider_config.access_key_id secret_access_key = provider_config.secret_access_key region = provider_config.region instance_id = environment[:machine].id hosted_zone_id = config.route53.hosted_zone_id record_set = config.route53.record_set set( access_key_id: access_key_id, secret_access_key: secret_access_key, region: region, instance_id: instance_id, hosted_zone_id: hosted_zone_id, record_set: record_set, ) do |instance_id, pubilic_ip, record_set| environment[:ui].info("#{instance_id}'s #{pubilic_ip} has been assigned to #{record_set[0]}[#{record_set[1]}]") end @app.call(environment) end |