Class: Bosh::Bootstrap::NetworkProviders::AWS
- Inherits:
-
Object
- Object
- Bosh::Bootstrap::NetworkProviders::AWS
- Defined in:
- lib/bosh-bootstrap/network_providers/aws.rb
Instance Attribute Summary collapse
-
#cyoi_provider_client ⇒ Object
readonly
Returns the value of attribute cyoi_provider_client.
Instance Method Summary collapse
-
#initialize(cyoi_provider_client) ⇒ AWS
constructor
A new instance of AWS.
- #perform(settings) ⇒ Object
Constructor Details
#initialize(cyoi_provider_client) ⇒ AWS
Returns a new instance of AWS.
5 6 7 |
# File 'lib/bosh-bootstrap/network_providers/aws.rb', line 5 def initialize(cyoi_provider_client) @cyoi_provider_client = cyoi_provider_client end |
Instance Attribute Details
#cyoi_provider_client ⇒ Object (readonly)
Returns the value of attribute cyoi_provider_client.
3 4 5 |
# File 'lib/bosh-bootstrap/network_providers/aws.rb', line 3 def cyoi_provider_client @cyoi_provider_client end |
Instance Method Details
#perform(settings) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/bosh-bootstrap/network_providers/aws.rb', line 9 def perform(settings) attributes = {} sg_suffix = "" if vpc_id = settings.exists?("address.vpc_id") attributes[:vpc_id] = vpc_id sg_suffix = "-#{vpc_id}" end security_groups.each do |name, ports| sg_name = "#{name}#{sg_suffix}" cyoi_provider_client.create_security_group(sg_name, name.to_s, {ports: ports}, attributes) end end |