Package com.hashicorp.cdktf
Class DataTerraformRemoteStateGcsConfig.Builder
java.lang.Object
com.hashicorp.cdktf.DataTerraformRemoteStateGcsConfig.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<DataTerraformRemoteStateGcsConfig>
- Enclosing interface:
DataTerraformRemoteStateGcsConfig
@Stability(Experimental)
public static final class DataTerraformRemoteStateGcsConfig.Builder
extends Object
implements software.amazon.jsii.Builder<DataTerraformRemoteStateGcsConfig>
A builder for
DataTerraformRemoteStateGcsConfig
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaccessToken
(String accessToken) Sets the value ofGcsBackendConfig.getAccessToken()
Sets the value ofGcsBackendConfig.getBucket()
build()
Builds the configured instance.credentials
(String credentials) Sets the value ofGcsBackendConfig.getCredentials()
Sets the value ofDataTerraformRemoteStateConfig.getDefaults()
encryptionKey
(String encryptionKey) Sets the value ofGcsBackendConfig.getEncryptionKey()
impersonateServiceAccount
(String impersonateServiceAccount) Sets the value ofGcsBackendConfig.getImpersonateServiceAccount()
impersonateServiceAccountDelegates
(List<String> impersonateServiceAccountDelegates) Sets the value ofGcsBackendConfig.getImpersonateServiceAccountDelegates()
kmsEncryptionKey
(String kmsEncryptionKey) Sets the value ofGcsBackendConfig.getKmsEncryptionKey()
Sets the value ofGcsBackendConfig.getPrefix()
storeageCustomEndpoint
(String storeageCustomEndpoint) Sets the value ofGcsBackendConfig.getStoreageCustomEndpoint()
Sets the value ofDataTerraformRemoteStateConfig.getWorkspace()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
defaults
@Stability(Experimental) public DataTerraformRemoteStateGcsConfig.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 DataTerraformRemoteStateGcsConfig.Builder workspace(String workspace) Sets the value ofDataTerraformRemoteStateConfig.getWorkspace()
- Parameters:
workspace
- the value to be set.- Returns:
this
-
bucket
Sets the value ofGcsBackendConfig.getBucket()
- Parameters:
bucket
- (Required) The name of the GCS bucket. This parameter is required. This name must be globally unique.- Returns:
this
-
accessToken
@Stability(Experimental) public DataTerraformRemoteStateGcsConfig.Builder accessToken(String accessToken) Sets the value ofGcsBackendConfig.getAccessToken()
- Parameters:
accessToken
- (Optional) A temporary [OAuth 2.0 access token] obtained from the Google Authorization server, i.e. the Authorization: Bearer token used to authenticate HTTP requests to GCP APIs. This is an alternative to credentials. If both are specified, access_token will be used over the credentials field.- Returns:
this
-
credentials
@Stability(Experimental) public DataTerraformRemoteStateGcsConfig.Builder credentials(String credentials) Sets the value ofGcsBackendConfig.getCredentials()
- Parameters:
credentials
- (Optional) Local path to Google Cloud Platform account credentials in JSON format. If unset, Google Application Default Credentials are used. The provided credentials must have Storage Object Admin role on the bucket.Warning: if using the Google Cloud Platform provider as well, it will also pick up the GOOGLE_CREDENTIALS environment variable.
- Returns:
this
-
encryptionKey
@Stability(Experimental) public DataTerraformRemoteStateGcsConfig.Builder encryptionKey(String encryptionKey) Sets the value ofGcsBackendConfig.getEncryptionKey()
- Parameters:
encryptionKey
- (Optional) A 32 byte base64 encoded 'customer supplied encryption key' used to encrypt all state.- Returns:
this
-
impersonateServiceAccount
@Stability(Experimental) public DataTerraformRemoteStateGcsConfig.Builder impersonateServiceAccount(String impersonateServiceAccount) Sets the value ofGcsBackendConfig.getImpersonateServiceAccount()
- Parameters:
impersonateServiceAccount
- (Optional) The service account to impersonate for accessing the State Bucket. You must have roles/iam.serviceAccountTokenCreator role on that account for the impersonation to succeed. If you are using a delegation chain, you can specify that using the impersonate_service_account_delegates field. Alternatively, this can be specified using the GOOGLE_IMPERSONATE_SERVICE_ACCOUNT environment variable.- Returns:
this
-
impersonateServiceAccountDelegates
@Stability(Experimental) public DataTerraformRemoteStateGcsConfig.Builder impersonateServiceAccountDelegates(List<String> impersonateServiceAccountDelegates) Sets the value ofGcsBackendConfig.getImpersonateServiceAccountDelegates()
- Parameters:
impersonateServiceAccountDelegates
- (Optional) The delegation chain for an impersonating a service account.- Returns:
this
-
kmsEncryptionKey
@Stability(Experimental) public DataTerraformRemoteStateGcsConfig.Builder kmsEncryptionKey(String kmsEncryptionKey) Sets the value ofGcsBackendConfig.getKmsEncryptionKey()
- Parameters:
kmsEncryptionKey
- (Optional) A Cloud KMS key ('customer-managed encryption key') used when reading and writing state files in the bucket. Format should be projects/{{project}}/locations/{{location}}/keyRings/{{keyRing}}/cryptoKeys/{{name}}. For more information, including IAM requirements, seeinvalid @link
{@link https://cloud.google.com/storage/docs/encryption/customer-managed-keys
- Returns:
this
-
prefix
Sets the value ofGcsBackendConfig.getPrefix()
- Parameters:
prefix
- (Optional) GCS prefix inside the bucket. Named states for workspaces are stored in an object called/ .tfstate. - Returns:
this
-
storeageCustomEndpoint
@Stability(Experimental) public DataTerraformRemoteStateGcsConfig.Builder storeageCustomEndpoint(String storeageCustomEndpoint) Sets the value ofGcsBackendConfig.getStoreageCustomEndpoint()
- Parameters:
storeageCustomEndpoint
- (Optional) A URL containing three parts: the protocol, the DNS name pointing to a Private Service Connect endpoint, and the path for the Cloud Storage API (/storage/v1/b).invalid @link
{@link https://developer.hashicorp.com/terraform/language/settings/backends/gcs#storage_custom_endpoint
- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<DataTerraformRemoteStateGcsConfig>
- Returns:
- a new instance of
DataTerraformRemoteStateGcsConfig
- Throws:
NullPointerException
- if any required attribute was not provided
-