Sha256: 3600d67b5904fd28be547fe7b132440d495e3da0c618074bdba9f28e1dd83686

Contents?: true

Size: 1.57 KB

Versions: 10

Compression:

Stored size: 1.57 KB

Contents

module Kontena::Cli::Nodes::Aws
  class CreateCommand < Clamp::Command
    include Kontena::Cli::Common
    include Kontena::Cli::GridOptions

    parameter "[NAME]", "Node name"
    option "--access-key", "ACCESS_KEY", "AWS access key ID", required: true
    option "--secret-key", "SECRET_KEY", "AWS secret key", required: true
    option "--key-pair", "KEY_PAIR", "EC2 Key Pair", required: true
    option "--region", "REGION", "EC2 Region", default: 'eu-west-1'
    option "--zone", "ZONE", "EC2 Availability Zone", default: 'a'
    option "--vpc-id", "VPC ID", "Virtual Private Cloud (VPC) ID (default: default vpc)"
    option "--subnet-id", "SUBNET ID", "VPC option to specify subnet to launch instance into (default: first subnet in vpc/az)"
    option "--type", "SIZE", "Instance type", default: 't2.small'
    option "--storage", "STORAGE", "Storage size (GiB)", default: '30'
    option "--version", "VERSION", "Define installed Kontena version", default: 'latest'

    def execute
      require_api_url
      require_current_grid

      require 'kontena/machine/aws'
      grid = client(require_token).get("grids/#{current_grid}")
      provisioner = Kontena::Machine::Aws::NodeProvisioner.new(client(require_token), access_key, secret_key, region)
      provisioner.run!(
          master_uri: api_url,
          grid_token: grid['token'],
          grid: current_grid,
          name: name,
          type: type,
          vpc: vpc_id,
          zone: zone,
          subnet: subnet_id,
          storage: storage,
          version: version,
          key_pair: key_pair
      )
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
kontena-cli-0.14.0 lib/kontena/cli/nodes/aws/create_command.rb
kontena-cli-0.13.4 lib/kontena/cli/nodes/aws/create_command.rb
kontena-cli-0.13.3 lib/kontena/cli/nodes/aws/create_command.rb
kontena-cli-0.13.2 lib/kontena/cli/nodes/aws/create_command.rb
kontena-cli-0.13.1 lib/kontena/cli/nodes/aws/create_command.rb
kontena-cli-0.13.0.1 lib/kontena/cli/nodes/aws/create_command.rb
kontena-cli-0.13.0 lib/kontena/cli/nodes/aws/create_command.rb
kontena-cli-0.12.3 lib/kontena/cli/nodes/aws/create_command.rb
kontena-cli-0.12.2 lib/kontena/cli/nodes/aws/create_command.rb
kontena-cli-0.12.1 lib/kontena/cli/nodes/aws/create_command.rb