Terraform API reference

Packages:

infra.contrib.fluxcd.io/v1alpha2

Resource Types:

    BackendConfigSpec

    (Appears on: TerraformSpec)

    BackendConfigSpec is for specifying configuration for Terraform’s Kubernetes backend

    Field Description
    disable
    bool
    (Optional)

    Disable is to completely disable the backend configuration.

    secretSuffix
    string
    (Optional)
    inClusterConfig
    bool
    (Optional)
    customConfiguration
    string
    (Optional)
    configPath
    string
    (Optional)
    labels
    map[string]string
    (Optional)

    BackendConfigsReference

    (Appears on: TerraformSpec)

    Field Description
    kind
    string

    Kind of the values referent, valid values are (‘Secret’, ‘ConfigMap’).

    name
    string

    Name of the configs referent. Should reside in the same namespace as the referring resource.

    keys
    []string
    (Optional)

    Keys is the data key where a specific value can be found at. Defaults to all keys.

    optional
    bool
    (Optional)

    Optional marks this BackendConfigsReference as optional. When set, a not found error for the values reference is ignored, but any Key or transient error will still result in a reconciliation failure.

    BranchPlanner

    (Appears on: TerraformSpec)

    Field Description
    enablePathScope
    bool
    (Optional)

    EnablePathScope specifies if the Branch Planner should or shouldn’t check if a Pull Request has changes under .spec.path. If enabled extra resources will be created only if there are any changes in terraform files.

    CloudSpec

    (Appears on: TerraformSpec)

    Field Description
    organization
    string
    workspaces
    CloudWorkspacesSpec
    hostname
    string
    (Optional)
    token
    string
    (Optional)

    CloudWorkspacesSpec

    (Appears on: CloudSpec)

    Field Description
    name
    string
    (Optional)
    tags
    []string
    (Optional)

    CrossNamespaceSourceReference

    (Appears on: TerraformSpec)

    CrossNamespaceSourceReference contains enough information to let you locate the typed Kubernetes resource object at cluster level.

    Field Description
    apiVersion
    string
    (Optional)

    API version of the referent.

    kind
    string

    Kind of the referent.

    name
    string

    Name of the referent.

    namespace
    string
    (Optional)

    Namespace of the referent, defaults to the namespace of the Kubernetes resource object that contains the reference.

    FileMapping

    (Appears on: TerraformSpec)

    Field Description
    secretRef
    github.com/fluxcd/pkg/apis/meta.SecretKeyReference

    Reference to a Secret that contains the file content

    location
    string

    Location can be either user’s home directory or the Terraform workspace

    path
    string

    Path of the file - relative to the “location”

    ForceUnlockEnum (string alias)

    (Appears on: TFStateSpec)

    HealthCheck

    (Appears on: TerraformSpec)

    HealthCheck contains configuration needed to perform a health check after terraform is applied.

    Field Description
    name
    string

    Name of the health check.

    type
    string

    Type of the health check, valid values are (‘tcp’, ‘http’). If tcp is specified, address is required. If http is specified, url is required.

    url
    string
    (Optional)

    URL to perform http health check on. Required when http type is specified. Go template can be used to reference values from the terraform output (e.g. https://example.org, {{.output_url}}).

    address
    string
    (Optional)

    Address to perform tcp health check on. Required when tcp type is specified. Go template can be used to reference values from the terraform output (e.g. 127.0.0.1:8080, {{.address}}:{{.port}}).

    timeout
    Kubernetes meta/v1.Duration
    (Optional)

    The timeout period at which the connection should timeout if unable to complete the request. When not specified, default 20s timeout is used.

    LockStatus

    (Appears on: TerraformStatus)

    LockStatus defines the observed state of a Terraform State Lock

    Field Description
    lastApplied
    string
    (Optional)
    pending
    string
    (Optional)

    Pending holds the identifier of the Lock Holder to be used with Force Unlock

    PlanStatus

    (Appears on: TerraformStatus)

    Field Description
    lastApplied
    string
    (Optional)
    pending
    string
    (Optional)
    isDestroyPlan
    bool
    (Optional)
    isDriftDetectionPlan
    bool
    (Optional)

    ReadInputsFromSecretSpec

    (Appears on: TerraformSpec)

    Field Description
    name
    string
    as
    string

    Remediation

    (Appears on: TerraformSpec)

    Field Description
    retries
    int64
    (Optional)

    Retries is the number of retries that should be attempted on failures before bailing. Defaults to ‘0’, a negative integer denotes unlimited retries.

    ResourceInventory

    (Appears on: TerraformStatus)

    ResourceInventory contains a list of Kubernetes resource object references that have been applied by a Kustomization.

    Field Description
    entries
    []ResourceRef

    Entries of Kubernetes resource object references.

    ResourceRef

    (Appears on: ResourceInventory)

    ResourceRef contains the information necessary to locate a resource within a cluster.

    Field Description
    n
    string

    Terraform resource’s name.

    t
    string

    Type is Terraform resource’s type

    id
    string

    ID is the resource identifier. This is cloud-specific. For example, ARN is an ID on AWS.

    RunnerPodMetadata

    (Appears on: RunnerPodTemplate)

    Field Description
    labels
    map[string]string
    (Optional)

    Labels to add to the runner pod

    annotations
    map[string]string
    (Optional)

    Annotations to add to the runner pod

    RunnerPodSpec

    (Appears on: RunnerPodTemplate)

    Field Description
    image
    string
    (Optional)

    Runner pod image to use other than default

    envFrom
    []Kubernetes core/v1.EnvFromSource
    (Optional)

    List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.

    env
    []Kubernetes core/v1.EnvVar
    (Optional)

    List of environment variables to set in the container. Cannot be updated.

    nodeSelector
    map[string]string
    (Optional)

    Set the NodeSelector for the Runner Pod

    affinity
    Kubernetes core/v1.Affinity
    (Optional)

    Set the Affinity for the Runner Pod

    tolerations
    []Kubernetes core/v1.Toleration
    (Optional)

    Set the Tolerations for the Runner Pod

    volumeMounts
    []Kubernetes core/v1.VolumeMount
    (Optional)

    Set Volume Mounts for the Runner Pod

    volumes
    []Kubernetes core/v1.Volume
    (Optional)

    Set Volumes for the Runner Pod

    initContainers
    []Kubernetes core/v1.Container
    (Optional)

    Set up Init Containers for the Runner

    hostAliases
    []Kubernetes core/v1.HostAlias
    (Optional)

    Set host aliases for the Runner Pod

    priorityClassName
    string
    (Optional)

    Set PriorityClassName for the Runner Pod container

    securityContext
    Kubernetes core/v1.SecurityContext
    (Optional)

    Set SecurityContext for the Runner Pod container

    resources
    Kubernetes core/v1.ResourceRequirements
    (Optional)

    Set Resources for the Runner Pod container

    RunnerPodTemplate

    (Appears on: TerraformSpec)

    Field Description
    metadata
    RunnerPodMetadata
    (Optional)
    spec
    RunnerPodSpec
    (Optional)

    image
    string
    (Optional)

    Runner pod image to use other than default

    envFrom
    []Kubernetes core/v1.EnvFromSource
    (Optional)

    List of sources to populate environment variables in the container. The keys defined within a source must be a C_IDENTIFIER. All invalid keys will be reported as an event when the container is starting. When a key exists in multiple sources, the value associated with the last source will take precedence. Values defined by an Env with a duplicate key will take precedence. Cannot be updated.

    env
    []Kubernetes core/v1.EnvVar
    (Optional)

    List of environment variables to set in the container. Cannot be updated.

    nodeSelector
    map[string]string
    (Optional)

    Set the NodeSelector for the Runner Pod

    affinity
    Kubernetes core/v1.Affinity
    (Optional)

    Set the Affinity for the Runner Pod

    tolerations
    []Kubernetes core/v1.Toleration
    (Optional)

    Set the Tolerations for the Runner Pod

    volumeMounts
    []Kubernetes core/v1.VolumeMount
    (Optional)

    Set Volume Mounts for the Runner Pod

    volumes
    []Kubernetes core/v1.Volume
    (Optional)

    Set Volumes for the Runner Pod

    initContainers
    []Kubernetes core/v1.Container
    (Optional)

    Set up Init Containers for the Runner

    hostAliases
    []Kubernetes core/v1.HostAlias
    (Optional)

    Set host aliases for the Runner Pod

    priorityClassName
    string
    (Optional)

    Set PriorityClassName for the Runner Pod container

    securityContext
    Kubernetes core/v1.SecurityContext
    (Optional)

    Set SecurityContext for the Runner Pod container

    resources
    Kubernetes core/v1.ResourceRequirements
    (Optional)

    Set Resources for the Runner Pod container

    TFStateSpec

    (Appears on: TerraformSpec)

    TFStateSpec allows the user to set ForceUnlock

    Field Description
    forceUnlock
    ForceUnlockEnum
    (Optional)

    ForceUnlock a Terraform state if it has become locked for any reason. Defaults to no.

    This is an Enum and has the expected values of:

    • auto
    • yes
    • no

    WARNING: Only use auto in the cases where you are absolutely certain that no other system is using this state, you could otherwise end up in a bad place See https://www.terraform.io/language/state/locking#force-unlock for more information on the terraform state lock and force unlock.

    lockIdentifier
    string
    (Optional)

    LockIdentifier holds the Identifier required by Terraform to unlock the state if it ever gets into a locked state.

    You’ll need to put the Lock Identifier in here while setting ForceUnlock to either yes or auto.

    Leave this empty to do nothing, set this to the value of the Lock Info: ID: [value], e.g. f2ab685b-f84d-ac0b-a125-378a22877e8d, to force unlock the state.

    lockTimeout
    Kubernetes meta/v1.Duration
    (Optional)

    LockTimeout is a Duration string that instructs Terraform to retry acquiring a lock for the specified period of time before returning an error. The duration syntax is a number followed by a time unit letter, such as 3s for three seconds.

    Defaults to 0s which will behave as though LockTimeout was not set

    Terraform

    Terraform is the Schema for the terraforms API

    Field Description
    metadata
    Kubernetes meta/v1.ObjectMeta
    Refer to the Kubernetes API documentation for the fields of the metadata field.
    spec
    TerraformSpec


    approvePlan
    string
    (Optional)

    ApprovePlan specifies name of a plan wanted to approve. If its value is “auto”, the controller will automatically approve every plan.

    destroy
    bool
    (Optional)

    Destroy produces a destroy plan. Applying the plan will destroy all resources.

    backendConfig
    BackendConfigSpec
    (Optional)
    backendConfigsFrom
    []BackendConfigsReference
    (Optional)
    cloud
    CloudSpec
    (Optional)
    workspace
    string
    (Optional)
    vars
    []Variable
    (Optional)

    List of input variables to set for the Terraform program.

    varsFrom
    []VarsReference
    (Optional)

    List of references to a Secret or a ConfigMap to generate variables for Terraform resources based on its data, selectively by varsKey. Values of the later Secret / ConfigMap with the same keys will override those of the former.

    values
    Kubernetes pkg/apis/apiextensions/v1.JSON
    (Optional)

    Values map to the Terraform variable “values”, which is an object of arbitrary values. It is a convenient way to pass values to Terraform resources without having to define a variable for each value. To use this feature, your Terraform file must define the variable “values”.

    tfVarsFiles
    []string
    (Optional)

    TfVarsFiles loads all given .tfvars files. It copycats the -var-file functionality.

    fileMappings
    []FileMapping
    (Optional)

    List of all configuration files to be created in initialization.

    interval
    Kubernetes meta/v1.Duration

    The interval at which to reconcile the Terraform.

    retryInterval
    Kubernetes meta/v1.Duration
    (Optional)

    The interval at which to retry a previously failed reconciliation. The default value is 15 when not specified.

    path
    string
    (Optional)

    Path to the directory containing Terraform (.tf) files. Defaults to ‘None’, which translates to the root path of the SourceRef.

    sourceRef
    CrossNamespaceSourceReference

    SourceRef is the reference of the source where the Terraform files are stored.

    suspend
    bool
    (Optional)

    Suspend is to tell the controller to suspend subsequent TF executions, it does not apply to already started executions. Defaults to false.

    force
    bool
    (Optional)

    Force instructs the controller to unconditionally re-plan and re-apply TF resources. Defaults to false.

    readInputsFromSecrets
    []ReadInputsFromSecretSpec
    (Optional)
    writeOutputsToSecret
    WriteOutputsToSecretSpec
    (Optional)

    A list of target secrets for the outputs to be written as.

    disableDriftDetection
    bool
    (Optional)

    Disable automatic drift detection. Drift detection may be resource intensive in the context of a large cluster or complex Terraform statefile. Defaults to false.

    cliConfigSecretRef
    Kubernetes core/v1.SecretReference
    (Optional)
    healthChecks
    []HealthCheck
    (Optional)

    List of health checks to be performed.

    destroyResourcesOnDeletion
    bool
    (Optional)

    Create destroy plan and apply it to destroy terraform resources upon deletion of this object. Defaults to false.

    serviceAccountName
    string
    (Optional)

    Name of a ServiceAccount for the runner Pod to provision Terraform resources. Default to tf-runner.

    alwaysCleanupRunnerPod
    bool
    (Optional)

    Clean the runner pod up after each reconciliation cycle

    runnerTerminationGracePeriodSeconds
    int64
    (Optional)

    Configure the termination grace period for the runner pod. Use this parameter to allow the Terraform process to gracefully shutdown. Consider increasing for large, complex or slow-moving Terraform managed resources.

    refreshBeforeApply
    bool
    (Optional)

    RefreshBeforeApply forces refreshing of the state before the apply step.

    runnerPodTemplate
    RunnerPodTemplate
    (Optional)
    enableInventory
    bool
    (Optional)

    EnableInventory enables the object to store resource entries as the inventory for external use.

    tfstate
    TFStateSpec
    (Optional)
    targets
    []string
    (Optional)

    Targets specify the resource, module or collection of resources to target.

    parallelism
    int32
    (Optional)

    Parallelism limits the number of concurrent operations of Terraform apply step. Zero (0) means using the default value.

    storeReadablePlan
    string
    (Optional)

    StoreReadablePlan enables storing the plan in a readable format.

    webhooks
    []Webhook
    (Optional)
    dependsOn
    []github.com/fluxcd/pkg/apis/meta.NamespacedObjectReference
    (Optional)
    enterprise
    Kubernetes pkg/apis/apiextensions/v1.JSON
    (Optional)

    Enterprise is the enterprise configuration placeholder.

    planOnly
    bool
    (Optional)

    PlanOnly specifies if the reconciliation should or should not stop at plan phase.

    breakTheGlass
    bool
    (Optional)

    BreakTheGlass specifies if the reconciliation should stop and allow interactive shell in case of emergency.

    branchPlanner
    BranchPlanner
    (Optional)

    BranchPlanner configuration.

    remediation
    Remediation
    (Optional)

    Remediation specifies what the controller should do when reconciliation fails. The default is to not perform any action.

    status
    TerraformStatus

    TerraformSpec

    (Appears on: Terraform)

    TerraformSpec defines the desired state of Terraform

    Field Description
    approvePlan
    string
    (Optional)

    ApprovePlan specifies name of a plan wanted to approve. If its value is “auto”, the controller will automatically approve every plan.

    destroy
    bool
    (Optional)

    Destroy produces a destroy plan. Applying the plan will destroy all resources.

    backendConfig
    BackendConfigSpec
    (Optional)
    backendConfigsFrom
    []BackendConfigsReference
    (Optional)
    cloud
    CloudSpec
    (Optional)
    workspace
    string
    (Optional)
    vars
    []Variable
    (Optional)

    List of input variables to set for the Terraform program.

    varsFrom
    []VarsReference
    (Optional)

    List of references to a Secret or a ConfigMap to generate variables for Terraform resources based on its data, selectively by varsKey. Values of the later Secret / ConfigMap with the same keys will override those of the former.

    values
    Kubernetes pkg/apis/apiextensions/v1.JSON
    (Optional)

    Values map to the Terraform variable “values”, which is an object of arbitrary values. It is a convenient way to pass values to Terraform resources without having to define a variable for each value. To use this feature, your Terraform file must define the variable “values”.

    tfVarsFiles
    []string
    (Optional)

    TfVarsFiles loads all given .tfvars files. It copycats the -var-file functionality.

    fileMappings
    []FileMapping
    (Optional)

    List of all configuration files to be created in initialization.

    interval
    Kubernetes meta/v1.Duration

    The interval at which to reconcile the Terraform.

    retryInterval
    Kubernetes meta/v1.Duration
    (Optional)

    The interval at which to retry a previously failed reconciliation. The default value is 15 when not specified.

    path
    string
    (Optional)

    Path to the directory containing Terraform (.tf) files. Defaults to ‘None’, which translates to the root path of the SourceRef.

    sourceRef
    CrossNamespaceSourceReference

    SourceRef is the reference of the source where the Terraform files are stored.

    suspend
    bool
    (Optional)

    Suspend is to tell the controller to suspend subsequent TF executions, it does not apply to already started executions. Defaults to false.

    force
    bool
    (Optional)

    Force instructs the controller to unconditionally re-plan and re-apply TF resources. Defaults to false.

    readInputsFromSecrets
    []ReadInputsFromSecretSpec
    (Optional)
    writeOutputsToSecret
    WriteOutputsToSecretSpec
    (Optional)

    A list of target secrets for the outputs to be written as.

    disableDriftDetection
    bool
    (Optional)

    Disable automatic drift detection. Drift detection may be resource intensive in the context of a large cluster or complex Terraform statefile. Defaults to false.

    cliConfigSecretRef
    Kubernetes core/v1.SecretReference
    (Optional)
    healthChecks
    []HealthCheck
    (Optional)

    List of health checks to be performed.

    destroyResourcesOnDeletion
    bool
    (Optional)

    Create destroy plan and apply it to destroy terraform resources upon deletion of this object. Defaults to false.

    serviceAccountName
    string
    (Optional)

    Name of a ServiceAccount for the runner Pod to provision Terraform resources. Default to tf-runner.

    alwaysCleanupRunnerPod
    bool
    (Optional)

    Clean the runner pod up after each reconciliation cycle

    runnerTerminationGracePeriodSeconds
    int64
    (Optional)

    Configure the termination grace period for the runner pod. Use this parameter to allow the Terraform process to gracefully shutdown. Consider increasing for large, complex or slow-moving Terraform managed resources.

    refreshBeforeApply
    bool
    (Optional)

    RefreshBeforeApply forces refreshing of the state before the apply step.

    runnerPodTemplate
    RunnerPodTemplate
    (Optional)
    enableInventory
    bool
    (Optional)

    EnableInventory enables the object to store resource entries as the inventory for external use.

    tfstate
    TFStateSpec
    (Optional)
    targets
    []string
    (Optional)

    Targets specify the resource, module or collection of resources to target.

    parallelism
    int32
    (Optional)

    Parallelism limits the number of concurrent operations of Terraform apply step. Zero (0) means using the default value.

    storeReadablePlan
    string
    (Optional)

    StoreReadablePlan enables storing the plan in a readable format.

    webhooks
    []Webhook
    (Optional)
    dependsOn
    []github.com/fluxcd/pkg/apis/meta.NamespacedObjectReference
    (Optional)
    enterprise
    Kubernetes pkg/apis/apiextensions/v1.JSON
    (Optional)

    Enterprise is the enterprise configuration placeholder.

    planOnly
    bool
    (Optional)

    PlanOnly specifies if the reconciliation should or should not stop at plan phase.

    breakTheGlass
    bool
    (Optional)

    BreakTheGlass specifies if the reconciliation should stop and allow interactive shell in case of emergency.

    branchPlanner
    BranchPlanner
    (Optional)

    BranchPlanner configuration.

    remediation
    Remediation
    (Optional)

    Remediation specifies what the controller should do when reconciliation fails. The default is to not perform any action.

    TerraformStatus

    (Appears on: Terraform)

    TerraformStatus defines the observed state of Terraform

    Field Description
    ReconcileRequestStatus
    github.com/fluxcd/pkg/apis/meta.ReconcileRequestStatus

    (Members of ReconcileRequestStatus are embedded into this type.)

    observedGeneration
    int64
    (Optional)

    ObservedGeneration is the last reconciled generation.

    conditions
    []Kubernetes meta/v1.Condition
    (Optional)
    lastAppliedRevision
    string
    (Optional)

    The last successfully applied revision. The revision format for Git sources is /.

    lastAttemptedRevision
    string
    (Optional)

    LastAttemptedRevision is the revision of the last reconciliation attempt.

    lastPlannedRevision
    string
    (Optional)

    LastPlannedRevision is the revision used by the last planning process. The result could be either no plan change or a new plan generated.

    lastPlanAt
    Kubernetes meta/v1.Time
    (Optional)

    LastPlanAt is the time when the last terraform plan was performed

    lastDriftDetectedAt
    Kubernetes meta/v1.Time
    (Optional)

    LastDriftDetectedAt is the time when the last drift was detected

    lastAppliedByDriftDetectionAt
    Kubernetes meta/v1.Time
    (Optional)

    LastAppliedByDriftDetectionAt is the time when the last drift was detected and terraform apply was performed as a result

    availableOutputs
    []string
    (Optional)
    plan
    PlanStatus
    (Optional)
    inventory
    ResourceInventory
    (Optional)

    Inventory contains the list of Terraform resource object references that have been successfully applied.

    lock
    LockStatus
    (Optional)
    reconciliationFailures
    int64
    (Optional)

    ReconciliationFailures is the number of reconciliation failures since the last success or update.

    Variable

    (Appears on: TerraformSpec)

    Field Description
    name
    string

    Name is the name of the variable

    value
    Kubernetes pkg/apis/apiextensions/v1.JSON
    (Optional)
    valueFrom
    Kubernetes core/v1.EnvVarSource
    (Optional)

    VarsReference

    (Appears on: TerraformSpec)

    VarsReference contain a reference of a Secret or a ConfigMap to generate variables for Terraform resources based on its data, selectively by varsKey.

    Field Description
    kind
    string

    Kind of the values referent, valid values are (‘Secret’, ‘ConfigMap’).

    name
    string

    Name of the values referent. Should reside in the same namespace as the referring resource.

    varsKeys
    []string
    (Optional)

    VarsKeys is the data key at which a specific value can be found. Defaults to all keys.

    optional
    bool
    (Optional)

    Optional marks this VarsReference as optional. When set, a not found error for the values reference is ignored, but any VarsKey or transient error will still result in a reconciliation failure.

    Webhook

    (Appears on: TerraformSpec)

    Field Description
    stage
    string
    enabled
    bool
    (Optional)
    url
    string
    payloadType
    string
    (Optional)
    errorMessageTemplate
    string
    (Optional)
    testExpression
    string

    WriteOutputsToSecretSpec

    (Appears on: TerraformSpec)

    WriteOutputsToSecretSpec defines where to store outputs, and which outputs to be stored.

    Field Description
    name
    string

    Name is the name of the Secret to be written

    labels
    map[string]string
    (Optional)

    Labels to add to the outputted secret

    annotations
    map[string]string
    (Optional)

    Annotations to add to the outputted secret

    outputs
    []string
    (Optional)

    Outputs contain the selected names of outputs to be written to the secret. Empty array means writing all outputs, which is default.

    This page was automatically generated with gen-crd-api-reference-docs