class RubyTerraform::Commands::ProvidersMirror

Wraps the +terraform providers mirror+ command which saves local copies of all required provider plugins.

Populates a local directory with copies of the provider plugins needed for the current configuration, so that the directory can be used either directly as a filesystem mirror or as the basis for a network mirror and thus obtain those providers without access to their origin registries in future.

The mirror directory will contain JSON index files that can be published along with the mirrored packages on a static HTTP file server to produce a network mirror. Those index files will be ignored if the directory is used instead as a local filesystem mirror.

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

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

@example Basic Invocation

RubyTerraform::Commands::ProvidersMirror.new.execute(
  directory: './plugins',
  platforms: ["windows_amd64", "darwin_amd64", "linux_amd64"])

Public Instance Methods

arguments(parameters) click to toggle source

@!visibility private

# File lib/ruby_terraform/commands/providers_mirror.rb, line 61
def arguments(parameters)
  [parameters[:directory]]
end
options() click to toggle source

@!visibility private

Calls superclass method RubyTerraform::Options::Global#options
# File lib/ruby_terraform/commands/providers_mirror.rb, line 56
def options
  %w[-platform] + super
end
subcommands() click to toggle source

@!visibility private

# File lib/ruby_terraform/commands/providers_mirror.rb, line 51
def subcommands
  %w[providers mirror]
end