Skip to main content

Initializer

import cdktn

cdktn.DataTerraformRemoteStateS3Config(
  defaults: typing.Mapping[typing.Any] = None,
  workspace: str = None,
  bucket: str,
  key: str,
  access_key: str = None,
  acl: str = None,
  allowed_account_ids: typing.List[str] = None,
  assume_role: S3BackendAssumeRoleConfig = None,
  assume_role_policy: str = None,
  assume_role_policy_arns: typing.List[str] = None,
  assume_role_tags: typing.Mapping[str] = None,
  assume_role_transitive_tag_keys: typing.List[str] = None,
  assume_role_with_web_identity: S3BackendAssumeRoleWithWebIdentityConfig = None,
  custom_ca_bundle: str = None,
  dynamodb_endpoint: str = None,
  dynamodb_table: str = None,
  ec2_metadata_service_endpoint: str = None,
  ec2_metadata_service_endpoint_mode: str = None,
  encrypt: bool = None,
  endpoint: str = None,
  endpoints: S3BackendEndpointConfig = None,
  external_id: str = None,
  forbidden_account_ids: typing.List[str] = None,
  force_path_style: bool = None,
  http_proxy: str = None,
  https_proxy: str = None,
  iam_endpoint: str = None,
  insecure: bool = None,
  kms_key_id: str = None,
  max_retries: typing.Union[int, float] = None,
  no_proxy: str = None,
  profile: str = None,
  region: str = None,
  retry_mode: str = None,
  role_arn: str = None,
  secret_key: str = None,
  session_name: str = None,
  shared_config_files: typing.List[str] = None,
  shared_credentials_file: str = None,
  shared_credentials_files: typing.List[str] = None,
  skip_credentials_validation: bool = None,
  skip_metadata_api_check: bool = None,
  skip_region_validation: bool = None,
  skip_requesting_account_id: bool = None,
  skip_s3_checksum: bool = None,
  sse_customer_key: str = None,
  sts_endpoint: str = None,
  sts_region: str = None,
  token: str = None,
  use_legacy_workflow: bool = None,
  use_path_style: bool = None,
  workspace_key_prefix: str = None
)

Properties

NameTypeDescription
defaultstyping.Mapping[typing.Any]No description.
workspacestrNo description.
bucketstrName of the S3 Bucket.
keystrPath to the state file inside the S3 Bucket.
access_keystr(Optional) AWS access key.
aclstr(Optional) Canned ACL to be applied to the state file.
allowed_account_idstyping.List[str](Optional) List of allowed AWS account IDs to prevent potential destruction of a live environment.
assume_roleS3BackendAssumeRoleConfigAssuming an IAM Role can be configured in two ways.
assume_role_policystr(Optional) IAM Policy JSON describing further restricting permissions for the IAM Role being assumed.
assume_role_policy_arnstyping.List[str](Optional) Set of Amazon Resource Names (ARNs) of IAM Policies describing further restricting permissions for the IAM Role being assumed.
assume_role_tagstyping.Mapping[str](Optional) Map of assume role session tags.
assume_role_transitive_tag_keystyping.List[str](Optional) Set of assume role session tag keys to pass to any subsequent sessions.
assume_role_with_web_identityS3BackendAssumeRoleWithWebIdentityConfigAssume Role With Web Identity Configuration.
custom_ca_bundlestr(Optional) File containing custom root and intermediate certificates.
dynamodb_endpointstr(Optional) Custom endpoint for the AWS DynamoDB API.
dynamodb_tablestr(Optional) Name of DynamoDB Table to use for state locking and consistency.
ec2_metadata_service_endpointstrOptional) Custom endpoint URL for the EC2 Instance Metadata Service (IMDS) API.
ec2_metadata_service_endpoint_modestr(Optional) Mode to use in communicating with the metadata service.
encryptbool(Optional) Enable server side encryption of the state file.
endpointstr(Optional) Custom endpoint for the AWS S3 API.
endpointsS3BackendEndpointConfig(Optional) The endpoint configuration block.
external_idstr(Optional) External identifier to use when assuming the role.
forbidden_account_idstyping.List[str](Optional) List of forbidden AWS account IDs to prevent potential destruction of a live environment.
force_path_stylebool(Optional) Enable path-style S3 URLs (https://< HOST >/< BUCKET > instead of https://< BUCKET >.< HOST >).
http_proxystr(Optional) URL of a proxy to use for HTTP requests when accessing the AWS API.
https_proxystr(Optional) URL of a proxy to use for HTTPS requests when accessing the AWS API.
iam_endpointstr(Optional) Custom endpoint for the AWS Identity and Access Management (IAM) API.
insecureboolOptional) Whether to explicitly allow the backend to perform “insecure” SSL requests.
kms_key_idstr(Optional) Amazon Resource Name (ARN) of a Key Management Service (KMS) Key to use for encrypting the state.
max_retriestyping.Union[int, float](Optional) The maximum number of times an AWS API request is retried on retryable failure.
no_proxystr(Optional) Comma-separated list of hosts that should not use HTTP or HTTPS proxies.
profilestr(Optional) Name of AWS profile in AWS shared credentials file (e.g. ~/.aws/credentials) or AWS shared configuration file (e.g. ~/.aws/config) to use for credentials and/or configuration. This can also be sourced from the AWS_PROFILE environment variable.
regionstrAWS Region of the S3 Bucket and DynamoDB Table (if used).
retry_modestr(Optional) Specifies how retries are attempted.
role_arnstr(Optional) Amazon Resource Name (ARN) of the IAM Role to assume.
secret_keystr(Optional) AWS secret access key.
session_namestr(Optional) Session name to use when assuming the role.
shared_config_filestyping.List[str](Optional) List of paths to AWS shared configuration files.
shared_credentials_filestr(Optional) Path to the AWS shared credentials file.
shared_credentials_filestyping.List[str](Optional) List of paths to AWS shared credentials files.
skip_credentials_validationbool(Optional) Skip credentials validation via the STS API.
skip_metadata_api_checkbool(Optional) Skip usage of EC2 Metadata API.
skip_region_validationbool(Optional) Skip validation of provided region name.
skip_requesting_account_idbool(Optional) Whether to skip requesting the account ID.
skip_s3_checksumbool(Optional) Do not include checksum when uploading S3 Objects.
sse_customer_keystr(Optional) The key to use for encrypting state with Server-Side Encryption with Customer-Provided Keys (SSE-C).
sts_endpointstr(Optional) Custom endpoint for the AWS Security Token Service (STS) API.
sts_regionstr(Optional) AWS region for STS.
tokenstr(Optional) Multi-Factor Authentication (MFA) token.
use_legacy_workflowbool(Optional) Use the legacy authentication workflow, preferring environment variables over backend configuration.
use_path_stylebool(Optional) Enable path-style S3 URLs (https://< HOST >/< BUCKET > instead of https://< BUCKET >.< HOST >).
workspace_key_prefixstr(Optional) Prefix applied to the state path inside the bucket.

defaultsOptional

defaults: typing.Mapping[typing.Any]
  • Type: typing.Mapping[typing.Any]

workspaceOptional

workspace: str
  • Type: str

bucketRequired

bucket: str
  • Type: str
Name of the S3 Bucket.

keyRequired

key: str
  • Type: str
Path to the state file inside the S3 Bucket. When using a non-default workspace, the state path will be /workspace_key_prefix/workspace_name/key

access_keyOptional

access_key: str
  • Type: str
(Optional) AWS access key. If configured, must also configure secret_key. This can also be sourced from the AWS_ACCESS_KEY_ID environment variable, AWS shared credentials file (e.g. ~/.aws/credentials), or AWS shared configuration file (e.g. ~/.aws/config).

aclOptional

acl: str
  • Type: str
(Optional) Canned ACL to be applied to the state file.

allowed_account_idsOptional

allowed_account_ids: typing.List[str]
  • Type: typing.List[str]
(Optional) List of allowed AWS account IDs to prevent potential destruction of a live environment. Conflicts with forbidden_account_ids.

assume_roleOptional

assume_role: S3BackendAssumeRoleConfig
Assuming an IAM Role can be configured in two ways. The preferred way is to use the argument assume_role, the other, which is deprecated, is with arguments at the top level.

assume_role_policyOptional

  • Deprecated: Use assumeRole.policy instead.
assume_role_policy: str
  • Type: str
(Optional) IAM Policy JSON describing further restricting permissions for the IAM Role being assumed.

assume_role_policy_arnsOptional

  • Deprecated: Use assumeRole.policyArns instead.
assume_role_policy_arns: typing.List[str]
  • Type: typing.List[str]
(Optional) Set of Amazon Resource Names (ARNs) of IAM Policies describing further restricting permissions for the IAM Role being assumed.

assume_role_tagsOptional

  • Deprecated: Use assumeRole.tags instead.
assume_role_tags: typing.Mapping[str]
  • Type: typing.Mapping[str]
(Optional) Map of assume role session tags.

assume_role_transitive_tag_keysOptional

  • Deprecated: Use assumeRole.transitiveTagKeys instead.
assume_role_transitive_tag_keys: typing.List[str]
  • Type: typing.List[str]
(Optional) Set of assume role session tag keys to pass to any subsequent sessions.

assume_role_with_web_identityOptional

assume_role_with_web_identity: S3BackendAssumeRoleWithWebIdentityConfig
Assume Role With Web Identity Configuration.

custom_ca_bundleOptional

custom_ca_bundle: str
  • Type: str
(Optional) File containing custom root and intermediate certificates. Can also be set using the AWS_CA_BUNDLE environment variable. Setting ca_bundle in the shared config file is not supported.

dynamodb_endpointOptional

  • Deprecated: Use endpoints.dynamodb instead
dynamodb_endpoint: str
  • Type: str
(Optional) Custom endpoint for the AWS DynamoDB API. This can also be sourced from the AWS_DYNAMODB_ENDPOINT environment variable.

dynamodb_tableOptional

dynamodb_table: str
  • Type: str
(Optional) Name of DynamoDB Table to use for state locking and consistency. The table must have a partition key named LockID with type of String. If not configured, state locking will be disabled.

ec2_metadata_service_endpointOptional

ec2_metadata_service_endpoint: str
  • Type: str
Optional) Custom endpoint URL for the EC2 Instance Metadata Service (IMDS) API. Can also be set with the AWS_EC2_METADATA_SERVICE_ENDPOINT environment variable.

ec2_metadata_service_endpoint_modeOptional

ec2_metadata_service_endpoint_mode: str
  • Type: str
(Optional) Mode to use in communicating with the metadata service. Valid values are IPv4 and IPv6. Can also be set with the AWS_EC2_METADATA_SERVICE_ENDPOINT_MODE environment variable.

encryptOptional

encrypt: bool
  • Type: bool
(Optional) Enable server side encryption of the state file.

endpointOptional

  • Deprecated: Use endpoints.s3 instead
endpoint: str
  • Type: str
(Optional) Custom endpoint for the AWS S3 API. This can also be sourced from the AWS_S3_ENDPOINT environment variable.

endpointsOptional

endpoints: S3BackendEndpointConfig
(Optional) The endpoint configuration block.

external_idOptional

  • Deprecated: Use assume_role.external_id instead.
external_id: str
  • Type: str
(Optional) External identifier to use when assuming the role.

forbidden_account_idsOptional

forbidden_account_ids: typing.List[str]
  • Type: typing.List[str]
(Optional) List of forbidden AWS account IDs to prevent potential destruction of a live environment. Conflicts with allowed_account_ids.

force_path_styleOptional

  • Deprecated: Use usePathStyle instead
force_path_style: bool
  • Type: bool
(Optional) Enable path-style S3 URLs (https://< HOST >/< BUCKET > instead of https://< BUCKET >.< HOST >).

http_proxyOptional

http_proxy: str
  • Type: str
(Optional) URL of a proxy to use for HTTP requests when accessing the AWS API. Can also be set using the HTTP_PROXY or http_proxy environment variables.

https_proxyOptional

https_proxy: str
  • Type: str
(Optional) URL of a proxy to use for HTTPS requests when accessing the AWS API. Can also be set using the HTTPS_PROXY or https_proxy environment variables.

iam_endpointOptional

  • Deprecated: Use endpoints.iam instead
iam_endpoint: str
  • Type: str
(Optional) Custom endpoint for the AWS Identity and Access Management (IAM) API. This can also be sourced from the AWS_IAM_ENDPOINT environment variable.

insecureOptional

insecure: bool
  • Type: bool
Optional) Whether to explicitly allow the backend to perform “insecure” SSL requests. If omitted, the default value is false.

kms_key_idOptional

kms_key_id: str
  • Type: str
(Optional) Amazon Resource Name (ARN) of a Key Management Service (KMS) Key to use for encrypting the state. Note that if this value is specified, Terraform will need kms:Encrypt, kms:Decrypt and kms:GenerateDataKey permissions on this KMS key.

max_retriesOptional

max_retries: typing.Union[int, float]
  • Type: typing.Union[int, float]
(Optional) The maximum number of times an AWS API request is retried on retryable failure. Defaults to 5.

no_proxyOptional

no_proxy: str
  • Type: str
(Optional) Comma-separated list of hosts that should not use HTTP or HTTPS proxies. Each value can be one of:
  • A domain name
  • An IP address
  • A CIDR address
  • An asterisk (*), to indicate that no proxying should be performed Domain name and IP address values can also include a port number. Can also be set using the NO_PROXY or no_proxy environment variables.

profileOptional

profile: str
  • Type: str
(Optional) Name of AWS profile in AWS shared credentials file (e.g. ~/.aws/credentials) or AWS shared configuration file (e.g. ~/.aws/config) to use for credentials and/or configuration. This can also be sourced from the AWS_PROFILE environment variable.

regionOptional

region: str
  • Type: str
AWS Region of the S3 Bucket and DynamoDB Table (if used). This can also be sourced from the AWS_DEFAULT_REGION and AWS_REGION environment variables.

retry_modeOptional

retry_mode: str
  • Type: str
(Optional) Specifies how retries are attempted. Valid values are standard and adaptive. Can also be configured using the AWS_RETRY_MODE environment variable or the shared config file parameter retry_mode.

role_arnOptional

  • Deprecated: Use assumeRole.roleArn instead.
role_arn: str
  • Type: str
(Optional) Amazon Resource Name (ARN) of the IAM Role to assume.

secret_keyOptional

secret_key: str
  • Type: str
(Optional) AWS secret access key. If configured, must also configure access_key. This can also be sourced from the AWS_SECRET_ACCESS_KEY environment variable, AWS shared credentials file (e.g. ~/.aws/credentials), or AWS shared configuration file (e.g. ~/.aws/config)

session_nameOptional

  • Deprecated: Use assumeRole.sessionName instead.
session_name: str
  • Type: str
(Optional) Session name to use when assuming the role.

shared_config_filesOptional

shared_config_files: typing.List[str]
  • Type: typing.List[str]
(Optional) List of paths to AWS shared configuration files. Defaults to ~/.aws/config.

shared_credentials_fileOptional

shared_credentials_file: str
  • Type: str
(Optional) Path to the AWS shared credentials file. Defaults to ~/.aws/credentials.

shared_credentials_filesOptional

shared_credentials_files: typing.List[str]
  • Type: typing.List[str]
(Optional) List of paths to AWS shared credentials files. Defaults to ~/.aws/credentials.

skip_credentials_validationOptional

skip_credentials_validation: bool
  • Type: bool
(Optional) Skip credentials validation via the STS API.

skip_metadata_api_checkOptional

skip_metadata_api_check: bool
  • Type: bool
(Optional) Skip usage of EC2 Metadata API.

skip_region_validationOptional

skip_region_validation: bool
  • Type: bool
(Optional) Skip validation of provided region name.

skip_requesting_account_idOptional

skip_requesting_account_id: bool
  • Type: bool
(Optional) Whether to skip requesting the account ID. Useful for AWS API implementations that do not have the IAM, STS API, or metadata API.

skip_s3_checksumOptional

skip_s3_checksum: bool
  • Type: bool
(Optional) Do not include checksum when uploading S3 Objects. Useful for some S3-Compatible APIs.

sse_customer_keyOptional

sse_customer_key: str
  • Type: str
(Optional) The key to use for encrypting state with Server-Side Encryption with Customer-Provided Keys (SSE-C). This is the base64-encoded value of the key, which must decode to 256 bits. This can also be sourced from the AWS_SSE_CUSTOMER_KEY environment variable, which is recommended due to the sensitivity of the value. Setting it inside a terraform file will cause it to be persisted to disk in terraform.tfstate.

sts_endpointOptional

  • Deprecated: Use endpoints.sts instead
sts_endpoint: str
  • Type: str
(Optional) Custom endpoint for the AWS Security Token Service (STS) API. This can also be sourced from the AWS_STS_ENDPOINT environment variable.

sts_regionOptional

sts_region: str
  • Type: str
(Optional) AWS region for STS. If unset, AWS will use the same region for STS as other non-STS operations.

tokenOptional

token: str
  • Type: str
(Optional) Multi-Factor Authentication (MFA) token. This can also be sourced from the AWS_SESSION_TOKEN environment variable.

use_legacy_workflowOptional

use_legacy_workflow: bool
  • Type: bool
(Optional) Use the legacy authentication workflow, preferring environment variables over backend configuration. Defaults to true. This behavior does not align with the authentication flow of the AWS CLI or SDK’s, and will be removed in the future.

use_path_styleOptional

use_path_style: bool
  • Type: bool
(Optional) Enable path-style S3 URLs (https://< HOST >/< BUCKET > instead of https://< BUCKET >.< HOST >).

workspace_key_prefixOptional

workspace_key_prefix: str
  • Type: str
(Optional) Prefix applied to the state path inside the bucket. This is only relevant when using a non-default workspace. Defaults to env: