com.hashicorp.cdktf.GcsBackend Maven / Gradle / Ivy
Show all versions of cdktf Show documentation
package com.hashicorp.cdktf;
/**
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.102.0 (build e354887)", date = "2024-09-23T09:16:37.023Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = com.hashicorp.cdktf.$Module.class, fqn = "cdktf.GcsBackend")
public class GcsBackend extends com.hashicorp.cdktf.TerraformBackend {
protected GcsBackend(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected GcsBackend(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* @param scope This parameter is required.
* @param props This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public GcsBackend(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull com.hashicorp.cdktf.GcsBackendConfig props) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(props, "props is required") });
}
/**
* (experimental) Creates a TerraformRemoteState resource that accesses this backend.
*
* @param scope This parameter is required.
* @param name This parameter is required.
* @param _fromStack This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public @org.jetbrains.annotations.NotNull com.hashicorp.cdktf.TerraformRemoteState getRemoteStateDataSource(final @org.jetbrains.annotations.NotNull software.constructs.Construct scope, final @org.jetbrains.annotations.NotNull java.lang.String name, final @org.jetbrains.annotations.NotNull java.lang.String _fromStack) {
return software.amazon.jsii.Kernel.call(this, "getRemoteStateDataSource", software.amazon.jsii.NativeType.forClass(com.hashicorp.cdktf.TerraformRemoteState.class), new Object[] { java.util.Objects.requireNonNull(scope, "scope is required"), java.util.Objects.requireNonNull(name, "name is required"), java.util.Objects.requireNonNull(_fromStack, "_fromStack is required") });
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
protected @org.jetbrains.annotations.NotNull java.util.Map synthesizeAttributes() {
return java.util.Collections.unmodifiableMap(software.amazon.jsii.Kernel.call(this, "synthesizeAttributes", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(java.lang.Object.class))));
}
/**
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
protected @org.jetbrains.annotations.NotNull java.util.Map synthesizeHclAttributes() {
return java.util.Collections.unmodifiableMap(software.amazon.jsii.Kernel.call(this, "synthesizeHclAttributes", software.amazon.jsii.NativeType.mapOf(software.amazon.jsii.NativeType.forClass(java.lang.Object.class))));
}
/**
* (experimental) A fluent builder for {@link com.hashicorp.cdktf.GcsBackend}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static final class Builder implements software.amazon.jsii.Builder {
/**
* @return a new instance of {@link Builder}.
* @param scope This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static Builder create(final software.constructs.Construct scope) {
return new Builder(scope);
}
private final software.constructs.Construct scope;
private final com.hashicorp.cdktf.GcsBackendConfig.Builder props;
private Builder(final software.constructs.Construct scope) {
this.scope = scope;
this.props = new com.hashicorp.cdktf.GcsBackendConfig.Builder();
}
/**
* (experimental) (Required) The name of the GCS bucket.
*
* This name must be globally unique.
*
* @return {@code this}
* @param bucket (Required) The name of the GCS bucket. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder bucket(final java.lang.String bucket) {
this.props.bucket(bucket);
return this;
}
/**
* (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.
*
* @return {@code this}
* @param 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.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder accessToken(final java.lang.String accessToken) {
this.props.accessToken(accessToken);
return this;
}
/**
* (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.
*
* @return {@code this}
* @param credentials (Optional) Local path to Google Cloud Platform account credentials in JSON format. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder credentials(final java.lang.String credentials) {
this.props.credentials(credentials);
return this;
}
/**
* (experimental) (Optional) A 32 byte base64 encoded 'customer supplied encryption key' used to encrypt all state.
*
* @return {@code this}
* @param encryptionKey (Optional) A 32 byte base64 encoded 'customer supplied encryption key' used to encrypt all state. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder encryptionKey(final java.lang.String encryptionKey) {
this.props.encryptionKey(encryptionKey);
return this;
}
/**
* (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.
*
* @return {@code this}
* @param impersonateServiceAccount (Optional) The service account to impersonate for accessing the State Bucket. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder impersonateServiceAccount(final java.lang.String impersonateServiceAccount) {
this.props.impersonateServiceAccount(impersonateServiceAccount);
return this;
}
/**
* (experimental) (Optional) The delegation chain for an impersonating a service account.
*
* @return {@code this}
* @param impersonateServiceAccountDelegates (Optional) The delegation chain for an impersonating a service account. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder impersonateServiceAccountDelegates(final java.util.List impersonateServiceAccountDelegates) {
this.props.impersonateServiceAccountDelegates(impersonateServiceAccountDelegates);
return this;
}
/**
* (experimental) (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 {@link https://cloud.google.com/storage/docs/encryption/customer-managed-keys Customer-managed Encryption Keys}.
*
* @return {@code this}
* @param kmsEncryptionKey (Optional) A Cloud KMS key ('customer-managed encryption key') used when reading and writing state files in the bucket. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder kmsEncryptionKey(final java.lang.String kmsEncryptionKey) {
this.props.kmsEncryptionKey(kmsEncryptionKey);
return this;
}
/**
* (experimental) (Optional) GCS prefix inside the bucket.
*
* Named states for workspaces are stored in an object called /.tfstate.
*
* @return {@code this}
* @param prefix (Optional) GCS prefix inside the bucket. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder prefix(final java.lang.String prefix) {
this.props.prefix(prefix);
return this;
}
/**
* (experimental) (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).
*
* {@link https://developer.hashicorp.com/terraform/language/settings/backends/gcs#storage_custom_endpoint See here for more details}
*
* @return {@code this}
* @param 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). This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public Builder storeageCustomEndpoint(final java.lang.String storeageCustomEndpoint) {
this.props.storeageCustomEndpoint(storeageCustomEndpoint);
return this;
}
/**
* @return a newly built instance of {@link com.hashicorp.cdktf.GcsBackend}.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@Override
public com.hashicorp.cdktf.GcsBackend build() {
return new com.hashicorp.cdktf.GcsBackend(
this.scope,
this.props.build()
);
}
}
}