Class S3Backend.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<S3Backend>
- Enclosing class:
S3Backend
S3Backend
.-
Method Summary
Modifier and TypeMethodDescription(experimental) (Optional) AWS access key.(experimental) (Optional) Canned ACL to be applied to the state file.allowedAccountIds
(String allowedAccountIds) (experimental) (Optional) List of allowed AWS account IDs to prevent potential destruction of a live environment.assumeRole
(S3BackendAssumeRoleConfig assumeRole) (experimental) Assuming an IAM Role can be configured in two ways.assumeRolePolicy
(String assumeRolePolicy) Deprecated.Use assumeRole.policy instead.assumeRolePolicyArns
(List<String> assumeRolePolicyArns) Deprecated.Use assumeRole.policyArns instead.assumeRoleTags
(Map<String, String> assumeRoleTags) Deprecated.Use assumeRole.tags instead.assumeRoleTransitiveTagKeys
(List<String> assumeRoleTransitiveTagKeys) Deprecated.Use assumeRole.transitiveTagKeys instead.assumeRoleWithWebIdentity
(S3BackendAssumeRoleWithWebIdentityConfig assumeRoleWithWebIdentity) (experimental) Assume Role With Web Identity Configuration.(experimental) Name of the S3 Bucket.build()
static S3Backend.Builder
create
(software.constructs.Construct scope) customCaBundle
(String customCaBundle) (experimental) (Optional) File containing custom root and intermediate certificates.dynamodbEndpoint
(String dynamodbEndpoint) Deprecated.Use endpoints.dynamodb insteaddynamodbTable
(String dynamodbTable) (experimental) (Optional) Name of DynamoDB Table to use for state locking and consistency.ec2MetadataServiceEndpoint
(String ec2MetadataServiceEndpoint) (experimental) Optional) Custom endpoint URL for the EC2 Instance Metadata Service (IMDS) API.ec2MetadataServiceEndpointMode
(String ec2MetadataServiceEndpointMode) (experimental) (Optional) Mode to use in communicating with the metadata service.(experimental) (Optional) Enable server side encryption of the state file.Deprecated.Use endpoints.s3 insteadendpoints
(S3BackendEndpointConfig endpoints) (experimental) (Optional) The endpoint configuration block.externalId
(String externalId) Deprecated.Use assume_role.external_id instead.forbiddenAccountIds
(String forbiddenAccountIds) (experimental) (Optional) List of forbidden AWS account IDs to prevent potential destruction of a live environment.forcePathStyle
(Boolean forcePathStyle) Deprecated.Use usePathStyle instead(experimental) (Optional) URL of a proxy to use for HTTP requests when accessing the AWS API.httpsProxy
(String httpsProxy) (experimental) (Optional) URL of a proxy to use for HTTPS requests when accessing the AWS API.iamEndpoint
(String iamEndpoint) Deprecated.Use endpoints.iam instead(experimental) Optional) Whether to explicitly allow the backend to perform "insecure" SSL requests.(experimental) Path to the state file inside the S3 Bucket.(experimental) (Optional) Amazon Resource Name (ARN) of a Key Management Service (KMS) Key to use for encrypting the state.maxRetries
(Number maxRetries) (experimental) (Optional) The maximum number of times an AWS API request is retried on retryable failure.(experimental) (Optional) Comma-separated list of hosts that should not use HTTP or HTTPS proxies.(experimental) (Optional) Name of AWS profile in AWS shared credentials file (e.g.(experimental) AWS Region of the S3 Bucket and DynamoDB Table (if used).(experimental) (Optional) Specifies how retries are attempted.Deprecated.Use assumeRole.roleArn instead.(experimental) (Optional) AWS secret access key.sessionName
(String sessionName) Deprecated.Use assumeRole.sessionName instead.sharedConfigFiles
(List<String> sharedConfigFiles) (experimental) (Optional) List of paths to AWS shared configuration files.sharedCredentialsFile
(String sharedCredentialsFile) (experimental) (Optional) Path to the AWS shared credentials file.sharedCredentialsFiles
(List<String> sharedCredentialsFiles) (experimental) (Optional) List of paths to AWS shared credentials files.skipCredentialsValidation
(Boolean skipCredentialsValidation) (experimental) (Optional) Skip credentials validation via the STS API.skipMetadataApiCheck
(Boolean skipMetadataApiCheck) (experimental) (Optional) Skip usage of EC2 Metadata API.skipRegionValidation
(Boolean skipRegionValidation) (experimental) (Optional) Skip validation of provided region name.skipRequestingAccountId
(Boolean skipRequestingAccountId) (experimental) (Optional) Whether to skip requesting the account ID.skipS3Checksum
(Boolean skipS3Checksum) (experimental) (Optional) Do not include checksum when uploading S3 Objects.sseCustomerKey
(String sseCustomerKey) (experimental) (Optional) The key to use for encrypting state with Server-Side Encryption with Customer-Provided Keys (SSE-C).stsEndpoint
(String stsEndpoint) Deprecated.Use endpoints.sts instead(experimental) (Optional) AWS region for STS.(experimental) (Optional) Multi-Factor Authentication (MFA) token.useLegacyWorkflow
(Boolean useLegacyWorkflow) (experimental) (Optional) Use the legacy authentication workflow, preferring environment variables over backend configuration.usePathStyle
(Boolean usePathStyle) (experimental) (Optional) Enable path-style S3 URLs (https:/// instead of https:// . ). workspaceKeyPrefix
(String workspaceKeyPrefix) (experimental) (Optional) Prefix applied to the state path inside the bucket.
-
Method Details
-
create
@Stability(Experimental) public static S3Backend.Builder create(software.constructs.Construct scope) - Parameters:
scope
- This parameter is required.- Returns:
- a new instance of
S3Backend.Builder
.
-
bucket
(experimental) Name of the S3 Bucket.- Parameters:
bucket
- Name of the S3 Bucket. This parameter is required.- Returns:
this
-
key
(experimental) 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
- Parameters:
key
- Path to the state file inside the S3 Bucket. This parameter is required.- Returns:
this
-
accessKey
(experimental) (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).
- Parameters:
accessKey
- (Optional) AWS access key. This parameter is required.- Returns:
this
-
acl
(experimental) (Optional) Canned ACL to be applied to the state file.- Parameters:
acl
- (Optional) Canned ACL to be applied to the state file. This parameter is required.- Returns:
this
-
allowedAccountIds
(experimental) (Optional) List of allowed AWS account IDs to prevent potential destruction of a live environment.Conflicts with forbidden_account_ids.
- Parameters:
allowedAccountIds
- (Optional) List of allowed AWS account IDs to prevent potential destruction of a live environment. This parameter is required.- Returns:
this
-
assumeRole
(experimental) 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.
- Parameters:
assumeRole
- Assuming an IAM Role can be configured in two ways. This parameter is required.- Returns:
this
-
assumeRolePolicy
@Stability(Deprecated) @Deprecated public S3Backend.Builder assumeRolePolicy(String assumeRolePolicy) Deprecated.Use assumeRole.policy instead.(deprecated) (Optional) IAM Policy JSON describing further restricting permissions for the IAM Role being assumed.- Parameters:
assumeRolePolicy
- (Optional) IAM Policy JSON describing further restricting permissions for the IAM Role being assumed. This parameter is required.- Returns:
this
-
assumeRolePolicyArns
@Stability(Deprecated) @Deprecated public S3Backend.Builder assumeRolePolicyArns(List<String> assumeRolePolicyArns) Deprecated.Use assumeRole.policyArns instead.(deprecated) (Optional) Set of Amazon Resource Names (ARNs) of IAM Policies describing further restricting permissions for the IAM Role being assumed.- Parameters:
assumeRolePolicyArns
- (Optional) Set of Amazon Resource Names (ARNs) of IAM Policies describing further restricting permissions for the IAM Role being assumed. This parameter is required.- Returns:
this
-
assumeRoleTags
@Stability(Deprecated) @Deprecated public S3Backend.Builder assumeRoleTags(Map<String, String> assumeRoleTags) Deprecated.Use assumeRole.tags instead.(deprecated) (Optional) Map of assume role session tags.- Parameters:
assumeRoleTags
- (Optional) Map of assume role session tags. This parameter is required.- Returns:
this
-
assumeRoleTransitiveTagKeys
@Stability(Deprecated) @Deprecated public S3Backend.Builder assumeRoleTransitiveTagKeys(List<String> assumeRoleTransitiveTagKeys) Deprecated.Use assumeRole.transitiveTagKeys instead.(deprecated) (Optional) Set of assume role session tag keys to pass to any subsequent sessions.- Parameters:
assumeRoleTransitiveTagKeys
- (Optional) Set of assume role session tag keys to pass to any subsequent sessions. This parameter is required.- Returns:
this
-
assumeRoleWithWebIdentity
@Stability(Experimental) public S3Backend.Builder assumeRoleWithWebIdentity(S3BackendAssumeRoleWithWebIdentityConfig assumeRoleWithWebIdentity) (experimental) Assume Role With Web Identity Configuration.- Parameters:
assumeRoleWithWebIdentity
- Assume Role With Web Identity Configuration. This parameter is required.- Returns:
this
-
customCaBundle
(experimental) (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.
- Parameters:
customCaBundle
- (Optional) File containing custom root and intermediate certificates. This parameter is required.- Returns:
this
-
dynamodbEndpoint
@Stability(Deprecated) @Deprecated public S3Backend.Builder dynamodbEndpoint(String dynamodbEndpoint) Deprecated.Use endpoints.dynamodb instead(deprecated) (Optional) Custom endpoint for the AWS DynamoDB API.This can also be sourced from the AWS_DYNAMODB_ENDPOINT environment variable.
- Parameters:
dynamodbEndpoint
- (Optional) Custom endpoint for the AWS DynamoDB API. This parameter is required.- Returns:
this
-
dynamodbTable
(experimental) (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.
- Parameters:
dynamodbTable
- (Optional) Name of DynamoDB Table to use for state locking and consistency. This parameter is required.- Returns:
this
-
ec2MetadataServiceEndpoint
@Stability(Experimental) public S3Backend.Builder ec2MetadataServiceEndpoint(String ec2MetadataServiceEndpoint) (experimental) 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.
- Parameters:
ec2MetadataServiceEndpoint
- Optional) Custom endpoint URL for the EC2 Instance Metadata Service (IMDS) API. This parameter is required.- Returns:
this
-
ec2MetadataServiceEndpointMode
@Stability(Experimental) public S3Backend.Builder ec2MetadataServiceEndpointMode(String ec2MetadataServiceEndpointMode) (experimental) (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.
- Parameters:
ec2MetadataServiceEndpointMode
- (Optional) Mode to use in communicating with the metadata service. This parameter is required.- Returns:
this
-
encrypt
(experimental) (Optional) Enable server side encryption of the state file.- Parameters:
encrypt
- (Optional) Enable server side encryption of the state file. This parameter is required.- Returns:
this
-
endpoint
Deprecated.Use endpoints.s3 instead(deprecated) (Optional) Custom endpoint for the AWS S3 API.This can also be sourced from the AWS_S3_ENDPOINT environment variable.
- Parameters:
endpoint
- (Optional) Custom endpoint for the AWS S3 API. This parameter is required.- Returns:
this
-
endpoints
(experimental) (Optional) The endpoint configuration block.- Parameters:
endpoints
- (Optional) The endpoint configuration block. This parameter is required.- Returns:
this
-
externalId
Deprecated.Use assume_role.external_id instead.(deprecated) (Optional) External identifier to use when assuming the role.- Parameters:
externalId
- (Optional) External identifier to use when assuming the role. This parameter is required.- Returns:
this
-
forbiddenAccountIds
(experimental) (Optional) List of forbidden AWS account IDs to prevent potential destruction of a live environment.Conflicts with allowed_account_ids.
- Parameters:
forbiddenAccountIds
- (Optional) List of forbidden AWS account IDs to prevent potential destruction of a live environment. This parameter is required.- Returns:
this
-
forcePathStyle
Deprecated.Use usePathStyle instead(deprecated) (Optional) Enable path-style S3 URLs (https:/// instead of https:// . ). - Parameters:
forcePathStyle
- (Optional) Enable path-style S3 URLs (https:/// instead of https:// . ). This parameter is required. - Returns:
this
-
httpProxy
(experimental) (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.
- Parameters:
httpProxy
- (Optional) URL of a proxy to use for HTTP requests when accessing the AWS API. This parameter is required.- Returns:
this
-
httpsProxy
(experimental) (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.
- Parameters:
httpsProxy
- (Optional) URL of a proxy to use for HTTPS requests when accessing the AWS API. This parameter is required.- Returns:
this
-
iamEndpoint
Deprecated.Use endpoints.iam instead(deprecated) (Optional) Custom endpoint for the AWS Identity and Access Management (IAM) API.This can also be sourced from the AWS_IAM_ENDPOINT environment variable.
- Parameters:
iamEndpoint
- (Optional) Custom endpoint for the AWS Identity and Access Management (IAM) API. This parameter is required.- Returns:
this
-
insecure
(experimental) Optional) Whether to explicitly allow the backend to perform "insecure" SSL requests.If omitted, the default value is false.
- Parameters:
insecure
- Optional) Whether to explicitly allow the backend to perform "insecure" SSL requests. This parameter is required.- Returns:
this
-
kmsKeyId
(experimental) (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.
- Parameters:
kmsKeyId
- (Optional) Amazon Resource Name (ARN) of a Key Management Service (KMS) Key to use for encrypting the state. This parameter is required.- Returns:
this
-
maxRetries
(experimental) (Optional) The maximum number of times an AWS API request is retried on retryable failure.Defaults to 5.
- Parameters:
maxRetries
- (Optional) The maximum number of times an AWS API request is retried on retryable failure. This parameter is required.- Returns:
this
-
noProxy
(experimental) (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.
- Parameters:
noProxy
- (Optional) Comma-separated list of hosts that should not use HTTP or HTTPS proxies. This parameter is required.- Returns:
this
-
profile
(experimental) (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.- Parameters:
profile
- (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. This parameter is required.- Returns:
this
-
region
(experimental) 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.
- Parameters:
region
- AWS Region of the S3 Bucket and DynamoDB Table (if used). This parameter is required.- Returns:
this
-
retryMode
(experimental) (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.
- Parameters:
retryMode
- (Optional) Specifies how retries are attempted. This parameter is required.- Returns:
this
-
roleArn
Deprecated.Use assumeRole.roleArn instead.(deprecated) (Optional) Amazon Resource Name (ARN) of the IAM Role to assume.- Parameters:
roleArn
- (Optional) Amazon Resource Name (ARN) of the IAM Role to assume. This parameter is required.- Returns:
this
-
secretKey
(experimental) (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)
- Parameters:
secretKey
- (Optional) AWS secret access key. This parameter is required.- Returns:
this
-
sessionName
Deprecated.Use assumeRole.sessionName instead.(deprecated) (Optional) Session name to use when assuming the role.- Parameters:
sessionName
- (Optional) Session name to use when assuming the role. This parameter is required.- Returns:
this
-
skipCredentialsValidation
@Stability(Experimental) public S3Backend.Builder skipCredentialsValidation(Boolean skipCredentialsValidation) (experimental) (Optional) Skip credentials validation via the STS API.- Parameters:
skipCredentialsValidation
- (Optional) Skip credentials validation via the STS API. This parameter is required.- Returns:
this
-
skipMetadataApiCheck
@Stability(Experimental) public S3Backend.Builder skipMetadataApiCheck(Boolean skipMetadataApiCheck) (experimental) (Optional) Skip usage of EC2 Metadata API.- Parameters:
skipMetadataApiCheck
- (Optional) Skip usage of EC2 Metadata API. This parameter is required.- Returns:
this
-
skipRegionValidation
@Stability(Experimental) public S3Backend.Builder skipRegionValidation(Boolean skipRegionValidation) (experimental) (Optional) Skip validation of provided region name.- Parameters:
skipRegionValidation
- (Optional) Skip validation of provided region name. This parameter is required.- Returns:
this
-
skipRequestingAccountId
@Stability(Experimental) public S3Backend.Builder skipRequestingAccountId(Boolean skipRequestingAccountId) (experimental) (Optional) Whether to skip requesting the account ID.Useful for AWS API implementations that do not have the IAM, STS API, or metadata API.
- Parameters:
skipRequestingAccountId
- (Optional) Whether to skip requesting the account ID. This parameter is required.- Returns:
this
-
skipS3Checksum
(experimental) (Optional) Do not include checksum when uploading S3 Objects.Useful for some S3-Compatible APIs.
- Parameters:
skipS3Checksum
- (Optional) Do not include checksum when uploading S3 Objects. This parameter is required.- Returns:
this
-
sseCustomerKey
(experimental) (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.
- Parameters:
sseCustomerKey
- (Optional) The key to use for encrypting state with Server-Side Encryption with Customer-Provided Keys (SSE-C). This parameter is required.- Returns:
this
-
stsEndpoint
Deprecated.Use endpoints.sts instead(deprecated) (Optional) Custom endpoint for the AWS Security Token Service (STS) API.This can also be sourced from the AWS_STS_ENDPOINT environment variable.
- Parameters:
stsEndpoint
- (Optional) Custom endpoint for the AWS Security Token Service (STS) API. This parameter is required.- Returns:
this
-
stsRegion
(experimental) (Optional) AWS region for STS.If unset, AWS will use the same region for STS as other non-STS operations.
- Parameters:
stsRegion
- (Optional) AWS region for STS. This parameter is required.- Returns:
this
-
token
(experimental) (Optional) Multi-Factor Authentication (MFA) token.This can also be sourced from the AWS_SESSION_TOKEN environment variable.
- Parameters:
token
- (Optional) Multi-Factor Authentication (MFA) token. This parameter is required.- Returns:
this
-
useLegacyWorkflow
(experimental) (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.
- Parameters:
useLegacyWorkflow
- (Optional) Use the legacy authentication workflow, preferring environment variables over backend configuration. This parameter is required.- Returns:
this
-
usePathStyle
(experimental) (Optional) Enable path-style S3 URLs (https:/// instead of https:// . ). - Parameters:
usePathStyle
- (Optional) Enable path-style S3 URLs (https:/// instead of https:// . ). This parameter is required. - Returns:
this
-
workspaceKeyPrefix
(experimental) (Optional) Prefix applied to the state path inside the bucket.This is only relevant when using a non-default workspace. Defaults to env:
- Parameters:
workspaceKeyPrefix
- (Optional) Prefix applied to the state path inside the bucket. This parameter is required.- Returns:
this
-
build
-