Package com.hashicorp.cdktf
Class DataTerraformRemoteStateS3Config.Builder
java.lang.Object
com.hashicorp.cdktf.DataTerraformRemoteStateS3Config.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<DataTerraformRemoteStateS3Config>
- Enclosing interface:
DataTerraformRemoteStateS3Config
@Stability(Experimental)
public static final class DataTerraformRemoteStateS3Config.Builder
extends Object
implements software.amazon.jsii.Builder<DataTerraformRemoteStateS3Config>
A builder for
DataTerraformRemoteStateS3Config
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets the value ofS3BackendConfig.getAccessKey()
Sets the value ofS3BackendConfig.getAcl()
assumeRolePolicy
(String assumeRolePolicy) Sets the value ofS3BackendConfig.getAssumeRolePolicy()
assumeRolePolicyArns
(List<String> assumeRolePolicyArns) Sets the value ofS3BackendConfig.getAssumeRolePolicyArns()
assumeRoleTags
(Map<String, String> assumeRoleTags) Sets the value ofS3BackendConfig.getAssumeRoleTags()
assumeRoleTransitiveTagKeys
(List<String> assumeRoleTransitiveTagKeys) Sets the value ofS3BackendConfig.getAssumeRoleTransitiveTagKeys()
Sets the value ofS3BackendConfig.getBucket()
build()
Builds the configured instance.Sets the value ofDataTerraformRemoteStateConfig.getDefaults()
dynamodbEndpoint
(String dynamodbEndpoint) Sets the value ofS3BackendConfig.getDynamodbEndpoint()
dynamodbTable
(String dynamodbTable) Sets the value ofS3BackendConfig.getDynamodbTable()
Sets the value ofS3BackendConfig.getEncrypt()
Sets the value ofS3BackendConfig.getEndpoint()
externalId
(String externalId) Sets the value ofS3BackendConfig.getExternalId()
forcePathStyle
(Boolean forcePathStyle) Sets the value ofS3BackendConfig.getForcePathStyle()
iamEndpoint
(String iamEndpoint) Sets the value ofS3BackendConfig.getIamEndpoint()
Sets the value ofS3BackendConfig.getKey()
Sets the value ofS3BackendConfig.getKmsKeyId()
maxRetries
(Number maxRetries) Sets the value ofS3BackendConfig.getMaxRetries()
Sets the value ofS3BackendConfig.getProfile()
Sets the value ofS3BackendConfig.getRegion()
Sets the value ofS3BackendConfig.getRoleArn()
Sets the value ofS3BackendConfig.getSecretKey()
sessionName
(String sessionName) Sets the value ofS3BackendConfig.getSessionName()
sharedCredentialsFile
(String sharedCredentialsFile) Sets the value ofS3BackendConfig.getSharedCredentialsFile()
skipCredentialsValidation
(Boolean skipCredentialsValidation) Sets the value ofS3BackendConfig.getSkipCredentialsValidation()
skipMetadataApiCheck
(Boolean skipMetadataApiCheck) Sets the value ofS3BackendConfig.getSkipMetadataApiCheck()
skipRegionValidation
(Boolean skipRegionValidation) Sets the value ofS3BackendConfig.getSkipRegionValidation()
sseCustomerKey
(String sseCustomerKey) Sets the value ofS3BackendConfig.getSseCustomerKey()
stsEndpoint
(String stsEndpoint) Sets the value ofS3BackendConfig.getStsEndpoint()
Sets the value ofS3BackendConfig.getToken()
Sets the value ofDataTerraformRemoteStateConfig.getWorkspace()
workspaceKeyPrefix
(String workspaceKeyPrefix) Sets the value ofS3BackendConfig.getWorkspaceKeyPrefix()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
defaults
@Stability(Experimental) public DataTerraformRemoteStateS3Config.Builder defaults(Map<String, ? extends Object> defaults) Sets the value ofDataTerraformRemoteStateConfig.getDefaults()
- Parameters:
defaults
- the value to be set.- Returns:
this
-
workspace
@Stability(Experimental) public DataTerraformRemoteStateS3Config.Builder workspace(String workspace) Sets the value ofDataTerraformRemoteStateConfig.getWorkspace()
- Parameters:
workspace
- the value to be set.- Returns:
this
-
bucket
Sets the value ofS3BackendConfig.getBucket()
- Parameters:
bucket
- Name of the S3 Bucket. This parameter is required.- Returns:
this
-
key
Sets the value ofS3BackendConfig.getKey()
- Parameters:
key
- Path to the state file inside the S3 Bucket. This parameter is required. When using a non-default workspace, the state path will be /workspace_key_prefix/workspace_name/key- Returns:
this
-
accessKey
@Stability(Experimental) public DataTerraformRemoteStateS3Config.Builder accessKey(String accessKey) Sets the value ofS3BackendConfig.getAccessKey()
- Parameters:
accessKey
- (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).- Returns:
this
-
acl
Sets the value ofS3BackendConfig.getAcl()
- Parameters:
acl
- (Optional) Canned ACL to be applied to the state file.- Returns:
this
-
assumeRolePolicy
@Stability(Experimental) public DataTerraformRemoteStateS3Config.Builder assumeRolePolicy(String assumeRolePolicy) Sets the value ofS3BackendConfig.getAssumeRolePolicy()
- Parameters:
assumeRolePolicy
- (Optional) IAM Policy JSON describing further restricting permissions for the IAM Role being assumed.- Returns:
this
-
assumeRolePolicyArns
@Stability(Experimental) public DataTerraformRemoteStateS3Config.Builder assumeRolePolicyArns(List<String> assumeRolePolicyArns) Sets the value ofS3BackendConfig.getAssumeRolePolicyArns()
- Parameters:
assumeRolePolicyArns
- (Optional) Set of Amazon Resource Names (ARNs) of IAM Policies describing further restricting permissions for the IAM Role being assumed.- Returns:
this
-
assumeRoleTags
@Stability(Experimental) public DataTerraformRemoteStateS3Config.Builder assumeRoleTags(Map<String, String> assumeRoleTags) Sets the value ofS3BackendConfig.getAssumeRoleTags()
- Parameters:
assumeRoleTags
- (Optional) Map of assume role session tags.- Returns:
this
-
assumeRoleTransitiveTagKeys
@Stability(Experimental) public DataTerraformRemoteStateS3Config.Builder assumeRoleTransitiveTagKeys(List<String> assumeRoleTransitiveTagKeys) Sets the value ofS3BackendConfig.getAssumeRoleTransitiveTagKeys()
- Parameters:
assumeRoleTransitiveTagKeys
- (Optional) Set of assume role session tag keys to pass to any subsequent sessions.- Returns:
this
-
dynamodbEndpoint
@Stability(Experimental) public DataTerraformRemoteStateS3Config.Builder dynamodbEndpoint(String dynamodbEndpoint) Sets the value ofS3BackendConfig.getDynamodbEndpoint()
- Parameters:
dynamodbEndpoint
- (Optional) Custom endpoint for the AWS DynamoDB API. This can also be sourced from the AWS_DYNAMODB_ENDPOINT environment variable.- Returns:
this
-
dynamodbTable
@Stability(Experimental) public DataTerraformRemoteStateS3Config.Builder dynamodbTable(String dynamodbTable) Sets the value ofS3BackendConfig.getDynamodbTable()
- Parameters:
dynamodbTable
- (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.- Returns:
this
-
encrypt
Sets the value ofS3BackendConfig.getEncrypt()
- Parameters:
encrypt
- (Optional) Enable server side encryption of the state file.- Returns:
this
-
endpoint
Sets the value ofS3BackendConfig.getEndpoint()
- Parameters:
endpoint
- (Optional) Custom endpoint for the AWS S3 API. This can also be sourced from the AWS_S3_ENDPOINT environment variable.- Returns:
this
-
externalId
@Stability(Experimental) public DataTerraformRemoteStateS3Config.Builder externalId(String externalId) Sets the value ofS3BackendConfig.getExternalId()
- Parameters:
externalId
- (Optional) External identifier to use when assuming the role.- Returns:
this
-
forcePathStyle
@Stability(Experimental) public DataTerraformRemoteStateS3Config.Builder forcePathStyle(Boolean forcePathStyle) Sets the value ofS3BackendConfig.getForcePathStyle()
- Parameters:
forcePathStyle
- (Optional) Enable path-style S3 URLs (https:/// instead of https:// . ). - Returns:
this
-
iamEndpoint
@Stability(Experimental) public DataTerraformRemoteStateS3Config.Builder iamEndpoint(String iamEndpoint) Sets the value ofS3BackendConfig.getIamEndpoint()
- Parameters:
iamEndpoint
- (Optional) Custom endpoint for the AWS Identity and Access Management (IAM) API. This can also be sourced from the AWS_IAM_ENDPOINT environment variable.- Returns:
this
-
kmsKeyId
Sets the value ofS3BackendConfig.getKmsKeyId()
- Parameters:
kmsKeyId
- (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.- Returns:
this
-
maxRetries
@Stability(Experimental) public DataTerraformRemoteStateS3Config.Builder maxRetries(Number maxRetries) Sets the value ofS3BackendConfig.getMaxRetries()
- Parameters:
maxRetries
- (Optional) The maximum number of times an AWS API request is retried on retryable failure. Defaults to 5.- Returns:
this
-
profile
Sets the value ofS3BackendConfig.getProfile()
- 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.- Returns:
this
-
region
Sets the value ofS3BackendConfig.getRegion()
- Parameters:
region
- 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.- Returns:
this
-
roleArn
Sets the value ofS3BackendConfig.getRoleArn()
- Parameters:
roleArn
- (Optional) Amazon Resource Name (ARN) of the IAM Role to assume.- Returns:
this
-
secretKey
@Stability(Experimental) public DataTerraformRemoteStateS3Config.Builder secretKey(String secretKey) Sets the value ofS3BackendConfig.getSecretKey()
- Parameters:
secretKey
- (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)- Returns:
this
-
sessionName
@Stability(Experimental) public DataTerraformRemoteStateS3Config.Builder sessionName(String sessionName) Sets the value ofS3BackendConfig.getSessionName()
- Parameters:
sessionName
- (Optional) Session name to use when assuming the role.- Returns:
this
-
skipCredentialsValidation
@Stability(Experimental) public DataTerraformRemoteStateS3Config.Builder skipCredentialsValidation(Boolean skipCredentialsValidation) Sets the value ofS3BackendConfig.getSkipCredentialsValidation()
- Parameters:
skipCredentialsValidation
- (Optional) Skip credentials validation via the STS API.- Returns:
this
-
skipMetadataApiCheck
@Stability(Experimental) public DataTerraformRemoteStateS3Config.Builder skipMetadataApiCheck(Boolean skipMetadataApiCheck) Sets the value ofS3BackendConfig.getSkipMetadataApiCheck()
- Parameters:
skipMetadataApiCheck
- (Optional) Skip usage of EC2 Metadata API.- Returns:
this
-
skipRegionValidation
@Stability(Experimental) public DataTerraformRemoteStateS3Config.Builder skipRegionValidation(Boolean skipRegionValidation) Sets the value ofS3BackendConfig.getSkipRegionValidation()
- Parameters:
skipRegionValidation
- (Optional) Skip validation of provided region name.- Returns:
this
-
sseCustomerKey
@Stability(Experimental) public DataTerraformRemoteStateS3Config.Builder sseCustomerKey(String sseCustomerKey) Sets the value ofS3BackendConfig.getSseCustomerKey()
- Parameters:
sseCustomerKey
- (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.- Returns:
this
-
stsEndpoint
@Stability(Experimental) public DataTerraformRemoteStateS3Config.Builder stsEndpoint(String stsEndpoint) Sets the value ofS3BackendConfig.getStsEndpoint()
- Parameters:
stsEndpoint
- (Optional) Custom endpoint for the AWS Security Token Service (STS) API. This can also be sourced from the AWS_STS_ENDPOINT environment variable.- Returns:
this
-
token
Sets the value ofS3BackendConfig.getToken()
- Parameters:
token
- (Optional) Multi-Factor Authentication (MFA) token. This can also be sourced from the AWS_SESSION_TOKEN environment variable.- Returns:
this
-
workspaceKeyPrefix
@Stability(Experimental) public DataTerraformRemoteStateS3Config.Builder workspaceKeyPrefix(String workspaceKeyPrefix) Sets the value ofS3BackendConfig.getWorkspaceKeyPrefix()
- Parameters:
workspaceKeyPrefix
- (Optional) Prefix applied to the state path inside the bucket. This is only relevant when using a non-default workspace. Defaults to env:- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<DataTerraformRemoteStateS3Config>
- Returns:
- a new instance of
DataTerraformRemoteStateS3Config
- Throws:
NullPointerException
- if any required attribute was not provided
-