Sha256: ef650d37247da9143ff250ba83170147963da60196b2c4096196508ca67a1e0f

Contents?: true

Size: 799 Bytes

Versions: 4

Compression:

Stored size: 799 Bytes

Contents

module Bosh::Bootstrap::NetworkProviders
  class AWS
    attr_reader :cyoi_provider_client

    def initialize(cyoi_provider_client)
      @cyoi_provider_client = cyoi_provider_client
    end

    def perform(settings)
      attributes = {}
      if vpc_id = settings.exists?("address.vpc_id")
        attributes[:vpc_id] = vpc_id
      end
      security_groups.each do |name, ports|
        cyoi_provider_client.create_security_group(name.to_s, name.to_s, {ports: ports}, attributes)
      end
    end

    protected
    def security_groups
      {
        ssh: 22,
        dns_server: { protocol: "udp", ports: (53..53) },
        bosh: [4222, 6868, 25250, 25555, 25777]
      }
    end
  end
end
Bosh::Bootstrap::NetworkProviders.register_provider("aws", Bosh::Bootstrap::NetworkProviders::AWS)

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
bosh-bootstrap-0.14.3 lib/bosh-bootstrap/network_providers/aws.rb
bosh-bootstrap-0.14.2 lib/bosh-bootstrap/network_providers/aws.rb
bosh-bootstrap-0.14.1 lib/bosh-bootstrap/network_providers/aws.rb
bosh-bootstrap-0.14.0 lib/bosh-bootstrap/network_providers/aws.rb