state¶
This provider is a derived work of the Terraform Provider distributed under MPL 2.0. If you encounter a bug or missing feature, first check the pulumi/pulumi-terraform repo; however, if that doesn’t turn up anything, please consult the source terraform-providers/terraform-provider-terraform repo.
- class
pulumi_terraform.state.ArtifactoryBackendArgs(repo: Union[str, Awaitable[str], Output[T]], subpath: Union[str, Awaitable[str], Output[T]], url: Union[str, Awaitable[str], Output[T]] = None, username: Union[str, Awaitable[str], Output[T]] = None, password: Union[str, Awaitable[str], Output[T]] = None, workspace: Union[str, Awaitable[str], Output[T]] = None)¶ The configuration options for a Terraform Remote State stored in the Artifactory backend.
Constructs an ArtifactoryBackendArgs.
- Parameters
repo – The username with which to authenticate to Artifactory. Sourced from
ARTIFACTORY_USERNAMEin the environment, if unsetsubpath – Path within the repository.
url – The Artifactory URL. Note that this is the base URL to artifactory, not the full repo and subpath.
However, it must include the path to the artifactory installation - likely this will end in
/artifactory. Sourced fromARTIFACTORY_URLin the environment, if unset. :param username: The username with which to authenticate to Artifactory. Sourced fromARTIFACTORY_USERNAMEin the environment, if unset. :param password: The password with which to authenticate to Artifactory. Sourced fromARTIFACTORY_PASSWORDin the environment, if unset. :param workspace: The Terraform workspace from which to read state.
- class
pulumi_terraform.state.AzureRMBackendArgs(storage_account_name: Union[str, Awaitable[str], Output[T]], container_name: Union[str, Awaitable[str], Output[T]], key: Union[str, Awaitable[str], Output[T]] = None, environment: Union[str, Awaitable[str], Output[T]] = None, endpoint: Union[str, Awaitable[str], Output[T]] = None, use_msi: Union[bool, Awaitable[bool], Output[T]] = None, subscription_id: Union[str, Awaitable[str], Output[T]] = None, tenant_id: Union[str, Awaitable[str], Output[T]] = None, msi_endpoint: Union[str, Awaitable[str], Output[T]] = None, sas_token: Union[str, Awaitable[str], Output[T]] = None, access_key: Union[str, Awaitable[str], Output[T]] = None, resource_group_name: Union[str, Awaitable[str], Output[T]] = None, client_id: Union[str, Awaitable[str], Output[T]] = None, client_secret: Union[str, Awaitable[str], Output[T]] = None, workspace: Union[str, Awaitable[str], Output[T]] = None)¶ The configuration options for a Terraform Remote State stored in the AzureRM backend.
Constructs an AzureRMBackendArgs
- param storage_account_name
The name of the storage account.
- param container_name
The name of the storage container within the storage account.
- param key
The name of the blob in representing the Terraform State file inside the storage container.
- param environment
The Azure environment which should be used. Possible values are
public(default),china,
german,stackandusgovernment. Sourced fromARM_ENVIRONMENT, if unset.- param endpoint
The custom endpoint for Azure Resource Manager. Sourced from
ARM_ENDPOINT, if unset.- param use_msi
Whether to authenticate using Managed Service Identity (MSI). Sourced from
ARM_USE_MSIif
unset. Defaults to false if no value is specified. :param subscription_id: The Subscription ID in which the Storage Account exists. Used when authenticating using the Managed Service Identity (MSI) or a service principal. Sourced from
ARM_SUBSCRIPTION_ID, if unset. :param tenant_id: The Tenant ID in which the Subscription exists. Used when authenticating using the Managed Service Identity (MSI) or a service principal. Sourced fromARM_TENANT_ID, if unset. :param msi_endpoint: The path to a custom Managed Service Identity endpoint. Used when authenticating using the Managed Service Identity (MSI). Sourced fromARM_MSI_ENDPOINTin the environment, if unset. Automatically determined, if no value is provided. :param sas_token: The SAS Token used to access the Blob Storage Account. Used when authenticating using a SAS Token. Sourced fromARM_SAS_TOKENin the environment, if unset. :param access_key: The Access Key used to access the blob storage account. Used when authenticating using an access key. Sourced fromARM_ACCESS_KEYin the environment, if unset. :param resource_group_name: The name of the resource group in which the storage account exists. Used when authenticating using a service principal. :param client_id: The client ID of the service principal. Used when authenticating using a service principal. Sourced fromARM_CLIENT_IDin the environment, if unset. :param client_secret: The client secret of the service principal. Used when authenticating using a service principal. Sourced fromARM_CLIENT_SECRETin the environment, if unset. :param workspace: The Terraform workspace from which to read state.
- class
pulumi_terraform.state.ConsulBackendArgs(path: Union[str, Awaitable[str], Output[T]], access_token: Union[str, Awaitable[str], Output[T]], address: Union[str, Awaitable[str], Output[T]] = None, scheme: Union[str, Awaitable[str], Output[T]] = None, datacenter: Union[str, Awaitable[str], Output[T]] = None, http_auth: Union[str, Awaitable[str], Output[T]] = None, gzip: Union[bool, Awaitable[bool], Output[T]] = None, ca_file: Union[str, Awaitable[str], Output[T]] = None, cert_file: Union[str, Awaitable[str], Output[T]] = None, key_file: Union[str, Awaitable[str], Output[T]] = None, workspace: Union[str, Awaitable[str], Output[T]] = None)¶ The configuration options for a Terraform Remote State stored in the Consul backend.
Constructs a ConsulBackendArgs.
- Parameters
path – Path in the Consul KV store.
access_token – Consul Access Token. Sourced from
CONSUL_HTTP_TOKENin the environment, if unset.address – DNS name and port of the Consul HTTP endpoint specified in the format
dnsname:port. Defaults
to the local agent HTTP listener. :param scheme: Specifies which protocol to use when talking to the given address - either
httporhttps. TLS support can also be enabled by setting the environment variableCONSUL_HTTP_SSLtotrue. :param datacenter: The datacenter to use. Defaults to that of the agent. :param http_auth: HTTP Basic Authentication credentials to be used when communicating with Consul, in the format of eitheruseroruser:pass. Sourced fromCONSUL_HTTP_AUTH, if unset. :param gzip: Whether to compress the state data using gzip. Set totrueto compress the state data using gzip, orfalse(default) to leave it uncompressed. :param ca_file: A path to a PEM-encoded certificate authority used to verify the remote agent’s certificate. Sourced fromCONSUL_CAFILEin the environment, if unset. :param cert_file: A path to a PEM-encoded certificate provided to the remote agent; requires use of key_file. Sourced fromCONSUL_CLIENT_CERTin the environment, if unset. :param key_file: A path to a PEM-encoded private key, required if cert_file is specified. Sourced fromCONSUL_CLIENT_KEYin the environment, if unset. :param workspace: The Terraform workspace from which to read state.
- class
pulumi_terraform.state.EtcdV2BackendArgs(path: Union[str, Awaitable[str], Output[T]], endpoints: Union[str, Awaitable[str], Output[T]], username: Union[str, Awaitable[str], Output[T]] = None, password: Union[str, Awaitable[str], Output[T]] = None, workspace: Union[str, Awaitable[str], Output[T]] = None)¶ The configuration options for a Terraform Remote State stored in the etcd v2 backend. Note that there is a separate configuration class for state stored in the ectd v3 backend.
Constructs an EtcdV2BackendArgs.
- Parameters
path – The path at which to store the state.
endpoints – A space-separated list of the etcd endpoints.
username – The username with which to authenticate to etcd.
password – The username with which to authenticate to etcd.
workspace – The Terraform workspace from which to read state.
- class
pulumi_terraform.state.EtcdV3BackendArgs(endpoints: Union[Sequence[Union[str, Awaitable[str], Output[T]]], Awaitable[Sequence[Union[str, Awaitable[str], Output[T]]]], Output[T]], username: Union[str, Awaitable[str], Output[T]] = None, password: Union[str, Awaitable[str], Output[T]] = None, prefix: Union[str, Awaitable[str], Output[T]] = None, cacert_path: Union[str, Awaitable[str], Output[T]] = None, cert_path: Union[str, Awaitable[str], Output[T]] = None, key_path: Union[str, Awaitable[str], Output[T]] = None, workspace: Union[str, Awaitable[str], Output[T]] = None)¶ The configuration options for a Terraform Remote State stored in the etcd v3 backend. Note that there is a separate configuration class for state stored in the ectd v2 backend.
Constructs an EtcdV3BackendArgs.
- Parameters
endpoints – A list of the etcd endpoints.
username – The username with which to authenticate to etcd. Sourced from
ETCDV3_USERNAMEin the
environment, if unset. :param password: The username with which to authenticate to etcd. Sourced from
ETCDV3_PASSWORDin the environment, if unset. :param prefix: An optional prefix to be added to keys when storing state in etcd. :param cacert_path: Path to a PEM-encoded certificate authority bundle with which to verify certificates of TLS-enabled etcd servers. :param cert_path: Path to a PEM-encoded certificate to provide to etcd for client authentication. :param key_path: Path to a PEM-encoded key to use for client authentication. :param workspace: The Terraform workspace from which to read state.
- class
pulumi_terraform.state.GcsBackendArgs(bucket: Union[str, Awaitable[str], Output[T]], credentials: Union[str, Awaitable[str], Output[T]] = None, prefix: Union[str, Awaitable[str], Output[T]] = None, encryption_key: Union[str, Awaitable[str], Output[T]] = None, workspace: Union[str, Awaitable[str], Output[T]] = None)¶ The configuration options for a Terraform Remote State stored in the Google Cloud Storage backend.
Constructs a GcsBackendArgs.
- Parameters
bucket – The name of the Google Cloud Storage bucket.
credentials – Local path to Google Cloud Platform account credentials in JSON format. Sourced from
GOOGLE_CREDENTIALSin the environment if unset. If no value is provided Google Application Default Credentials are used. :param prefix: Prefix used inside the Google Cloud Storage bucket. Named states for workspaces are stored in an object named<prefix>/<name>.tfstate. :param encryption_key: A 32 byte, base64-encoded customer supplied encryption key used to encrypt the state. Sourced fromGOOGLE_ENCRYPTION_KEYin the environment, if unset. :param workspace: The Terraform workspace from which to read state.
- class
pulumi_terraform.state.HttpBackendArgs(address: Union[str, Awaitable[str], Output[T]], update_method: Union[str, Awaitable[str], Output[T]] = None, lock_address: Union[str, Awaitable[str], Output[T]] = None, lock_method: Union[str, Awaitable[str], Output[T]] = None, unlock_address: Union[str, Awaitable[str], Output[T]] = None, unlock_method: Union[str, Awaitable[str], Output[T]] = None, username: Union[str, Awaitable[str], Output[T]] = None, password: Union[str, Awaitable[str], Output[T]] = None, skip_cert_validation: Union[bool, Awaitable[bool], Output[T]] = None, workspace: Union[str, Awaitable[str], Output[T]] = None)¶ The configuration options for a Terraform Remote State stored in the HTTP backend.
Constructs an HttpBackendArgs.
- Parameters
address – The address of the HTTP endpoint.
update_method – HTTP method to use when updating state. Defaults to
POST.lock_address – The address of the lock REST endpoint. Not setting a value disables locking.
lock_method – The HTTP method to use when locking. Defaults to
LOCK.unlock_address – The address of the unlock REST endpoint. Not setting a value disables locking.
unlock_method – The HTTP method to use when unlocking. Defaults to
UNLOCK.username – The username used for HTTP basic authentication.
password – The password used for HTTP basic authentication.
skip_cert_validation – Whether to skip TLS verification. Defaults to false.
workspace – The Terraform workspace from which to read state.
- class
pulumi_terraform.state.LocalBackendArgs(path: Union[str, Awaitable[str], Output[T]])¶ The configuration options for a Terraform Remote State stored in the local enhanced backend.
Constructs a LocalBackendArgs.
- Parameters
path – The path to the Terraform state file.
- class
pulumi_terraform.state.MantaBackendArgs(account: Union[str, Awaitable[str], Output[T]], user: Union[str, Awaitable[str], Output[T]] = None, url: Union[str, Awaitable[str], Output[T]] = None, key_material: Union[str, Awaitable[str], Output[T]] = None, key_id: Union[str, Awaitable[str], Output[T]] = None, path: Union[str, Awaitable[str], Output[T]] = None, insecure_skip_tls_verify: Union[bool, Awaitable[bool], Output[T]] = None, workspace: Union[str, Awaitable[str], Output[T]] = None)¶ The configuration options for a Terraform Remote State stored in the Manta backend.
Constructs a MantaBackendArgs.
- Parameters
account – The name of the Manta account. Sourced from
SDC_ACCOUNTor_ACCOUNTin the environment, if
unset. :param user: The username of the Manta account with which to authenticate. :param url: The Manta API Endpoint. Sourced from
MANTA_URLin the environment, if unset. Defaults tohttps://us-east.manta.joyent.com. :param key_material: The private key material corresponding with the SSH key whose fingerprint is specified in keyId. Sourced fromSDC_KEY_MATERIALorTRITON_KEY_MATERIALin the environment, if unset. If no value is specified, the local SSH agent is used for signing requests. :param key_id: The fingerprint of the public key matching the key material specified in keyMaterial, or in the local SSH agent. :param path: The path relative to your private storage directory (/$MANTA_USER/stor) where the state file will be stored. :param insecure_skip_tls_verify: Skip verifying the TLS certificate presented by the Manta endpoint. This can beuseful for installations which do not have a certificate signed by a trusted root CA. Defaults to false.
- Parameters
workspace – The Terraform workspace from which to read state.
- class
pulumi_terraform.state.PostgresBackendArgs(conn_str: Union[str, Awaitable[str], Output[T]], schema_name: Union[str, Awaitable[str], Output[T]] = None, workspace: Union[str, Awaitable[str], Output[T]] = None)¶ The configuration options for a Terraform Remote State stored in the Postgres backend.
Constructs a PostgresBackendArgs.
- Parameters
conn_str – Postgres connection string; a
postgres://URL.schema_name – Name of the automatically-managed Postgres schema. Defaults to
terraform_remote_state.workspace – The Terraform workspace from which to read state.
- class
pulumi_terraform.state.RemoteBackendArgs(organization: Union[str, Awaitable[str], Output[T]], token: Union[str, Awaitable[str], Output[T]] = None, hostname: Union[str, Awaitable[str], Output[T]] = None, workspace_name: Union[str, Awaitable[str], Output[T]] = None, workspace_prefix: Union[str, Awaitable[str], Output[T]] = None)¶ Configuration options for a workspace for use with the remote enhanced backend.
Constructs a RemoteBackendArgs.
- Parameters
organization – The name of the organization containing the targeted workspace(s).
token – The token used to authenticate with the remote backend.
hostname – The remote backend hostname to which to connect. Defaults to
app.terraform.io.workspace_name – The full name of one remote workspace. When configured, only the default workspace can
be used. This option conflicts with workspace_prefix. :param workspace_prefix: A prefix used in the names of one or more remote workspaces, all of which can be used with this configuration. If unset, only the default workspace can be used. This option conflicts with workspace_name.
- class
pulumi_terraform.state.RemoteStateReference(resource_name: str, backend_type: str, args: Union[pulumi_terraform.state.remote_state_reference.ArtifactoryBackendArgs, pulumi_terraform.state.remote_state_reference.AzureRMBackendArgs, pulumi_terraform.state.remote_state_reference.ConsulBackendArgs, pulumi_terraform.state.remote_state_reference.EtcdV2BackendArgs, pulumi_terraform.state.remote_state_reference.EtcdV3BackendArgs, pulumi_terraform.state.remote_state_reference.GcsBackendArgs, pulumi_terraform.state.remote_state_reference.HttpBackendArgs, pulumi_terraform.state.remote_state_reference.LocalBackendArgs, pulumi_terraform.state.remote_state_reference.MantaBackendArgs, pulumi_terraform.state.remote_state_reference.PostgresBackendArgs, pulumi_terraform.state.remote_state_reference.RemoteBackendArgs, pulumi_terraform.state.remote_state_reference.S3BackendArgs, pulumi_terraform.state.remote_state_reference.SwiftBackendArgs], opts: pulumi.resource.ResourceOptions = None)¶ Manages a reference to a Terraform Remote State. The root outputs of the remote state are available via the
outputsproperty or thegetOutputmethod.Create a RemoteStateReference resource with the given unique name, props, and options.
- Parameters
resource_name (str) – The name of the resource.
opts (pulumi.ResourceOptions) – Options for the resource.
backend_type (str) – The name of the Remote State Backend
args (BackendArgs) – The arguments for the Remote State backend, which must match the given backend_type.
outputs: pulumi.Output[Mapping[str, Any]] = None¶The root outputs of the referenced Terraform state.
get_output(name: Union[str, Awaitable[str], Output[T]])¶Fetches the value of a root output from the Terraform Remote State.
- Parameters
name – The name of the output to fetch. The name is formatted exactly as per the “output” block in the
Terraform configuration. :return: A pulumi.Output representing the value.
translate_output_property(prop)¶Provides subclasses of Resource an opportunity to translate names of output properties into a format of their choosing before writing those properties to the resource object.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
translate_input_property(prop)¶Provides subclasses of Resource an opportunity to translate names of input properties into a format of their choosing before sending those properties to the Pulumi engine.
- Parameters
prop (str) – A property name.
- Returns
A potentially transformed property name.
- Return type
str
- class
pulumi_terraform.state.S3BackendArgs(bucket: Union[str, Awaitable[str], Output[T]], key: Union[str, Awaitable[str], Output[T]], region: Union[str, Awaitable[str], Output[T]] = None, endpoint: Union[str, Awaitable[str], Output[T]] = None, access_key: Union[str, Awaitable[str], Output[T]] = None, secret_key: Union[str, Awaitable[str], Output[T]] = None, profile: Union[str, Awaitable[str], Output[T]] = None, shared_credentials_file: Union[str, Awaitable[str], Output[T]] = None, token: Union[str, Awaitable[str], Output[T]] = None, role_arn: Union[str, Awaitable[str], Output[T]] = None, external_id: Union[str, Awaitable[str], Output[T]] = None, session_name: Union[str, Awaitable[str], Output[T]] = None, workspace_key_prefix: Union[str, Awaitable[str], Output[T]] = None, iam_endpoint: Union[str, Awaitable[str], Output[T]] = None, sts_endpoint: Union[str, Awaitable[str], Output[T]] = None, workspace: Union[str, Awaitable[str], Output[T]] = None)¶ The configuration options for a Terraform Remote State stored in the S3 backend.
Constructs an S3BackendArgs.
- Parameters
bucket – The name of the S3 bucket.
key – The path to the state file inside the bucket. When using a non-default workspace, the state path
will be
/workspace_key_prefix/workspace_name/key. :param region: The region of the S3 bucket. Also sourced fromAWS_DEFAULT_REGIONin the environment, if unset. :param endpoint: A custom endpoint for the S3 API. Also sourced fromAWS_S3_ENDPOINTin the environment, if unset. :param access_key: AWS Access Key. Sourced from the standard credentials pipeline, if unset. :param secret_key: AWS Secret Access Key. Sourced from the standard credentials pipeline, if unset. :param profile: The AWS profile name as set in the shared credentials file. :param shared_credentials_file: The path to the shared credentials file. If this is not set and a profile is specified,~/.aws/credentialswill be used by default. :param token: An MFA token. Sourced fromAWS_SESSION_TOKENin the environment if needed and unset. :param role_arn: The ARN of an IAM Role to be assumed in order to read the state from S3. :param external_id: The external ID to use when assuming the IAM role. :param session_name: The session name to use when assuming the IAM role. :param workspace_key_prefix: The prefix applied to the state path inside the bucket. This is only relevant when using a non-default workspace, and defaults toenv:. :param iam_endpoint: A custom endpoint for the IAM API. Sourced fromAWS_IAM_ENDPOINT, if unset. :param sts_endpoint: A custom endpoint for the STS API. Sourced fromAWS_STS_ENDPOINT, if unset. :param workspace: The Terraform workspace from which to read state.
- class
pulumi_terraform.state.SwiftBackendArgs(auth_url: Union[str, Awaitable[str], Output[T]], container: Union[str, Awaitable[str], Output[T]], username: Union[str, Awaitable[str], Output[T]] = None, user_id: Union[str, Awaitable[str], Output[T]] = None, password: Union[str, Awaitable[str], Output[T]] = None, token: Union[str, Awaitable[str], Output[T]] = None, region_name: Union[str, Awaitable[str], Output[T]] = None, tenant_id: Union[str, Awaitable[str], Output[T]] = None, tenant_name: Union[str, Awaitable[str], Output[T]] = None, domain_id: Union[str, Awaitable[str], Output[T]] = None, domain_name: Union[str, Awaitable[str], Output[T]] = None, insecure: Union[bool, Awaitable[bool], Output[T]] = None, cacert_file: Union[str, Awaitable[str], Output[T]] = None, cert: Union[str, Awaitable[str], Output[T]] = None, key: Union[str, Awaitable[str], Output[T]] = None)¶ The configuration options for a Terraform Remote State stored in the Swift backend.
Constructs a SwiftBackendArgs.
- Parameters
auth_url – The Identity authentication URL. Sourced from
OS_AUTH_URLin the environment, if unset.container – The name of the container in which the Terraform state file is stored.
username – The username with which to log in. Sourced from
OS_USERNAMEin the environment, if unset.user_id – The user ID with which to log in. Sourced from
OS_USER_IDin the environment, if unset.password – The password with which to log in. Sourced from
OS_PASSWORDin the environment, if unset.token – Access token with which to log in in stead of a username and password. Sourced from
OS_AUTH_TOKENin the environment, if unset. :param region_name: The region in which the state file is stored. Sourced fromOS_REGION_NAME, if unset. :param tenant_id: The ID of the tenant (for identity v2) or project (identity v3) which which to log in. Sourced fromOS_TENANT_IDorOS_PROJECT_IDin the environment, if unset. :param tenant_name: The name of the tenant (for identity v2) or project (identity v3) which which to log in. Sourced fromOS_TENANT_NAMEorOS_PROJECT_NAMEin the environment, if unset. :param domain_id: The ID of the domain to scope the log in to (identity v3). Sourced fromOS_USER_DOMAIN_ID,OS_PROJECT_DOMAIN_IDorOS_DOMAIN_IDin the environment, if unset. :param domain_name: The name of the domain to scope the log in to (identity v3). Sourced fromOS_USER_DOMAIN_NAME,OS_PROJECT_DOMAIN_NAMEorOS_DOMAIN_NAMEin the environment, if unset. :param insecure: Whether to disable verification of the server TLS certificate. Sourced fromOS_INSECUREin the environment, if unset. :param cacert_file: A path to a CA root certificate for verifying the server TLS certificate. Sourced fromOS_CACERTin the environment, if unset. :param cert: A path to a client certificate for TLS client authentication. Sourced fromOS_CERTin the environment, if unset. :param key: A path to the private key corresponding to the client certificate for TLS client authentication. Sourced fromOS_KEYin the environment, if unset.