Class GcsBackend.Builder

java.lang.Object
com.hashicorp.cdktf.GcsBackend.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<GcsBackend>
Enclosing class:
GcsBackend

@Stability(Experimental) public static final class GcsBackend.Builder extends Object implements software.amazon.jsii.Builder<GcsBackend>
(experimental) A fluent builder for GcsBackend.
  • Method Details

    • create

      @Stability(Experimental) public static GcsBackend.Builder create(software.constructs.Construct scope)
      Parameters:
      scope - This parameter is required.
      Returns:
      a new instance of GcsBackend.Builder.
    • bucket

      @Stability(Experimental) public GcsBackend.Builder bucket(String bucket)
      (experimental) (Required) The name of the GCS bucket.

      This name must be globally unique.

      Parameters:
      bucket - (Required) The name of the GCS bucket. This parameter is required.
      Returns:
      this
    • accessToken

      @Stability(Experimental) public GcsBackend.Builder accessToken(String accessToken)
      (experimental) (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.

      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. This parameter is required.
      Returns:
      this
    • credentials

      @Stability(Experimental) public GcsBackend.Builder credentials(String credentials)
      (experimental) (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.

      Parameters:
      credentials - (Optional) Local path to Google Cloud Platform account credentials in JSON format. This parameter is required.
      Returns:
      this
    • encryptionKey

      @Stability(Experimental) public GcsBackend.Builder encryptionKey(String encryptionKey)
      (experimental) (Optional) A 32 byte base64 encoded 'customer supplied encryption key' used to encrypt all state.

      Parameters:
      encryptionKey - (Optional) A 32 byte base64 encoded 'customer supplied encryption key' used to encrypt all state. This parameter is required.
      Returns:
      this
    • impersonateServiceAccount

      @Stability(Experimental) public GcsBackend.Builder impersonateServiceAccount(String impersonateServiceAccount)
      (experimental) (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.

      Parameters:
      impersonateServiceAccount - (Optional) The service account to impersonate for accessing the State Bucket. This parameter is required.
      Returns:
      this
    • impersonateServiceAccountDelegates

      @Stability(Experimental) public GcsBackend.Builder impersonateServiceAccountDelegates(List<String> impersonateServiceAccountDelegates)
      (experimental) (Optional) The delegation chain for an impersonating a service account.

      Parameters:
      impersonateServiceAccountDelegates - (Optional) The delegation chain for an impersonating a service account. This parameter is required.
      Returns:
      this
    • prefix

      @Stability(Experimental) public GcsBackend.Builder prefix(String prefix)
      (experimental) (Optional) GCS prefix inside the bucket.

      Named states for workspaces are stored in an object called /.tfstate.

      Parameters:
      prefix - (Optional) GCS prefix inside the bucket. This parameter is required.
      Returns:
      this
    • build

      @Stability(Experimental) public GcsBackend build()
      Specified by:
      build in interface software.amazon.jsii.Builder<GcsBackend>
      Returns:
      a newly built instance of GcsBackend.