Package com.hashicorp.cdktf
Class GcsBackendConfig.Builder
java.lang.Object
com.hashicorp.cdktf.GcsBackendConfig.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<GcsBackendConfig>
- Enclosing interface:
GcsBackendConfig
@Stability(Experimental)
public static final class GcsBackendConfig.Builder
extends Object
implements software.amazon.jsii.Builder<GcsBackendConfig>
A builder for
GcsBackendConfig
-
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()
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()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
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
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
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
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 GcsBackendConfig.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 GcsBackendConfig.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
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 GcsBackendConfig.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<GcsBackendConfig>
- Returns:
- a new instance of
GcsBackendConfig
- Throws:
NullPointerException
- if any required attribute was not provided
-