class RubyTerraform::Commands::Login

Wraps the +terraform login+ command which retrieves an authentication token for the given hostname, if it supports automatic login, and saves it in a credentials file in your home directory.

If no hostname is provided, the default hostname is app.terraform.io, to log in to Terraform Cloud.

If not overridden by credentials helper settings in the CLI configuration, the credentials will be written to the following local file:

~/.terraform.d/credentials.tfrc.json

For options accepted on construction, see {#initialize}.

When executing an instance of {Login} via {#execute}, the following options are supported:

@example Basic Invocation

RubyTerraform::Commands::Login.new.execute

Public Instance Methods

arguments(parameters) click to toggle source

@!visibility private

# File lib/ruby_terraform/commands/login.rb, line 39
def arguments(parameters)
  [parameters[:hostname]]
end
subcommands() click to toggle source

@!visibility private

# File lib/ruby_terraform/commands/login.rb, line 34
def subcommands
  %w[login]
end