Terraform
Java: Constructs
App
Represents a cdktf application.
Initializers
import com.hashicorp.cdktf.App;
App.Builder.create()
// .context(java.util.Map< java.lang.String, java.lang.Object >)
// .hclOutput(java.lang.Boolean)
// .outdir(java.lang.String)
// .skipBackendValidation(java.lang.Boolean)
// .skipValidation(java.lang.Boolean)
// .stackTraces(java.lang.Boolean)
.build();
Name | Type | Description |
---|---|---|
context | java.util.Map< java.lang.String, java.lang.Object > | Additional context values for the application. |
hclOutput | java.lang.Boolean | No description. |
outdir | java.lang.String | The directory to output Terraform resources. |
skipBackendValidation | java.lang.Boolean | Whether to skip backend validation during synthesis of the app. |
skipValidation | java.lang.Boolean | Whether to skip all validations during synthesis of the app. |
stackTraces | java.lang.Boolean | No description. |
context
Optional
- Type: java.util.Map< java.lang.String, java.lang.Object >
- Default: no additional context
Additional context values for the application.
Context set by the CLI or the context
key in cdktf.json
has precedence.
Context can be read from any construct using node.getContext(key)
.
hclOutput
Optional
- Type: java.lang.Boolean
outdir
Optional
- Type: java.lang.String
- Default: CDKTF_OUTDIR if defined, otherwise "cdktf.out"
The directory to output Terraform resources.
If you are using the CDKTF CLI, this value is automatically set from one of the following three sources:
- The
-o
/--output
CLI option - The
CDKTF_OUTDIR
environment variable - The
outdir
key incdktf.json
If you are using the CDKTF CLI and want to set a different value here, you will also need to set the same value via one of the three ways specified above.
The most common case to set this value is when you are using the CDKTF library directly (e.g. when writing unit tests).
skipBackendValidation
Optional
- Type: java.lang.Boolean
- Default: false
Whether to skip backend validation during synthesis of the app.
skipValidation
Optional
- Type: java.lang.Boolean
- Default: false
Whether to skip all validations during synthesis of the app.
stackTraces
Optional
- Type: java.lang.Boolean
Methods
Name | Description |
---|---|
toString | Returns a string representation of this construct. |
crossStackReference | Creates a reference from one stack to another, invoked on prepareStack since it creates extra resources. |
synth | Synthesizes all resources to the output directory. |
toString
public java.lang.String toString()
Returns a string representation of this construct.
crossStackReference
public java.lang.String crossStackReference(TerraformStack fromStack, TerraformStack toStack, java.lang.String identifier)
Creates a reference from one stack to another, invoked on prepareStack since it creates extra resources.
fromStack
Required
- Type: TerraformStack
toStack
Required
- Type: TerraformStack
identifier
Required
- Type: java.lang.String
synth
public void synth()
Synthesizes all resources to the output directory.
Static Functions
Name | Description |
---|---|
isConstruct | Checks if x is a construct. |
isApp | No description. |
of | No description. |
isConstruct
import com.hashicorp.cdktf.App;
App.isConstruct(java.lang.Object x)
Checks if x
is a construct.
Use this method instead of instanceof
to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs
library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct
in each copy of the constructs
library
is seen as a different class, and an instance of one class will not test as
instanceof
the other class. npm install
will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof
will behave
unpredictably. It is safest to avoid using instanceof
, and using
this type-testing method instead.
x
Required
- Type: java.lang.Object
Any object.
isApp
import com.hashicorp.cdktf.App;
App.isApp(java.lang.Object x)
x
Required
- Type: java.lang.Object
of
import com.hashicorp.cdktf.App;
App.of(IConstruct construct)
construct
Required
- Type: software.constructs.IConstruct
Properties
Name | Type | Description |
---|---|---|
node | software.constructs.Node | The tree node. |
hclOutput | java.lang.Boolean | No description. |
manifest | Manifest | No description. |
outdir | java.lang.String | The output directory into which resources will be synthesized. |
skipBackendValidation | java.lang.Boolean | Whether to skip backend validation during synthesis of the app. |
skipValidation | java.lang.Boolean | Whether to skip all validations during synthesis of the app. |
targetStackId | java.lang.String | The stack which will be synthesized. |
node
Required
public Node getNode();
- Type: software.constructs.Node
The tree node.
hclOutput
Required
public java.lang.Boolean getHclOutput();
- Type: java.lang.Boolean
manifest
Required
public Manifest getManifest();
- Type: Manifest
outdir
Required
public java.lang.String getOutdir();
- Type: java.lang.String
The output directory into which resources will be synthesized.
skipBackendValidation
Required
public java.lang.Boolean getSkipBackendValidation();
- Type: java.lang.Boolean
Whether to skip backend validation during synthesis of the app.
skipValidation
Required
public java.lang.Boolean getSkipValidation();
- Type: java.lang.Boolean
Whether to skip all validations during synthesis of the app.
targetStackId
Optional
public java.lang.String getTargetStackId();
- Type: java.lang.String
The stack which will be synthesized.
If not set, all stacks will be synthesized.
AzurermBackend
Initializers
import com.hashicorp.cdktf.AzurermBackend;
AzurermBackend.Builder.create(Construct scope)
.containerName(java.lang.String)
.key(java.lang.String)
.storageAccountName(java.lang.String)
// .accessKey(java.lang.String)
// .clientCertificatePassword(java.lang.String)
// .clientCertificatePath(java.lang.String)
// .clientId(java.lang.String)
// .clientSecret(java.lang.String)
// .endpoint(java.lang.String)
// .environment(java.lang.String)
// .metadataHost(java.lang.String)
// .msiEndpoint(java.lang.String)
// .oidcRequestToken(java.lang.String)
// .oidcRequestUrl(java.lang.String)
// .oidcToken(java.lang.String)
// .oidcTokenFilePath(java.lang.String)
// .resourceGroupName(java.lang.String)
// .sasToken(java.lang.String)
// .snapshot(java.lang.Boolean)
// .subscriptionId(java.lang.String)
// .tenantId(java.lang.String)
// .useAzureadAuth(java.lang.Boolean)
// .useMicrosoftGraph(java.lang.Boolean)
// .useMsi(java.lang.Boolean)
// .useOidc(java.lang.Boolean)
.build();
Name | Type | Description |
---|---|---|
scope | software.constructs.Construct | No description. |
containerName | java.lang.String | (Required) The Name of the Storage Container within the Storage Account. |
key | java.lang.String | (Required) The name of the Blob used to retrieve/store Terraform's State file inside the Storage Container. |
storageAccountName | java.lang.String | (Required) The Name of the Storage Account. |
accessKey | java.lang.String | access_key - (Optional) The Access Key used to access the Blob Storage Account. |
clientCertificatePassword | java.lang.String | (Optional) The password associated with the Client Certificate specified in client_certificate_path. |
clientCertificatePath | java.lang.String | (Optional) The path to the PFX file used as the Client Certificate when authenticating as a Service Principal. |
clientId | java.lang.String | (Optional) The Client ID of the Service Principal. |
clientSecret | java.lang.String | (Optional) The Client Secret of the Service Principal. |
endpoint | java.lang.String | (Optional) The Custom Endpoint for Azure Resource Manager. This can also be sourced from the ARM_ENDPOINT environment variable. |
environment | java.lang.String | (Optional) The Azure Environment which should be used. |
metadataHost | java.lang.String | (Optional) The Hostname of the Azure Metadata Service (for example management.azure.com), used to obtain the Cloud Environment when using a Custom Azure Environment. This can also be sourced from the ARM_METADATA_HOSTNAME Environment Variable.). |
msiEndpoint | java.lang.String | (Optional) The path to a custom Managed Service Identity endpoint which is automatically determined if not specified. |
oidcRequestToken | java.lang.String | (Optional) The bearer token for the request to the OIDC provider. |
oidcRequestUrl | java.lang.String | (Optional) The URL for the OIDC provider from which to request an ID token. |
oidcToken | java.lang.String | (Optional) The ID token when authenticating using OpenID Connect (OIDC). |
oidcTokenFilePath | java.lang.String | (Optional) The path to a file containing an ID token when authenticating using OpenID Connect (OIDC). |
resourceGroupName | java.lang.String | (Required) The Name of the Resource Group in which the Storage Account exists. |
sasToken | java.lang.String | (Optional) The SAS Token used to access the Blob Storage Account. |
snapshot | java.lang.Boolean | (Optional) Should the Blob used to store the Terraform Statefile be snapshotted before use? |
subscriptionId | java.lang.String | (Optional) The Subscription ID in which the Storage Account exists. |
tenantId | java.lang.String | (Optional) The Tenant ID in which the Subscription exists. |
useAzureadAuth | java.lang.Boolean | (Optional) Should AzureAD Authentication be used to access the Blob Storage Account. |
useMicrosoftGraph | java.lang.Boolean | (Optional) Should MSAL be used for authentication instead of ADAL, and should Microsoft Graph be used instead of Azure Active Directory Graph? |
useMsi | java.lang.Boolean | (Optional) Should Managed Service Identity authentication be used? |
useOidc | java.lang.Boolean | (Optional) Should OIDC authentication be used? This can also be sourced from the ARM_USE_OIDC environment variable. |
scope
Required
- Type: software.constructs.Construct
containerName
Required
- Type: java.lang.String
(Required) The Name of the Storage Container within the Storage Account.
key
Required
- Type: java.lang.String
(Required) The name of the Blob used to retrieve/store Terraform's State file inside the Storage Container.
storageAccountName
Required
- Type: java.lang.String
(Required) The Name of the Storage Account.
accessKey
Optional
- Type: java.lang.String
access_key - (Optional) The Access Key used to access the Blob Storage Account.
This can also be sourced from the ARM_ACCESS_KEY environment variable.
clientCertificatePassword
Optional
- Type: java.lang.String
(Optional) The password associated with the Client Certificate specified in client_certificate_path.
This can also be sourced from the ARM_CLIENT_CERTIFICATE_PASSWORD environment variable.
clientCertificatePath
Optional
- Type: java.lang.String
(Optional) The path to the PFX file used as the Client Certificate when authenticating as a Service Principal.
This can also be sourced from the ARM_CLIENT_CERTIFICATE_PATH environment variable.
clientId
Optional
- Type: java.lang.String
(Optional) The Client ID of the Service Principal.
This can also be sourced from the ARM_CLIENT_ID environment variable.
clientSecret
Optional
- Type: java.lang.String
(Optional) The Client Secret of the Service Principal.
This can also be sourced from the ARM_CLIENT_SECRET environment variable.
endpoint
Optional
- Type: java.lang.String
(Optional) The Custom Endpoint for Azure Resource Manager. This can also be sourced from the ARM_ENDPOINT environment variable.
NOTE: An endpoint should only be configured when using Azure Stack.
environment
Optional
- Type: java.lang.String
(Optional) The Azure Environment which should be used.
This can also be sourced from the ARM_ENVIRONMENT environment variable. Possible values are public, china, german, stack and usgovernment. Defaults to public.
metadataHost
Optional
- Type: java.lang.String
(Optional) The Hostname of the Azure Metadata Service (for example management.azure.com), used to obtain the Cloud Environment when using a Custom Azure Environment. This can also be sourced from the ARM_METADATA_HOSTNAME Environment Variable.).
msiEndpoint
Optional
- Type: java.lang.String
(Optional) The path to a custom Managed Service Identity endpoint which is automatically determined if not specified.
This can also be sourced from the ARM_MSI_ENDPOINT environment variable.
oidcRequestToken
Optional
- Type: java.lang.String
(Optional) The bearer token for the request to the OIDC provider.
This can also be sourced from the ARM_OIDC_REQUEST_TOKEN or ACTIONS_ID_TOKEN_REQUEST_TOKEN environment variables.
oidcRequestUrl
Optional
- Type: java.lang.String
(Optional) The URL for the OIDC provider from which to request an ID token.
This can also be sourced from the ARM_OIDC_REQUEST_URL or ACTIONS_ID_TOKEN_REQUEST_URL environment variables.
oidcToken
Optional
- Type: java.lang.String
(Optional) The ID token when authenticating using OpenID Connect (OIDC).
This can also be sourced from the ARM_OIDC_TOKEN environment variable.
oidcTokenFilePath
Optional
- Type: java.lang.String
(Optional) The path to a file containing an ID token when authenticating using OpenID Connect (OIDC).
This can also be sourced from the ARM_OIDC_TOKEN_FILE_PATH environment variable.
resourceGroupName
Optional
- Type: java.lang.String
(Required) The Name of the Resource Group in which the Storage Account exists.
sasToken
Optional
- Type: java.lang.String
(Optional) The SAS Token used to access the Blob Storage Account.
This can also be sourced from the ARM_SAS_TOKEN environment variable.
snapshot
Optional
- Type: java.lang.Boolean
(Optional) Should the Blob used to store the Terraform Statefile be snapshotted before use?
Defaults to false. This value can also be sourced from the ARM_SNAPSHOT environment variable.
subscriptionId
Optional
- Type: java.lang.String
(Optional) The Subscription ID in which the Storage Account exists.
This can also be sourced from the ARM_SUBSCRIPTION_ID environment variable.
tenantId
Optional
- Type: java.lang.String
(Optional) The Tenant ID in which the Subscription exists.
This can also be sourced from the ARM_TENANT_ID environment variable.
useAzureadAuth
Optional
- Type: java.lang.Boolean
(Optional) Should AzureAD Authentication be used to access the Blob Storage Account.
This can also be sourced from the ARM_USE_AZUREAD environment variable.
Note: When using AzureAD for Authentication to Storage you also need to ensure the Storage Blob Data Owner role is assigned.
useMicrosoftGraph
Optional
- Type: java.lang.Boolean
(Optional) Should MSAL be used for authentication instead of ADAL, and should Microsoft Graph be used instead of Azure Active Directory Graph?
Defaults to true.
Note: In Terraform 1.2 the Azure Backend uses MSAL (and Microsoft Graph) rather than ADAL (and Azure Active Directory Graph) for authentication by default - you can disable this by setting use_microsoft_graph to false. This setting will be removed in Terraform 1.3, due to Microsoft's deprecation of ADAL.
useMsi
Optional
- Type: java.lang.Boolean
(Optional) Should Managed Service Identity authentication be used?
This can also be sourced from the ARM_USE_MSI environment variable.
useOidc
Optional
- Type: java.lang.Boolean
(Optional) Should OIDC authentication be used? This can also be sourced from the ARM_USE_OIDC environment variable.
Note: When using OIDC for authentication, use_microsoft_graph must be set to true (which is the default).
Methods
Name | Description |
---|---|
toString | Returns a string representation of this construct. |
addOverride | No description. |
overrideLogicalId | Overrides the auto-generated logical ID with a specific ID. |
resetOverrideLogicalId | Resets a previously passed logical Id to use the auto-generated logical id again. |
toHclTerraform | No description. |
toMetadata | No description. |
toTerraform | Adds this resource to the terraform JSON output. |
getRemoteStateDataSource | Creates a TerraformRemoteState resource that accesses this backend. |
toString
public java.lang.String toString()
Returns a string representation of this construct.
addOverride
public void addOverride(java.lang.String path, java.lang.Object value)
path
Required
- Type: java.lang.String
value
Required
- Type: java.lang.Object
overrideLogicalId
public void overrideLogicalId(java.lang.String newLogicalId)
Overrides the auto-generated logical ID with a specific ID.
newLogicalId
Required
- Type: java.lang.String
The new logical ID to use for this stack element.
resetOverrideLogicalId
public void resetOverrideLogicalId()
Resets a previously passed logical Id to use the auto-generated logical id again.
toHclTerraform
public java.lang.Object toHclTerraform()
toMetadata
public java.lang.Object toMetadata()
toTerraform
public java.lang.Object toTerraform()
Adds this resource to the terraform JSON output.
getRemoteStateDataSource
public TerraformRemoteState getRemoteStateDataSource(Construct scope, java.lang.String name, java.lang.String _fromStack)
Creates a TerraformRemoteState resource that accesses this backend.
scope
Required
- Type: software.constructs.Construct
name
Required
- Type: java.lang.String
_fromStack
Required
- Type: java.lang.String
Static Functions
Name | Description |
---|---|
isConstruct | Checks if x is a construct. |
isTerraformElement | No description. |
isBackend | No description. |
isConstruct
import com.hashicorp.cdktf.AzurermBackend;
AzurermBackend.isConstruct(java.lang.Object x)
Checks if x
is a construct.
Use this method instead of instanceof
to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs
library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct
in each copy of the constructs
library
is seen as a different class, and an instance of one class will not test as
instanceof
the other class. npm install
will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof
will behave
unpredictably. It is safest to avoid using instanceof
, and using
this type-testing method instead.
x
Required
- Type: java.lang.Object
Any object.
isTerraformElement
import com.hashicorp.cdktf.AzurermBackend;
AzurermBackend.isTerraformElement(java.lang.Object x)
x
Required
- Type: java.lang.Object
isBackend
import com.hashicorp.cdktf.AzurermBackend;
AzurermBackend.isBackend(java.lang.Object x)
x
Required
- Type: java.lang.Object
Properties
Name | Type | Description |
---|---|---|
node | software.constructs.Node | The tree node. |
cdktfStack | TerraformStack | No description. |
fqn | java.lang.String | No description. |
friendlyUniqueId | java.lang.String | No description. |
node
Required
public Node getNode();
- Type: software.constructs.Node
The tree node.
cdktfStack
Required
public TerraformStack getCdktfStack();
- Type: TerraformStack
fqn
Required
public java.lang.String getFqn();
- Type: java.lang.String
friendlyUniqueId
Required
public java.lang.String getFriendlyUniqueId();
- Type: java.lang.String
CloudBackend
The Cloud Backend synthesizes a {@link https://developer.hashicorp.com/terraform/cli/cloud/settings#the-cloud-block cloud block}. The cloud block is a nested block within the top-level terraform settings block. It specifies which Terraform Cloud workspaces to use for the current working directory. The cloud block only affects Terraform CLI's behavior. When Terraform Cloud uses a configuration that contains a cloud block - for example, when a workspace is configured to use a VCS provider directly - it ignores the block and behaves according to its own workspace settings.
Initializers
import com.hashicorp.cdktf.CloudBackend;
CloudBackend.Builder.create(Construct scope)
.organization(java.lang.String)
.workspaces(NamedCloudWorkspace)
.workspaces(TaggedCloudWorkspaces)
// .hostname(java.lang.String)
// .token(java.lang.String)
.build();
Name | Type | Description |
---|---|---|
scope | software.constructs.Construct | No description. |
organization | java.lang.String | The name of the organization containing the workspace(s) the current configuration should use. |
workspaces | NamedCloudWorkspace OR TaggedCloudWorkspaces | A nested block that specifies which remote Terraform Cloud workspaces to use for the current configuration. |
hostname | java.lang.String | The hostname of a Terraform Enterprise installation, if using Terraform Enterprise. |
token | java.lang.String | The token used to authenticate with Terraform Cloud. |
scope
Required
- Type: software.constructs.Construct
organization
Required
- Type: java.lang.String
The name of the organization containing the workspace(s) the current configuration should use.
workspaces
Required
- Type: NamedCloudWorkspace OR TaggedCloudWorkspaces
A nested block that specifies which remote Terraform Cloud workspaces to use for the current configuration.
The workspaces block must contain exactly one of the following arguments, each denoting a strategy for how workspaces should be mapped:
hostname
Optional
- Type: java.lang.String
- Default: app.terraform.io
The hostname of a Terraform Enterprise installation, if using Terraform Enterprise.
token
Optional
- Type: java.lang.String
The token used to authenticate with Terraform Cloud.
We recommend omitting the token from the configuration, and instead using terraform login or manually configuring credentials in the CLI config file.
Methods
Name | Description |
---|---|
toString | Returns a string representation of this construct. |
addOverride | No description. |
overrideLogicalId | Overrides the auto-generated logical ID with a specific ID. |
resetOverrideLogicalId | Resets a previously passed logical Id to use the auto-generated logical id again. |
toHclTerraform | No description. |
toMetadata | No description. |
toTerraform | Adds this resource to the terraform JSON output. |
getRemoteStateDataSource | Creates a TerraformRemoteState resource that accesses this backend. |
toString
public java.lang.String toString()
Returns a string representation of this construct.
addOverride
public void addOverride(java.lang.String path, java.lang.Object value)
path
Required
- Type: java.lang.String
value
Required
- Type: java.lang.Object
overrideLogicalId
public void overrideLogicalId(java.lang.String newLogicalId)
Overrides the auto-generated logical ID with a specific ID.
newLogicalId
Required
- Type: java.lang.String
The new logical ID to use for this stack element.
resetOverrideLogicalId
public void resetOverrideLogicalId()
Resets a previously passed logical Id to use the auto-generated logical id again.
toHclTerraform
public java.lang.Object toHclTerraform()
toMetadata
public java.lang.Object toMetadata()
toTerraform
public java.lang.Object toTerraform()
Adds this resource to the terraform JSON output.
getRemoteStateDataSource
public TerraformRemoteState getRemoteStateDataSource(Construct scope, java.lang.String name, java.lang.String _fromStack)
Creates a TerraformRemoteState resource that accesses this backend.
scope
Required
- Type: software.constructs.Construct
name
Required
- Type: java.lang.String
_fromStack
Required
- Type: java.lang.String
Static Functions
Name | Description |
---|---|
isConstruct | Checks if x is a construct. |
isTerraformElement | No description. |
isBackend | No description. |
isConstruct
import com.hashicorp.cdktf.CloudBackend;
CloudBackend.isConstruct(java.lang.Object x)
Checks if x
is a construct.
Use this method instead of instanceof
to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs
library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct
in each copy of the constructs
library
is seen as a different class, and an instance of one class will not test as
instanceof
the other class. npm install
will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof
will behave
unpredictably. It is safest to avoid using instanceof
, and using
this type-testing method instead.
x
Required
- Type: java.lang.Object
Any object.
isTerraformElement
import com.hashicorp.cdktf.CloudBackend;
CloudBackend.isTerraformElement(java.lang.Object x)
x
Required
- Type: java.lang.Object
isBackend
import com.hashicorp.cdktf.CloudBackend;
CloudBackend.isBackend(java.lang.Object x)
x
Required
- Type: java.lang.Object
Properties
Name | Type | Description |
---|---|---|
node | software.constructs.Node | The tree node. |
cdktfStack | TerraformStack | No description. |
fqn | java.lang.String | No description. |
friendlyUniqueId | java.lang.String | No description. |
node
Required
public Node getNode();
- Type: software.constructs.Node
The tree node.
cdktfStack
Required
public TerraformStack getCdktfStack();
- Type: TerraformStack
fqn
Required
public java.lang.String getFqn();
- Type: java.lang.String
friendlyUniqueId
Required
public java.lang.String getFriendlyUniqueId();
- Type: java.lang.String
ConsulBackend
Initializers
import com.hashicorp.cdktf.ConsulBackend;
ConsulBackend.Builder.create(Construct scope)
.accessToken(java.lang.String)
.path(java.lang.String)
// .address(java.lang.String)
// .caFile(java.lang.String)
// .certFile(java.lang.String)
// .datacenter(java.lang.String)
// .gzip(java.lang.Boolean)
// .httpAuth(java.lang.String)
// .keyFile(java.lang.String)
// .lock(java.lang.Boolean)
// .scheme(java.lang.String)
.build();
Name | Type | Description |
---|---|---|
scope | software.constructs.Construct | No description. |
accessToken | java.lang.String | (Required) Access token. |
path | java.lang.String | (Required) Path in the Consul KV store. |
address | java.lang.String | (Optional) DNS name and port of your Consul endpoint specified in the format dnsname:port. |
caFile | java.lang.String | (Optional) A path to a PEM-encoded certificate authority used to verify the remote agent's certificate. |
certFile | java.lang.String | (Optional) A path to a PEM-encoded certificate provided to the remote agent; |
datacenter | java.lang.String | (Optional) The datacenter to use. |
gzip | java.lang.Boolean | (Optional) true to compress the state data using gzip, or false (the default) to leave it uncompressed. |
httpAuth | java.lang.String | (Optional) HTTP Basic Authentication credentials to be used when communicating with Consul, in the format of either user or user:pass. |
keyFile | java.lang.String | (Optional) A path to a PEM-encoded private key, required if cert_file is specified. |
lock | java.lang.Boolean | (Optional) false to disable locking. |
scheme | java.lang.String | (Optional) Specifies what protocol to use when talking to the given address,either http or https. |
scope
Required
- Type: software.constructs.Construct
accessToken
Required
- Type: java.lang.String
(Required) Access token.
path
Required
- Type: java.lang.String
(Required) Path in the Consul KV store.
address
Optional
- Type: java.lang.String
(Optional) DNS name and port of your Consul endpoint specified in the format dnsname:port.
Defaults to the local agent HTTP listener.
caFile
Optional
- Type: java.lang.String
(Optional) A path to a PEM-encoded certificate authority used to verify the remote agent's certificate.
certFile
Optional
- Type: java.lang.String
(Optional) A path to a PEM-encoded certificate provided to the remote agent;
requires use of key_file.
datacenter
Optional
- Type: java.lang.String
(Optional) The datacenter to use.
Defaults to that of the agent.
gzip
Optional
- Type: java.lang.Boolean
(Optional) true to compress the state data using gzip, or false (the default) to leave it uncompressed.
httpAuth
Optional
- Type: java.lang.String
(Optional) HTTP Basic Authentication credentials to be used when communicating with Consul, in the format of either user or user:pass.
keyFile
Optional
- Type: java.lang.String
(Optional) A path to a PEM-encoded private key, required if cert_file is specified.
lock
Optional
- Type: java.lang.Boolean
(Optional) false to disable locking.
This defaults to true, but will require session permissions with Consul and at least kv write permissions on $path/.lock to perform locking.
scheme
Optional
- Type: java.lang.String
(Optional) Specifies what protocol to use when talking to the given address,either http or https.
SSL support can also be triggered by setting then environment variable CONSUL_HTTP_SSL to true.
Methods
Name | Description |
---|---|
toString | Returns a string representation of this construct. |
addOverride | No description. |
overrideLogicalId | Overrides the auto-generated logical ID with a specific ID. |
resetOverrideLogicalId | Resets a previously passed logical Id to use the auto-generated logical id again. |
toHclTerraform | No description. |
toMetadata | No description. |
toTerraform | Adds this resource to the terraform JSON output. |
getRemoteStateDataSource | Creates a TerraformRemoteState resource that accesses this backend. |
toString
public java.lang.String toString()
Returns a string representation of this construct.
addOverride
public void addOverride(java.lang.String path, java.lang.Object value)
path
Required
- Type: java.lang.String
value
Required
- Type: java.lang.Object
overrideLogicalId
public void overrideLogicalId(java.lang.String newLogicalId)
Overrides the auto-generated logical ID with a specific ID.
newLogicalId
Required
- Type: java.lang.String
The new logical ID to use for this stack element.
resetOverrideLogicalId
public void resetOverrideLogicalId()
Resets a previously passed logical Id to use the auto-generated logical id again.
toHclTerraform
public java.lang.Object toHclTerraform()
toMetadata
public java.lang.Object toMetadata()
toTerraform
public java.lang.Object toTerraform()
Adds this resource to the terraform JSON output.
getRemoteStateDataSource
public TerraformRemoteState getRemoteStateDataSource(Construct scope, java.lang.String name, java.lang.String _fromStack)
Creates a TerraformRemoteState resource that accesses this backend.
scope
Required
- Type: software.constructs.Construct
name
Required
- Type: java.lang.String
_fromStack
Required
- Type: java.lang.String
Static Functions
Name | Description |
---|---|
isConstruct | Checks if x is a construct. |
isTerraformElement | No description. |
isBackend | No description. |
isConstruct
import com.hashicorp.cdktf.ConsulBackend;
ConsulBackend.isConstruct(java.lang.Object x)
Checks if x
is a construct.
Use this method instead of instanceof
to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs
library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct
in each copy of the constructs
library
is seen as a different class, and an instance of one class will not test as
instanceof
the other class. npm install
will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof
will behave
unpredictably. It is safest to avoid using instanceof
, and using
this type-testing method instead.
x
Required
- Type: java.lang.Object
Any object.
isTerraformElement
import com.hashicorp.cdktf.ConsulBackend;
ConsulBackend.isTerraformElement(java.lang.Object x)
x
Required
- Type: java.lang.Object
isBackend
import com.hashicorp.cdktf.ConsulBackend;
ConsulBackend.isBackend(java.lang.Object x)
x
Required
- Type: java.lang.Object
Properties
Name | Type | Description |
---|---|---|
node | software.constructs.Node | The tree node. |
cdktfStack | TerraformStack | No description. |
fqn | java.lang.String | No description. |
friendlyUniqueId | java.lang.String | No description. |
node
Required
public Node getNode();
- Type: software.constructs.Node
The tree node.
cdktfStack
Required
public TerraformStack getCdktfStack();
- Type: TerraformStack
fqn
Required
public java.lang.String getFqn();
- Type: java.lang.String
friendlyUniqueId
Required
public java.lang.String getFriendlyUniqueId();
- Type: java.lang.String
CosBackend
Initializers
import com.hashicorp.cdktf.CosBackend;
CosBackend.Builder.create(Construct scope)
.bucket(java.lang.String)
// .accelerate(java.lang.Boolean)
// .acl(java.lang.String)
// .assumeRole(CosBackendAssumeRole)
// .domain(java.lang.String)
// .encrypt(java.lang.Boolean)
// .endpoint(java.lang.String)
// .key(java.lang.String)
// .prefix(java.lang.String)
// .region(java.lang.String)
// .secretId(java.lang.String)
// .secretKey(java.lang.String)
// .securityToken(java.lang.String)
.build();
Name | Type | Description |
---|---|---|
scope | software.constructs.Construct | No description. |
bucket | java.lang.String | (Required) The name of the COS bucket. |
accelerate | java.lang.Boolean | (Optional) Whether to enable global Acceleration. |
acl | java.lang.String | (Optional) Object ACL to be applied to the state file, allows private and public-read. |
assumeRole | CosBackendAssumeRole | (Optional) The assume_role block. |
domain | java.lang.String | (Optional) The root domain of the API request. |
encrypt | java.lang.Boolean | (Optional) Whether to enable server side encryption of the state file. |
endpoint | java.lang.String | (Optional) The Custom Endpoint for the COS backend. |
key | java.lang.String | (Optional) The path for saving the state file in bucket. |
prefix | java.lang.String | (Optional) The directory for saving the state file in bucket. |
region | java.lang.String | (Optional) The region of the COS bucket. |
secretId | java.lang.String | (Optional) Secret id of Tencent Cloud. |
secretKey | java.lang.String | (Optional) Secret key of Tencent Cloud. |
securityToken | java.lang.String | (Optional) TencentCloud Security Token of temporary access credentials. |
scope
Required
- Type: software.constructs.Construct
bucket
Required
- Type: java.lang.String
(Required) The name of the COS bucket.
You shall manually create it first.
accelerate
Optional
- Type: java.lang.Boolean
(Optional) Whether to enable global Acceleration.
Defaults to false.
acl
Optional
- Type: java.lang.String
(Optional) Object ACL to be applied to the state file, allows private and public-read.
Defaults to private.
assumeRole
Optional
- Type: CosBackendAssumeRole
(Optional) The assume_role block.
If provided, terraform will attempt to assume this role using the supplied credentials.
domain
Optional
- Type: java.lang.String
(Optional) The root domain of the API request.
Defaults to tencentcloudapi.com. It supports the environment variable TENCENTCLOUD_DOMAIN.
encrypt
Optional
- Type: java.lang.Boolean
(Optional) Whether to enable server side encryption of the state file.
If it is true, COS will use 'AES256' encryption algorithm to encrypt state file.
endpoint
Optional
- Type: java.lang.String
(Optional) The Custom Endpoint for the COS backend.
It supports the environment variable TENCENTCLOUD_ENDPOINT.
key
Optional
- Type: java.lang.String
(Optional) The path for saving the state file in bucket.
Defaults to terraform.tfstate.
prefix
Optional
- Type: java.lang.String
(Optional) The directory for saving the state file in bucket.
Default to "env:".
region
Optional
- Type: java.lang.String
(Optional) The region of the COS bucket.
It supports environment variables TENCENTCLOUD_REGION.
secretId
Optional
- Type: java.lang.String
(Optional) Secret id of Tencent Cloud.
It supports environment variables TENCENTCLOUD_SECRET_ID.
secretKey
Optional
- Type: java.lang.String
(Optional) Secret key of Tencent Cloud.
It supports environment variables TENCENTCLOUD_SECRET_KEY.
securityToken
Optional
- Type: java.lang.String
(Optional) TencentCloud Security Token of temporary access credentials.
It supports environment variables TENCENTCLOUD_SECURITY_TOKEN.
Methods
Name | Description |
---|---|
toString | Returns a string representation of this construct. |
addOverride | No description. |
overrideLogicalId | Overrides the auto-generated logical ID with a specific ID. |
resetOverrideLogicalId | Resets a previously passed logical Id to use the auto-generated logical id again. |
toHclTerraform | No description. |
toMetadata | No description. |
toTerraform | Adds this resource to the terraform JSON output. |
getRemoteStateDataSource | Creates a TerraformRemoteState resource that accesses this backend. |
toString
public java.lang.String toString()
Returns a string representation of this construct.
addOverride
public void addOverride(java.lang.String path, java.lang.Object value)
path
Required
- Type: java.lang.String
value
Required
- Type: java.lang.Object
overrideLogicalId
public void overrideLogicalId(java.lang.String newLogicalId)
Overrides the auto-generated logical ID with a specific ID.
newLogicalId
Required
- Type: java.lang.String
The new logical ID to use for this stack element.
resetOverrideLogicalId
public void resetOverrideLogicalId()
Resets a previously passed logical Id to use the auto-generated logical id again.
toHclTerraform
public java.lang.Object toHclTerraform()
toMetadata
public java.lang.Object toMetadata()
toTerraform
public java.lang.Object toTerraform()
Adds this resource to the terraform JSON output.
getRemoteStateDataSource
public TerraformRemoteState getRemoteStateDataSource(Construct scope, java.lang.String name, java.lang.String _fromStack)
Creates a TerraformRemoteState resource that accesses this backend.
scope
Required
- Type: software.constructs.Construct
name
Required
- Type: java.lang.String
_fromStack
Required
- Type: java.lang.String
Static Functions
Name | Description |
---|---|
isConstruct | Checks if x is a construct. |
isTerraformElement | No description. |
isBackend | No description. |
isConstruct
import com.hashicorp.cdktf.CosBackend;
CosBackend.isConstruct(java.lang.Object x)
Checks if x
is a construct.
Use this method instead of instanceof
to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs
library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct
in each copy of the constructs
library
is seen as a different class, and an instance of one class will not test as
instanceof
the other class. npm install
will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof
will behave
unpredictably. It is safest to avoid using instanceof
, and using
this type-testing method instead.
x
Required
- Type: java.lang.Object
Any object.
isTerraformElement
import com.hashicorp.cdktf.CosBackend;
CosBackend.isTerraformElement(java.lang.Object x)
x
Required
- Type: java.lang.Object
isBackend
import com.hashicorp.cdktf.CosBackend;
CosBackend.isBackend(java.lang.Object x)
x
Required
- Type: java.lang.Object
Properties
Name | Type | Description |
---|---|---|
node | software.constructs.Node | The tree node. |
cdktfStack | TerraformStack | No description. |
fqn | java.lang.String | No description. |
friendlyUniqueId | java.lang.String | No description. |
node
Required
public Node getNode();
- Type: software.constructs.Node
The tree node.
cdktfStack
Required
public TerraformStack getCdktfStack();
- Type: TerraformStack
fqn
Required
public java.lang.String getFqn();
- Type: java.lang.String
friendlyUniqueId
Required
public java.lang.String getFriendlyUniqueId();
- Type: java.lang.String
DataResource
The DataResource implements the standard resource lifecycle, but does not directly take any other actions.
You can use the DataResource resource without requiring or configuring a provider.
The DataResource resource is useful for storing values which need to follow a manage resource lifecycle, and for triggering provisioners when there is no other logical managed resource in which to place them.
It requires Terraform 1.4 or later.
It is also possible to generate these bindings by adding "terraform.io/builtin/terraform" to the "terraformProviders" key in your cdktf.json file and running "cdktf get".
https://developer.hashicorp.com/terraform/language/resources/terraform-data
Initializers
import com.hashicorp.cdktf.DataResource;
DataResource.Builder.create(Construct scope, java.lang.String id)
// .connection(SSHProvisionerConnection)
// .connection(WinrmProvisionerConnection)
// .count(java.lang.Number)
// .count(TerraformCount)
// .dependsOn(java.util.List< ITerraformDependable >)
// .forEach(ITerraformIterator)
// .lifecycle(TerraformResourceLifecycle)
// .provider(TerraformProvider)
// .provisioners(java.util.List< FileProvisioner)
// .provisioners(LocalExecProvisioner)
// .provisioners(RemoteExecProvisioner >)
// .input(java.util.Map< java.lang.String, java.lang.Object >)
// .triggersReplace(java.util.Map< java.lang.String, java.lang.Object >)
.build();
Name | Type | Description |
---|---|---|
scope | software.constructs.Construct | The scope in which to define this construct. |
id | java.lang.String | The scoped construct ID. |
connection | SSHProvisionerConnection OR WinrmProvisionerConnection | No description. |
count | java.lang.Number OR TerraformCount | No description. |
dependsOn | java.util.List< ITerraformDependable> | No description. |
forEach | ITerraformIterator | No description. |
lifecycle | TerraformResourceLifecycle | No description. |
provider | TerraformProvider | No description. |
provisioners | java.util.List< FileProvisioner OR LocalExecProvisioner OR RemoteExecProvisioner> | No description. |
input | java.util.Map< java.lang.String, java.lang.Object > | (Optional) A value which will be stored in the instance state, and reflected in the output attribute after apply. |
triggersReplace | java.util.Map< java.lang.String, java.lang.Object > | (Optional) A value which is stored in the instance state, and will force replacement when the value changes. |
scope
Required
- Type: software.constructs.Construct
The scope in which to define this construct.
id
Required
- Type: java.lang.String
The scoped construct ID.
Must be unique amongst siblings in the same scope
connection
Optional
count
Optional
- Type: java.lang.Number OR TerraformCount
dependsOn
Optional
- Type: java.util.List< ITerraformDependable>
forEach
Optional
- Type: ITerraformIterator
lifecycle
Optional
provider
Optional
- Type: TerraformProvider
provisioners
Optional
- Type: java.util.List< FileProvisioner OR LocalExecProvisioner OR RemoteExecProvisioner>
input
Optional
- Type: java.util.Map< java.lang.String, java.lang.Object >
(Optional) A value which will be stored in the instance state, and reflected in the output attribute after apply.
https://developer.hashicorp.com/terraform/language/resources/terraform-data#input
triggersReplace
Optional
- Type: java.util.Map< java.lang.String, java.lang.Object >
(Optional) A value which is stored in the instance state, and will force replacement when the value changes.
https://developer.hashicorp.com/terraform/language/resources/terraform-data#triggers_replace
Methods
Name | Description |
---|---|
toString | Returns a string representation of this construct. |
addOverride | No description. |
overrideLogicalId | Overrides the auto-generated logical ID with a specific ID. |
resetOverrideLogicalId | Resets a previously passed logical Id to use the auto-generated logical id again. |
toHclTerraform | No description. |
toMetadata | No description. |
toTerraform | Adds this resource to the terraform JSON output. |
addMoveTarget | Adds a user defined moveTarget string to this resource to be later used in .moveTo(moveTarget) to resolve the location of the move. |
getAnyMapAttribute | No description. |
getBooleanAttribute | No description. |
getBooleanMapAttribute | No description. |
getListAttribute | No description. |
getNumberAttribute | No description. |
getNumberListAttribute | No description. |
getNumberMapAttribute | No description. |
getStringAttribute | No description. |
getStringMapAttribute | No description. |
hasResourceMove | No description. |
importFrom | No description. |
interpolationForAttribute | No description. |
moveFromId | Move the resource corresponding to "id" to this resource. |
moveTo | Moves this resource to the target resource given by moveTarget. |
moveToId | Moves this resource to the resource corresponding to "id". |
resetInput | No description. |
resetTriggersReplace | No description. |
toString
public java.lang.String toString()
Returns a string representation of this construct.
addOverride
public void addOverride(java.lang.String path, java.lang.Object value)
path
Required
- Type: java.lang.String
value
Required
- Type: java.lang.Object
overrideLogicalId
public void overrideLogicalId(java.lang.String newLogicalId)
Overrides the auto-generated logical ID with a specific ID.
newLogicalId
Required
- Type: java.lang.String
The new logical ID to use for this stack element.
resetOverrideLogicalId
public void resetOverrideLogicalId()
Resets a previously passed logical Id to use the auto-generated logical id again.
toHclTerraform
public java.lang.Object toHclTerraform()
toMetadata
public java.lang.Object toMetadata()
toTerraform
public java.lang.Object toTerraform()
Adds this resource to the terraform JSON output.
addMoveTarget
public void addMoveTarget(java.lang.String moveTarget)
Adds a user defined moveTarget string to this resource to be later used in .moveTo(moveTarget) to resolve the location of the move.
moveTarget
Required
- Type: java.lang.String
The string move target that will correspond to this resource.
getAnyMapAttribute
public java.util.Map< java.lang.String, java.lang.Object > getAnyMapAttribute(java.lang.String terraformAttribute)
terraformAttribute
Required
- Type: java.lang.String
getBooleanAttribute
public IResolvable getBooleanAttribute(java.lang.String terraformAttribute)
terraformAttribute
Required
- Type: java.lang.String
getBooleanMapAttribute
public java.util.Map< java.lang.String, java.lang.Boolean > getBooleanMapAttribute(java.lang.String terraformAttribute)
terraformAttribute
Required
- Type: java.lang.String
getListAttribute
public java.util.List< java.lang.String > getListAttribute(java.lang.String terraformAttribute)
terraformAttribute
Required
- Type: java.lang.String
getNumberAttribute
public java.lang.Number getNumberAttribute(java.lang.String terraformAttribute)
terraformAttribute
Required
- Type: java.lang.String
getNumberListAttribute
public java.util.List< java.lang.Number > getNumberListAttribute(java.lang.String terraformAttribute)
terraformAttribute
Required
- Type: java.lang.String
getNumberMapAttribute
public java.util.Map< java.lang.String, java.lang.Number > getNumberMapAttribute(java.lang.String terraformAttribute)
terraformAttribute
Required
- Type: java.lang.String
getStringAttribute
public java.lang.String getStringAttribute(java.lang.String terraformAttribute)
terraformAttribute
Required
- Type: java.lang.String
getStringMapAttribute
public java.util.Map< java.lang.String, java.lang.String > getStringMapAttribute(java.lang.String terraformAttribute)
terraformAttribute
Required
- Type: java.lang.String
hasResourceMove
public TerraformResourceMoveByTarget OR TerraformResourceMoveById hasResourceMove()
importFrom
public void importFrom(java.lang.String id)
public void importFrom(java.lang.String id, TerraformProvider provider)
id
Required
- Type: java.lang.String
provider
Optional
- Type: TerraformProvider
interpolationForAttribute
public IResolvable interpolationForAttribute(java.lang.String terraformAttribute)
terraformAttribute
Required
- Type: java.lang.String
moveFromId
public void moveFromId(java.lang.String id)
Move the resource corresponding to "id" to this resource.
Note that the resource being moved from must be marked as moved using it's instance function.
id
Required
- Type: java.lang.String
Full id of resource being moved from, e.g. "aws_s3_bucket.example".
moveTo
public void moveTo(java.lang.String moveTarget)
public void moveTo(java.lang.String moveTarget, java.lang.String OR java.lang.Number index)
Moves this resource to the target resource given by moveTarget.
moveTarget
Required
- Type: java.lang.String
The previously set user defined string set by .addMoveTarget() corresponding to the resource to move to.
index
Optional
- Type: java.lang.String OR java.lang.Number
Optional The index corresponding to the key the resource is to appear in the foreach of a resource to move to.
moveToId
public void moveToId(java.lang.String id)
Moves this resource to the resource corresponding to "id".
id
Required
- Type: java.lang.String
Full id of resource to move to, e.g. "aws_s3_bucket.example".
resetInput
public void resetInput()
resetTriggersReplace
public void resetTriggersReplace()
Static Functions
Name | Description |
---|---|
isConstruct | Checks if x is a construct. |
isTerraformElement | No description. |
isTerraformResource | No description. |
generateConfigForImport | Generates CDKTF code for importing a Data resource upon running "cdktf plan < stack-name >". |
isConstruct
import com.hashicorp.cdktf.DataResource;
DataResource.isConstruct(java.lang.Object x)
Checks if x
is a construct.
Use this method instead of instanceof
to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs
library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct
in each copy of the constructs
library
is seen as a different class, and an instance of one class will not test as
instanceof
the other class. npm install
will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof
will behave
unpredictably. It is safest to avoid using instanceof
, and using
this type-testing method instead.
x
Required
- Type: java.lang.Object
Any object.
isTerraformElement
import com.hashicorp.cdktf.DataResource;
DataResource.isTerraformElement(java.lang.Object x)
x
Required
- Type: java.lang.Object
isTerraformResource
import com.hashicorp.cdktf.DataResource;
DataResource.isTerraformResource(java.lang.Object x)
x
Required
- Type: java.lang.Object
generateConfigForImport
import com.hashicorp.cdktf.DataResource;
DataResource.generateConfigForImport(Construct scope, java.lang.String importToId, java.lang.String importFromId),DataResource.generateConfigForImport(Construct scope, java.lang.String importToId, java.lang.String importFromId, TerraformProvider provider)
Generates CDKTF code for importing a Data resource upon running "cdktf plan < stack-name >".
scope
Required
- Type: software.constructs.Construct
The scope in which to define this construct.
importToId
Required
- Type: java.lang.String
The construct id used in the generated config for the Data to import.
importFromId
Required
- Type: java.lang.String
The id of the existing Data that should be imported.
Refer to the {@link https://terraform.io/providers/builtin/terraform/latest/docs/resources/data#import import section} in the documentation of this resource for the id to use
provider
Optional
- Type: TerraformProvider
? Optional instance of the provider where the Data to import is found.
Properties
Name | Type | Description |
---|---|---|
node | software.constructs.Node | The tree node. |
cdktfStack | TerraformStack | No description. |
fqn | java.lang.String | No description. |
friendlyUniqueId | java.lang.String | No description. |
terraformMetaArguments | java.util.Map< java.lang.String, java.lang.Object > | No description. |
terraformResourceType | java.lang.String | No description. |
terraformGeneratorMetadata | TerraformProviderGeneratorMetadata | No description. |
connection | SSHProvisionerConnection OR WinrmProvisionerConnection | No description. |
count | java.lang.Number OR TerraformCount | No description. |
dependsOn | java.util.List< java.lang.String > | No description. |
forEach | ITerraformIterator | No description. |
lifecycle | TerraformResourceLifecycle | No description. |
provider | TerraformProvider | No description. |
provisioners | java.util.List< FileProvisioner OR LocalExecProvisioner OR RemoteExecProvisioner> | No description. |
id | java.lang.String | No description. |
output | AnyMap | No description. |
inputInput | java.util.Map< java.lang.String, java.lang.Object > | No description. |
triggersReplaceInput | java.util.Map< java.lang.String, java.lang.Object > | No description. |
input | java.util.Map< java.lang.String, java.lang.Object > | (Optional) A value which will be stored in the instance state, and reflected in the output attribute after apply. |
triggersReplace | java.util.Map< java.lang.String, java.lang.Object > | (Optional) A value which is stored in the instance state, and will force replacement when the value changes. |
node
Required
public Node getNode();
- Type: software.constructs.Node
The tree node.
cdktfStack
Required
public TerraformStack getCdktfStack();
- Type: TerraformStack
fqn
Required
public java.lang.String getFqn();
- Type: java.lang.String
friendlyUniqueId
Required
public java.lang.String getFriendlyUniqueId();
- Type: java.lang.String
terraformMetaArguments
Required
public java.util.Map< java.lang.String, java.lang.Object > getTerraformMetaArguments();
- Type: java.util.Map< java.lang.String, java.lang.Object >
terraformResourceType
Required
public java.lang.String getTerraformResourceType();
- Type: java.lang.String
terraformGeneratorMetadata
Optional
public TerraformProviderGeneratorMetadata getTerraformGeneratorMetadata();
connection
Optional
public java.lang.Object getConnection();
count
Optional
public java.lang.Object getCount();
- Type: java.lang.Number OR TerraformCount
dependsOn
Optional
public java.util.List< java.lang.String > getDependsOn();
- Type: java.util.List< java.lang.String >
forEach
Optional
public ITerraformIterator getForEach();
- Type: ITerraformIterator
lifecycle
Optional
public TerraformResourceLifecycle getLifecycle();
provider
Optional
public TerraformProvider getProvider();
- Type: TerraformProvider
provisioners
Optional
public java.lang.Object getProvisioners();
- Type: java.util.List< FileProvisioner OR LocalExecProvisioner OR RemoteExecProvisioner>
id
Required
public java.lang.String getId();
- Type: java.lang.String
output
Required
public AnyMap getOutput();
- Type: AnyMap
inputInput
Optional
public java.util.Map< java.lang.String, java.lang.Object > getInputInput();
- Type: java.util.Map< java.lang.String, java.lang.Object >
triggersReplaceInput
Optional
public java.util.Map< java.lang.String, java.lang.Object > getTriggersReplaceInput();
- Type: java.util.Map< java.lang.String, java.lang.Object >
input
Required
public java.util.Map< java.lang.String, java.lang.Object > getInput();
- Type: java.util.Map< java.lang.String, java.lang.Object >
(Optional) A value which will be stored in the instance state, and reflected in the output attribute after apply.
https://developer.hashicorp.com/terraform/language/resources/terraform-data#input
triggersReplace
Required
public java.util.Map< java.lang.String, java.lang.Object > getTriggersReplace();
- Type: java.util.Map< java.lang.String, java.lang.Object >
(Optional) A value which is stored in the instance state, and will force replacement when the value changes.
https://developer.hashicorp.com/terraform/language/resources/terraform-data#triggers_replace
Constants
Name | Type | Description |
---|---|---|
tfResourceType | java.lang.String | No description. |
tfResourceType
Required
public java.lang.String getTfResourceType();
- Type: java.lang.String
DataTerraformRemoteState
Initializers
import com.hashicorp.cdktf.DataTerraformRemoteState;
DataTerraformRemoteState.Builder.create(Construct scope, java.lang.String id)
// .defaults(java.util.Map< java.lang.String, java.lang.Object >)
// .workspace(java.lang.String)
.organization(java.lang.String)
.workspaces(IRemoteWorkspace)
// .hostname(java.lang.String)
// .token(java.lang.String)
.build();
Name | Type | Description |
---|---|---|
scope | software.constructs.Construct | No description. |
id | java.lang.String | No description. |
defaults | java.util.Map< java.lang.String, java.lang.Object > | No description. |
workspace | java.lang.String | No description. |
organization | java.lang.String | No description. |
workspaces | IRemoteWorkspace | No description. |
hostname | java.lang.String | No description. |
token | java.lang.String | No description. |
scope
Required
- Type: software.constructs.Construct
id
Required
- Type: java.lang.String
defaults
Optional
- Type: java.util.Map< java.lang.String, java.lang.Object >
workspace
Optional
- Type: java.lang.String
organization
Required
- Type: java.lang.String
workspaces
Required
- Type: IRemoteWorkspace
hostname
Optional
- Type: java.lang.String
token
Optional
- Type: java.lang.String
Methods
Name | Description |
---|---|
toString | Returns a string representation of this construct. |
addOverride | No description. |
overrideLogicalId | Overrides the auto-generated logical ID with a specific ID. |
resetOverrideLogicalId | Resets a previously passed logical Id to use the auto-generated logical id again. |
toHclTerraform | Adds this resource to the terraform JSON output. |
toMetadata | No description. |
toTerraform | Adds this resource to the terraform JSON output. |
get | No description. |
getBoolean | No description. |
getList | No description. |
getNumber | No description. |
getString | No description. |
toString
public java.lang.String toString()
Returns a string representation of this construct.
addOverride
public void addOverride(java.lang.String path, java.lang.Object value)
path
Required
- Type: java.lang.String
value
Required
- Type: java.lang.Object
overrideLogicalId
public void overrideLogicalId(java.lang.String newLogicalId)
Overrides the auto-generated logical ID with a specific ID.
newLogicalId
Required
- Type: java.lang.String
The new logical ID to use for this stack element.
resetOverrideLogicalId
public void resetOverrideLogicalId()
Resets a previously passed logical Id to use the auto-generated logical id again.
toHclTerraform
public java.lang.Object toHclTerraform()
Adds this resource to the terraform JSON output.
toMetadata
public java.lang.Object toMetadata()
toTerraform
public java.lang.Object toTerraform()
Adds this resource to the terraform JSON output.
get
public IResolvable get(java.lang.String output)
output
Required
- Type: java.lang.String
getBoolean
public IResolvable getBoolean(java.lang.String output)
output
Required
- Type: java.lang.String
getList
public java.util.List< java.lang.String > getList(java.lang.String output)
output
Required
- Type: java.lang.String
getNumber
public java.lang.Number getNumber(java.lang.String output)
output
Required
- Type: java.lang.String
getString
public java.lang.String getString(java.lang.String output)
output
Required
- Type: java.lang.String
Static Functions
Name | Description |
---|---|
isConstruct | Checks if x is a construct. |
isTerraformElement | No description. |
isConstruct
import com.hashicorp.cdktf.DataTerraformRemoteState;
DataTerraformRemoteState.isConstruct(java.lang.Object x)
Checks if x
is a construct.
Use this method instead of instanceof
to properly detect Construct
instances, even when the construct library is symlinked.
Explanation: in JavaScript, multiple copies of the constructs
library on
disk are seen as independent, completely different libraries. As a
consequence, the class Construct
in each copy of the constructs
library
is seen as a different class, and an instance of one class will not test as
instanceof
the other class. npm install
will not create installations
like this, but users may manually symlink construct libraries together or
use a monorepo tool: in those cases, multiple copies of the constructs
library can be accidentally installed, and instanceof
will behave
unpredictably. It is safest to avoid using instanceof
, and using
this type-testing method instead.
x
Required
- Type: java.lang.Object
Any object.
isTerraformElement
import com.hashicorp.cdktf.DataTerraformRemoteState;
DataTerraformRemoteState.isTerraformElement(java.lang.Object x)
x
Required
- Type: java.lang.Object
Properties
Name | Type | Description |
---|---|---|
node | software.constructs.Node | The tree node. |
cdktfStack | TerraformStack | No description. |
fqn | java.lang.String | No description. |
friendlyUniqueId | java.lang.String | No description. |
node
Required
public Node getNode();
- Type: software.constructs.Node
The tree node.
cdktfStack
Required
public TerraformStack getCdktfStack();
- Type: TerraformStack
fqn
Required