Terraform
public class Terraform
A Terraform object is a wrapper around the terraform executable. It can be used to perform common
operations like planning and applying changes, retrieving provider schemas and retrieving versions
This class is the only object to be instanciated directly by the user.
-
Undocumented
Declaration
Swift
public static let defaultTerraformVersion: String -
Undocumented
Declaration
Swift
public struct InvocationSettings -
Undocumented
See moreDeclaration
Swift
public enum TerraformError : Error -
Configure a new Terraform environment. Terraform will be downloaded if necessary.
Declaration
Swift
public init?( configuration: AnyEncodable? = nil, workingDirectoryURL : URL? = nil, version : String = Terraform.defaultTerraformVersion, terraformExecutable: URL? = nil, colorMode : ColorMode = .none )Parameters
configurationAn Encodable to be used as Terraform configuration. This object will be encoded using the JSON decoder and saved to a file called main.tf.json
workingDirectoryURLURL of Terraforms working directory. If left empty, a temporary directory will be created
versionThe version of Terraform to be used
terraformExecutableURL of the Terraform executable to use. If this value is not present TerraformKit will download a suitable release of Terraform
colorModeWhether to emit colored output
-
Remove the temporary working directory of terraform. Calling this function is not allowed, if a working directory was specified in the initializer
Declaration
Swift
public func cleanup() -
Run
terraform initDeclaration
Swift
public func initialize(invocationSettings: InvocationSettings? = nil) throws -
Run
terraform planDeclaration
Swift
public func plan(destroy: Bool = false, invocationSettings: InvocationSettings? = nil ) throws -> Plan -
Run
terraform applyDeclaration
Swift
public func apply(plan: Plan, invocationSettings: InvocationSettings? = nil) throwsParameters
planThe plan to execute
-
Run
terraform destroyDeclaration
Swift
public func destroy(invocationSettings: InvocationSettings? = nil) throws -
Fetch the current provider schema
Declaration
Swift
public func schema() throws -> SchemaDescriptionReturn Value
The schema description
-
Determine the currenly used version of terraform and the versions of all installed providers
Declaration
Swift
public func version() throws -> VersionDescriptionReturn Value
The current version of terraform and all configured providers