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 Details

    • Builder

      public Builder()
  • Method Details

    • bucket

      @Stability(Experimental) public GcsBackendConfig.Builder bucket(String bucket)
      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 GcsBackendConfig.Builder accessToken(String accessToken)
      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 GcsBackendConfig.Builder credentials(String credentials)
      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 GcsBackendConfig.Builder encryptionKey(String encryptionKey)
      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)
      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)
      Parameters:
      impersonateServiceAccountDelegates - (Optional) The delegation chain for an impersonating a service account.
      Returns:
      this
    • kmsEncryptionKey

      @Stability(Experimental) public GcsBackendConfig.Builder kmsEncryptionKey(String kmsEncryptionKey)
      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, see
      invalid @link
      {@link https://cloud.google.com/storage/docs/encryption/customer-managed-keys
      Customer-managed Encryption Keys}.
      Returns:
      this
    • prefix

      @Stability(Experimental) public GcsBackendConfig.Builder prefix(String prefix)
      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)
      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
      See here for more details}
      Returns:
      this
    • build

      @Stability(Experimental) public GcsBackendConfig build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<GcsBackendConfig>
      Returns:
      a new instance of GcsBackendConfig
      Throws:
      NullPointerException - if any required attribute was not provided