@cdktf/provider-google
Version:
Prebuilt google Provider for Terraform CDK (cdktf)
1,287 lines • 197 kB
JavaScript
"use strict";
var _a, _b, _c, _d, _e, _f, _g, _h;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ComputeDisk = exports.ComputeDiskTimeoutsOutputReference = exports.computeDiskTimeoutsToHclTerraform = exports.computeDiskTimeoutsToTerraform = exports.ComputeDiskSourceSnapshotEncryptionKeyOutputReference = exports.computeDiskSourceSnapshotEncryptionKeyToHclTerraform = exports.computeDiskSourceSnapshotEncryptionKeyToTerraform = exports.ComputeDiskSourceImageEncryptionKeyOutputReference = exports.computeDiskSourceImageEncryptionKeyToHclTerraform = exports.computeDiskSourceImageEncryptionKeyToTerraform = exports.ComputeDiskGuestOsFeaturesList = exports.ComputeDiskGuestOsFeaturesOutputReference = exports.computeDiskGuestOsFeaturesToHclTerraform = exports.computeDiskGuestOsFeaturesToTerraform = exports.ComputeDiskDiskEncryptionKeyOutputReference = exports.computeDiskDiskEncryptionKeyToHclTerraform = exports.computeDiskDiskEncryptionKeyToTerraform = exports.ComputeDiskAsyncPrimaryDiskOutputReference = exports.computeDiskAsyncPrimaryDiskToHclTerraform = exports.computeDiskAsyncPrimaryDiskToTerraform = void 0;
const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
const cdktf = require("cdktf");
function computeDiskAsyncPrimaryDiskToTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
return {
disk: cdktf.stringToTerraform(struct.disk),
};
}
exports.computeDiskAsyncPrimaryDiskToTerraform = computeDiskAsyncPrimaryDiskToTerraform;
function computeDiskAsyncPrimaryDiskToHclTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
const attrs = {
disk: {
value: cdktf.stringToHclTerraform(struct.disk),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.computeDiskAsyncPrimaryDiskToHclTerraform = computeDiskAsyncPrimaryDiskToHclTerraform;
class ComputeDiskAsyncPrimaryDiskOutputReference extends cdktf.ComplexObject {
/**
* @param terraformResource The parent resource
* @param terraformAttribute The attribute on the parent resource this class is referencing
*/
constructor(terraformResource, terraformAttribute) {
super(terraformResource, terraformAttribute, false, 0);
this.isEmptyObject = false;
}
get internalValue() {
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._disk !== undefined) {
hasAnyValues = true;
internalValueResult.disk = this._disk;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._disk = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._disk = value.disk;
}
}
get disk() {
return this.getStringAttribute('disk');
}
set disk(value) {
this._disk = value;
}
// Temporarily expose input value. Use with caution.
get diskInput() {
return this._disk;
}
}
exports.ComputeDiskAsyncPrimaryDiskOutputReference = ComputeDiskAsyncPrimaryDiskOutputReference;
_a = JSII_RTTI_SYMBOL_1;
ComputeDiskAsyncPrimaryDiskOutputReference[_a] = { fqn: "@cdktf/provider-google.computeDisk.ComputeDiskAsyncPrimaryDiskOutputReference", version: "14.12.0" };
function computeDiskDiskEncryptionKeyToTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
return {
kms_key_self_link: cdktf.stringToTerraform(struct.kmsKeySelfLink),
kms_key_service_account: cdktf.stringToTerraform(struct.kmsKeyServiceAccount),
raw_key: cdktf.stringToTerraform(struct.rawKey),
rsa_encrypted_key: cdktf.stringToTerraform(struct.rsaEncryptedKey),
};
}
exports.computeDiskDiskEncryptionKeyToTerraform = computeDiskDiskEncryptionKeyToTerraform;
function computeDiskDiskEncryptionKeyToHclTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
const attrs = {
kms_key_self_link: {
value: cdktf.stringToHclTerraform(struct.kmsKeySelfLink),
isBlock: false,
type: "simple",
storageClassType: "string",
},
kms_key_service_account: {
value: cdktf.stringToHclTerraform(struct.kmsKeyServiceAccount),
isBlock: false,
type: "simple",
storageClassType: "string",
},
raw_key: {
value: cdktf.stringToHclTerraform(struct.rawKey),
isBlock: false,
type: "simple",
storageClassType: "string",
},
rsa_encrypted_key: {
value: cdktf.stringToHclTerraform(struct.rsaEncryptedKey),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.computeDiskDiskEncryptionKeyToHclTerraform = computeDiskDiskEncryptionKeyToHclTerraform;
class ComputeDiskDiskEncryptionKeyOutputReference extends cdktf.ComplexObject {
/**
* @param terraformResource The parent resource
* @param terraformAttribute The attribute on the parent resource this class is referencing
*/
constructor(terraformResource, terraformAttribute) {
super(terraformResource, terraformAttribute, false, 0);
this.isEmptyObject = false;
}
get internalValue() {
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._kmsKeySelfLink !== undefined) {
hasAnyValues = true;
internalValueResult.kmsKeySelfLink = this._kmsKeySelfLink;
}
if (this._kmsKeyServiceAccount !== undefined) {
hasAnyValues = true;
internalValueResult.kmsKeyServiceAccount = this._kmsKeyServiceAccount;
}
if (this._rawKey !== undefined) {
hasAnyValues = true;
internalValueResult.rawKey = this._rawKey;
}
if (this._rsaEncryptedKey !== undefined) {
hasAnyValues = true;
internalValueResult.rsaEncryptedKey = this._rsaEncryptedKey;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._kmsKeySelfLink = undefined;
this._kmsKeyServiceAccount = undefined;
this._rawKey = undefined;
this._rsaEncryptedKey = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._kmsKeySelfLink = value.kmsKeySelfLink;
this._kmsKeyServiceAccount = value.kmsKeyServiceAccount;
this._rawKey = value.rawKey;
this._rsaEncryptedKey = value.rsaEncryptedKey;
}
}
get kmsKeySelfLink() {
return this.getStringAttribute('kms_key_self_link');
}
set kmsKeySelfLink(value) {
this._kmsKeySelfLink = value;
}
resetKmsKeySelfLink() {
this._kmsKeySelfLink = undefined;
}
// Temporarily expose input value. Use with caution.
get kmsKeySelfLinkInput() {
return this._kmsKeySelfLink;
}
get kmsKeyServiceAccount() {
return this.getStringAttribute('kms_key_service_account');
}
set kmsKeyServiceAccount(value) {
this._kmsKeyServiceAccount = value;
}
resetKmsKeyServiceAccount() {
this._kmsKeyServiceAccount = undefined;
}
// Temporarily expose input value. Use with caution.
get kmsKeyServiceAccountInput() {
return this._kmsKeyServiceAccount;
}
get rawKey() {
return this.getStringAttribute('raw_key');
}
set rawKey(value) {
this._rawKey = value;
}
resetRawKey() {
this._rawKey = undefined;
}
// Temporarily expose input value. Use with caution.
get rawKeyInput() {
return this._rawKey;
}
get rsaEncryptedKey() {
return this.getStringAttribute('rsa_encrypted_key');
}
set rsaEncryptedKey(value) {
this._rsaEncryptedKey = value;
}
resetRsaEncryptedKey() {
this._rsaEncryptedKey = undefined;
}
// Temporarily expose input value. Use with caution.
get rsaEncryptedKeyInput() {
return this._rsaEncryptedKey;
}
// sha256 - computed: true, optional: false, required: false
get sha256() {
return this.getStringAttribute('sha256');
}
}
exports.ComputeDiskDiskEncryptionKeyOutputReference = ComputeDiskDiskEncryptionKeyOutputReference;
_b = JSII_RTTI_SYMBOL_1;
ComputeDiskDiskEncryptionKeyOutputReference[_b] = { fqn: "@cdktf/provider-google.computeDisk.ComputeDiskDiskEncryptionKeyOutputReference", version: "14.12.0" };
function computeDiskGuestOsFeaturesToTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
return {
type: cdktf.stringToTerraform(struct.type),
};
}
exports.computeDiskGuestOsFeaturesToTerraform = computeDiskGuestOsFeaturesToTerraform;
function computeDiskGuestOsFeaturesToHclTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
const attrs = {
type: {
value: cdktf.stringToHclTerraform(struct.type),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.computeDiskGuestOsFeaturesToHclTerraform = computeDiskGuestOsFeaturesToHclTerraform;
class ComputeDiskGuestOsFeaturesOutputReference extends cdktf.ComplexObject {
/**
* @param terraformResource The parent resource
* @param terraformAttribute The attribute on the parent resource this class is referencing
* @param complexObjectIndex the index of this item in the list
* @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index)
*/
constructor(terraformResource, terraformAttribute, complexObjectIndex, complexObjectIsFromSet) {
super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex);
this.isEmptyObject = false;
}
get internalValue() {
if (this.resolvableValue) {
return this.resolvableValue;
}
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._type !== undefined) {
hasAnyValues = true;
internalValueResult.type = this._type;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this.resolvableValue = undefined;
this._type = undefined;
}
else if (cdktf.Tokenization.isResolvable(value)) {
this.isEmptyObject = false;
this.resolvableValue = value;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this.resolvableValue = undefined;
this._type = value.type;
}
}
get type() {
return this.getStringAttribute('type');
}
set type(value) {
this._type = value;
}
// Temporarily expose input value. Use with caution.
get typeInput() {
return this._type;
}
}
exports.ComputeDiskGuestOsFeaturesOutputReference = ComputeDiskGuestOsFeaturesOutputReference;
_c = JSII_RTTI_SYMBOL_1;
ComputeDiskGuestOsFeaturesOutputReference[_c] = { fqn: "@cdktf/provider-google.computeDisk.ComputeDiskGuestOsFeaturesOutputReference", version: "14.12.0" };
class ComputeDiskGuestOsFeaturesList extends cdktf.ComplexList {
/**
* @param terraformResource The parent resource
* @param terraformAttribute The attribute on the parent resource this class is referencing
* @param wrapsSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index)
*/
constructor(terraformResource, terraformAttribute, wrapsSet) {
super(terraformResource, terraformAttribute, wrapsSet);
this.terraformResource = terraformResource;
this.terraformAttribute = terraformAttribute;
this.wrapsSet = wrapsSet;
}
/**
* @param index the index of the item to return
*/
get(index) {
return new ComputeDiskGuestOsFeaturesOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);
}
}
exports.ComputeDiskGuestOsFeaturesList = ComputeDiskGuestOsFeaturesList;
_d = JSII_RTTI_SYMBOL_1;
ComputeDiskGuestOsFeaturesList[_d] = { fqn: "@cdktf/provider-google.computeDisk.ComputeDiskGuestOsFeaturesList", version: "14.12.0" };
function computeDiskSourceImageEncryptionKeyToTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
return {
kms_key_self_link: cdktf.stringToTerraform(struct.kmsKeySelfLink),
kms_key_service_account: cdktf.stringToTerraform(struct.kmsKeyServiceAccount),
raw_key: cdktf.stringToTerraform(struct.rawKey),
};
}
exports.computeDiskSourceImageEncryptionKeyToTerraform = computeDiskSourceImageEncryptionKeyToTerraform;
function computeDiskSourceImageEncryptionKeyToHclTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
const attrs = {
kms_key_self_link: {
value: cdktf.stringToHclTerraform(struct.kmsKeySelfLink),
isBlock: false,
type: "simple",
storageClassType: "string",
},
kms_key_service_account: {
value: cdktf.stringToHclTerraform(struct.kmsKeyServiceAccount),
isBlock: false,
type: "simple",
storageClassType: "string",
},
raw_key: {
value: cdktf.stringToHclTerraform(struct.rawKey),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.computeDiskSourceImageEncryptionKeyToHclTerraform = computeDiskSourceImageEncryptionKeyToHclTerraform;
class ComputeDiskSourceImageEncryptionKeyOutputReference extends cdktf.ComplexObject {
/**
* @param terraformResource The parent resource
* @param terraformAttribute The attribute on the parent resource this class is referencing
*/
constructor(terraformResource, terraformAttribute) {
super(terraformResource, terraformAttribute, false, 0);
this.isEmptyObject = false;
}
get internalValue() {
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._kmsKeySelfLink !== undefined) {
hasAnyValues = true;
internalValueResult.kmsKeySelfLink = this._kmsKeySelfLink;
}
if (this._kmsKeyServiceAccount !== undefined) {
hasAnyValues = true;
internalValueResult.kmsKeyServiceAccount = this._kmsKeyServiceAccount;
}
if (this._rawKey !== undefined) {
hasAnyValues = true;
internalValueResult.rawKey = this._rawKey;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._kmsKeySelfLink = undefined;
this._kmsKeyServiceAccount = undefined;
this._rawKey = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._kmsKeySelfLink = value.kmsKeySelfLink;
this._kmsKeyServiceAccount = value.kmsKeyServiceAccount;
this._rawKey = value.rawKey;
}
}
get kmsKeySelfLink() {
return this.getStringAttribute('kms_key_self_link');
}
set kmsKeySelfLink(value) {
this._kmsKeySelfLink = value;
}
resetKmsKeySelfLink() {
this._kmsKeySelfLink = undefined;
}
// Temporarily expose input value. Use with caution.
get kmsKeySelfLinkInput() {
return this._kmsKeySelfLink;
}
get kmsKeyServiceAccount() {
return this.getStringAttribute('kms_key_service_account');
}
set kmsKeyServiceAccount(value) {
this._kmsKeyServiceAccount = value;
}
resetKmsKeyServiceAccount() {
this._kmsKeyServiceAccount = undefined;
}
// Temporarily expose input value. Use with caution.
get kmsKeyServiceAccountInput() {
return this._kmsKeyServiceAccount;
}
get rawKey() {
return this.getStringAttribute('raw_key');
}
set rawKey(value) {
this._rawKey = value;
}
resetRawKey() {
this._rawKey = undefined;
}
// Temporarily expose input value. Use with caution.
get rawKeyInput() {
return this._rawKey;
}
// sha256 - computed: true, optional: false, required: false
get sha256() {
return this.getStringAttribute('sha256');
}
}
exports.ComputeDiskSourceImageEncryptionKeyOutputReference = ComputeDiskSourceImageEncryptionKeyOutputReference;
_e = JSII_RTTI_SYMBOL_1;
ComputeDiskSourceImageEncryptionKeyOutputReference[_e] = { fqn: "@cdktf/provider-google.computeDisk.ComputeDiskSourceImageEncryptionKeyOutputReference", version: "14.12.0" };
function computeDiskSourceSnapshotEncryptionKeyToTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
return {
kms_key_self_link: cdktf.stringToTerraform(struct.kmsKeySelfLink),
kms_key_service_account: cdktf.stringToTerraform(struct.kmsKeyServiceAccount),
raw_key: cdktf.stringToTerraform(struct.rawKey),
};
}
exports.computeDiskSourceSnapshotEncryptionKeyToTerraform = computeDiskSourceSnapshotEncryptionKeyToTerraform;
function computeDiskSourceSnapshotEncryptionKeyToHclTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
const attrs = {
kms_key_self_link: {
value: cdktf.stringToHclTerraform(struct.kmsKeySelfLink),
isBlock: false,
type: "simple",
storageClassType: "string",
},
kms_key_service_account: {
value: cdktf.stringToHclTerraform(struct.kmsKeyServiceAccount),
isBlock: false,
type: "simple",
storageClassType: "string",
},
raw_key: {
value: cdktf.stringToHclTerraform(struct.rawKey),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.computeDiskSourceSnapshotEncryptionKeyToHclTerraform = computeDiskSourceSnapshotEncryptionKeyToHclTerraform;
class ComputeDiskSourceSnapshotEncryptionKeyOutputReference extends cdktf.ComplexObject {
/**
* @param terraformResource The parent resource
* @param terraformAttribute The attribute on the parent resource this class is referencing
*/
constructor(terraformResource, terraformAttribute) {
super(terraformResource, terraformAttribute, false, 0);
this.isEmptyObject = false;
}
get internalValue() {
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._kmsKeySelfLink !== undefined) {
hasAnyValues = true;
internalValueResult.kmsKeySelfLink = this._kmsKeySelfLink;
}
if (this._kmsKeyServiceAccount !== undefined) {
hasAnyValues = true;
internalValueResult.kmsKeyServiceAccount = this._kmsKeyServiceAccount;
}
if (this._rawKey !== undefined) {
hasAnyValues = true;
internalValueResult.rawKey = this._rawKey;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._kmsKeySelfLink = undefined;
this._kmsKeyServiceAccount = undefined;
this._rawKey = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._kmsKeySelfLink = value.kmsKeySelfLink;
this._kmsKeyServiceAccount = value.kmsKeyServiceAccount;
this._rawKey = value.rawKey;
}
}
get kmsKeySelfLink() {
return this.getStringAttribute('kms_key_self_link');
}
set kmsKeySelfLink(value) {
this._kmsKeySelfLink = value;
}
resetKmsKeySelfLink() {
this._kmsKeySelfLink = undefined;
}
// Temporarily expose input value. Use with caution.
get kmsKeySelfLinkInput() {
return this._kmsKeySelfLink;
}
get kmsKeyServiceAccount() {
return this.getStringAttribute('kms_key_service_account');
}
set kmsKeyServiceAccount(value) {
this._kmsKeyServiceAccount = value;
}
resetKmsKeyServiceAccount() {
this._kmsKeyServiceAccount = undefined;
}
// Temporarily expose input value. Use with caution.
get kmsKeyServiceAccountInput() {
return this._kmsKeyServiceAccount;
}
get rawKey() {
return this.getStringAttribute('raw_key');
}
set rawKey(value) {
this._rawKey = value;
}
resetRawKey() {
this._rawKey = undefined;
}
// Temporarily expose input value. Use with caution.
get rawKeyInput() {
return this._rawKey;
}
// sha256 - computed: true, optional: false, required: false
get sha256() {
return this.getStringAttribute('sha256');
}
}
exports.ComputeDiskSourceSnapshotEncryptionKeyOutputReference = ComputeDiskSourceSnapshotEncryptionKeyOutputReference;
_f = JSII_RTTI_SYMBOL_1;
ComputeDiskSourceSnapshotEncryptionKeyOutputReference[_f] = { fqn: "@cdktf/provider-google.computeDisk.ComputeDiskSourceSnapshotEncryptionKeyOutputReference", version: "14.12.0" };
function computeDiskTimeoutsToTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
return {
create: cdktf.stringToTerraform(struct.create),
delete: cdktf.stringToTerraform(struct.delete),
update: cdktf.stringToTerraform(struct.update),
};
}
exports.computeDiskTimeoutsToTerraform = computeDiskTimeoutsToTerraform;
function computeDiskTimeoutsToHclTerraform(struct) {
if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) {
return struct;
}
if (cdktf.isComplexElement(struct)) {
throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration");
}
const attrs = {
create: {
value: cdktf.stringToHclTerraform(struct.create),
isBlock: false,
type: "simple",
storageClassType: "string",
},
delete: {
value: cdktf.stringToHclTerraform(struct.delete),
isBlock: false,
type: "simple",
storageClassType: "string",
},
update: {
value: cdktf.stringToHclTerraform(struct.update),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.computeDiskTimeoutsToHclTerraform = computeDiskTimeoutsToHclTerraform;
class ComputeDiskTimeoutsOutputReference extends cdktf.ComplexObject {
/**
* @param terraformResource The parent resource
* @param terraformAttribute The attribute on the parent resource this class is referencing
*/
constructor(terraformResource, terraformAttribute) {
super(terraformResource, terraformAttribute, false);
this.isEmptyObject = false;
}
get internalValue() {
if (this.resolvableValue) {
return this.resolvableValue;
}
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._create !== undefined) {
hasAnyValues = true;
internalValueResult.create = this._create;
}
if (this._delete !== undefined) {
hasAnyValues = true;
internalValueResult.delete = this._delete;
}
if (this._update !== undefined) {
hasAnyValues = true;
internalValueResult.update = this._update;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this.resolvableValue = undefined;
this._create = undefined;
this._delete = undefined;
this._update = undefined;
}
else if (cdktf.Tokenization.isResolvable(value)) {
this.isEmptyObject = false;
this.resolvableValue = value;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this.resolvableValue = undefined;
this._create = value.create;
this._delete = value.delete;
this._update = value.update;
}
}
get create() {
return this.getStringAttribute('create');
}
set create(value) {
this._create = value;
}
resetCreate() {
this._create = undefined;
}
// Temporarily expose input value. Use with caution.
get createInput() {
return this._create;
}
get delete() {
return this.getStringAttribute('delete');
}
set delete(value) {
this._delete = value;
}
resetDelete() {
this._delete = undefined;
}
// Temporarily expose input value. Use with caution.
get deleteInput() {
return this._delete;
}
get update() {
return this.getStringAttribute('update');
}
set update(value) {
this._update = value;
}
resetUpdate() {
this._update = undefined;
}
// Temporarily expose input value. Use with caution.
get updateInput() {
return this._update;
}
}
exports.ComputeDiskTimeoutsOutputReference = ComputeDiskTimeoutsOutputReference;
_g = JSII_RTTI_SYMBOL_1;
ComputeDiskTimeoutsOutputReference[_g] = { fqn: "@cdktf/provider-google.computeDisk.ComputeDiskTimeoutsOutputReference", version: "14.12.0" };
/**
* Represents a {@link https://registry.terraform.io/providers/hashicorp/google/6.13.0/docs/resources/compute_disk google_compute_disk}
*/
class ComputeDisk extends cdktf.TerraformResource {
// ==============
// STATIC Methods
// ==============
/**
* Generates CDKTF code for importing a ComputeDisk resource upon running "cdktf plan <stack-name>"
* @param scope The scope in which to define this construct
* @param importToId The construct id used in the generated config for the ComputeDisk to import
* @param importFromId The id of the existing ComputeDisk that should be imported. Refer to the {@link https://registry.terraform.io/providers/hashicorp/google/6.13.0/docs/resources/compute_disk#import import section} in the documentation of this resource for the id to use
* @param provider? Optional instance of the provider where the ComputeDisk to import is found
*/
static generateConfigForImport(scope, importToId, importFromId, provider) {
return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "google_compute_disk", importId: importFromId, provider });
}
// ===========
// INITIALIZER
// ===========
/**
* Create a new {@link https://registry.terraform.io/providers/hashicorp/google/6.13.0/docs/resources/compute_disk google_compute_disk} Resource
*
* @param scope The scope in which to define this construct
* @param id The scoped construct ID. Must be unique amongst siblings in the same scope
* @param options ComputeDiskConfig
*/
constructor(scope, id, config) {
super(scope, id, {
terraformResourceType: 'google_compute_disk',
terraformGeneratorMetadata: {
providerName: 'google',
providerVersion: '6.13.0',
providerVersionConstraint: '~> 6.0'
},
provider: config.provider,
dependsOn: config.dependsOn,
count: config.count,
lifecycle: config.lifecycle,
provisioners: config.provisioners,
connection: config.connection,
forEach: config.forEach
});
// effective_labels - computed: true, optional: false, required: false
this._effectiveLabels = new cdktf.StringMap(this, "effective_labels");
// terraform_labels - computed: true, optional: false, required: false
this._terraformLabels = new cdktf.StringMap(this, "terraform_labels");
// async_primary_disk - computed: false, optional: true, required: false
this._asyncPrimaryDisk = new ComputeDiskAsyncPrimaryDiskOutputReference(this, "async_primary_disk");
// disk_encryption_key - computed: false, optional: true, required: false
this._diskEncryptionKey = new ComputeDiskDiskEncryptionKeyOutputReference(this, "disk_encryption_key");
// guest_os_features - computed: false, optional: true, required: false
this._guestOsFeatures = new ComputeDiskGuestOsFeaturesList(this, "guest_os_features", true);
// source_image_encryption_key - computed: false, optional: true, required: false
this._sourceImageEncryptionKey = new ComputeDiskSourceImageEncryptionKeyOutputReference(this, "source_image_encryption_key");
// source_snapshot_encryption_key - computed: false, optional: true, required: false
this._sourceSnapshotEncryptionKey = new ComputeDiskSourceSnapshotEncryptionKeyOutputReference(this, "source_snapshot_encryption_key");
// timeouts - computed: false, optional: true, required: false
this._timeouts = new ComputeDiskTimeoutsOutputReference(this, "timeouts");
this._accessMode = config.accessMode;
this._description = config.description;
this._enableConfidentialCompute = config.enableConfidentialCompute;
this._id = config.id;
this._image = config.image;
this._labels = config.labels;
this._licenses = config.licenses;
this._name = config.name;
this._physicalBlockSizeBytes = config.physicalBlockSizeBytes;
this._project = config.project;
this._provisionedIops = config.provisionedIops;
this._provisionedThroughput = config.provisionedThroughput;
this._size = config.size;
this._snapshot = config.snapshot;
this._sourceDisk = config.sourceDisk;
this._storagePool = config.storagePool;
this._type = config.type;
this._zone = config.zone;
this._asyncPrimaryDisk.internalValue = config.asyncPrimaryDisk;
this._diskEncryptionKey.internalValue = config.diskEncryptionKey;
this._guestOsFeatures.internalValue = config.guestOsFeatures;
this._sourceImageEncryptionKey.internalValue = config.sourceImageEncryptionKey;
this._sourceSnapshotEncryptionKey.internalValue = config.sourceSnapshotEncryptionKey;
this._timeouts.internalValue = config.timeouts;
}
get accessMode() {
return this.getStringAttribute('access_mode');
}
set accessMode(value) {
this._accessMode = value;
}
resetAccessMode() {
this._accessMode = undefined;
}
// Temporarily expose input value. Use with caution.
get accessModeInput() {
return this._accessMode;
}
// creation_timestamp - computed: true, optional: false, required: false
get creationTimestamp() {
return this.getStringAttribute('creation_timestamp');
}
get description() {
return this.getStringAttribute('description');
}
set description(value) {
this._description = value;
}
resetDescription() {
this._description = undefined;
}
// Temporarily expose input value. Use with caution.
get descriptionInput() {
return this._description;
}
// disk_id - computed: true, optional: false, required: false
get diskId() {
return this.getStringAttribute('disk_id');
}
get effectiveLabels() {
return this._effectiveLabels;
}
get enableConfidentialCompute() {
return this.getBooleanAttribute('enable_confidential_compute');
}
set enableConfidentialCompute(value) {
this._enableConfidentialCompute = value;
}
resetEnableConfidentialCompute() {
this._enableConfidentialCompute = undefined;
}
// Temporarily expose input value. Use with caution.
get enableConfidentialComputeInput() {
return this._enableConfidentialCompute;
}
get id() {
return this.getStringAttribute('id');
}
set id(value) {
this._id = value;
}
resetId() {
this._id = undefined;
}
// Temporarily expose input value. Use with caution.
get idInput() {
return this._id;
}
get image() {
return this.getStringAttribute('image');
}
set image(value) {
this._image = value;
}
resetImage() {
this._image = undefined;
}
// Temporarily expose input value. Use with caution.
get imageInput() {
return this._image;
}
// label_fingerprint - computed: true, optional: false, required: false
get labelFingerprint() {
return this.getStringAttribute('label_fingerprint');
}
get labels() {
return this.getStringMapAttribute('labels');
}
set labels(value) {
this._labels = value;
}
resetLabels() {
this._labels = undefined;
}
// Temporarily expose input value. Use with caution.
get labelsInput() {
return this._labels;
}
// last_attach_timestamp - computed: true, optional: false, required: false
get lastAttachTimestamp() {
return this.getStringAttribute('last_attach_timestamp');
}
// last_detach_timestamp - computed: true, optional: false, required: false
get lastDetachTimestamp() {
return this.getStringAttribute('last_detach_timestamp');
}
get licenses() {
return this.getListAttribute('licenses');
}
set licenses(value) {
this._licenses = value;
}
resetLicenses() {
this._licenses = undefined;
}
// Temporarily expose input value. Use with caution.
get licensesInput() {
return this._licenses;
}
get name() {
return this.getStringAttribute('name');
}
set name(value) {
this._name = value;
}
// Temporarily expose input value. Use with caution.
get nameInput() {
return this._name;
}
get physicalBlockSizeBytes() {
return this.getNumberAttribute('physical_block_size_bytes');
}
set physicalBlockSizeBytes(value) {
this._physicalBlockSizeBytes = value;
}
resetPhysicalBlockSizeBytes() {
this._physicalBlockSizeBytes = undefined;
}
// Temporarily expose input value. Use with caution.
get physicalBlockSizeBytesInput() {
return this._physicalBlockSizeBytes;
}
get project() {
return this.getStringAttribute('project');
}
set project(value) {
this._project = value;
}
resetProject() {
this._project = undefined;
}
// Temporarily expose input value. Use with caution.
get projectInput() {
return this._project;
}
get provisionedIops() {
return this.getNumberAttribute('provisioned_iops');
}
set provisionedIops(value) {
this._provisionedIops = value;
}
resetProvisionedIops() {
this._provisionedIops = undefined;
}
// Temporarily expose input value. Use with caution.
get provisionedIopsInput() {
return this._provisionedIops;
}
get provisionedThroughput() {
return this.getNumberAttribute('provisioned_throughput');
}
set provisionedThroughput(value) {
this._provisionedThroughput = value;
}
resetProvisionedThroughput() {
this._provisionedThroughput = undefined;
}
// Temporarily expose input value. Use with caution.
get provisionedThroughputInput() {
return this._provisionedThroughput;
}
// self_link - computed: true, optional: false, required: false
get selfLink() {
return this.getStringAttribute('self_link');
}
get size() {
return this.getNumberAttribute('size');
}
set size(value) {
this._size = value;
}
resetSize() {
this._size = undefined;
}
// Temporarily expose input value. Use with caution.
get sizeInput() {
return this._size;
}
get snapshot() {
return this.getStringAttribute('snapshot');
}
set snapshot(value) {
this._snapshot = value;
}
resetSnapshot() {
this._snapshot = undefined;
}
// Temporarily expose input value. Use with caution.
get snapshotInput() {
return this._snapshot;
}
get sourceDisk() {
return this.getStringAttribute('source_disk');
}
set sourceDisk(value) {
this._sourceDisk = value;
}
resetSourceDisk() {
this._sourceDisk = undefined;
}
// Temporarily expose input value. Use with caution.
get sourceDiskInput() {
return this._sourceDisk;
}
// source_disk_id - computed: true, optional: false, required: false
get sourceDiskId() {
return this.getStringAttribute('source_disk_id');
}
// source_image_id - computed: true, optional: false, required: false
get sourceImageId() {
return this.getStringAttribute('source_image_id');
}
// source_snapshot_id - computed: true, optional: false, required: false
get sourceSnapshotId() {
return this.getStringAttribute('source_snapshot_id');
}
get storagePool() {
return this.getStringAttribute('storage_pool');
}
set storagePool(value) {
this._storagePool = value;
}
resetStoragePool() {
this._storagePool = undefined;
}
// Temporarily expose input value. Use with caution.
get storagePoolInput() {
return this._storagePool;
}
get terraformLabels() {
return this._terraformLabels;
}
get type() {
return this.getStringAttribute('type');
}
set type(value) {
this._type = value;
}
resetType() {
this._type = undefined;
}
// Temporarily expose input value. Use with caution.
get typeInput() {
return this._type;
}
// users - computed: true, optional: false, required: false
get users() {
return this.getListAttribute('users');
}
get zone() {
return this.getStringAttribute('zone');
}
set zone(value) {
this._zone = value;
}
resetZone() {
this._zone = undefined;
}
// Temporarily expose input value. Use with caution.
get zoneInput() {
return this._zone;
}
get asyncPrimaryDisk() {
return this._asyncPrimaryDisk;
}
putAsyncPrimaryDisk(value) {
this._asyncPrimaryDisk.internalValue = value;
}
resetAsyncPrimaryDisk() {
this._asyncPrimaryDisk.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get asyncPrimaryDiskInput() {
return this._asyncPrimaryDisk.internalValue;
}
get diskEncryptionKey() {
return this._diskEncryptionKey;
}
putDiskEncryptionKey(value) {
this._diskEncryptionKey.internalValue = value;
}
resetDiskEncryptionKey() {
this._diskEncryptionKey.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get diskEncryptionKeyInput() {
return this._diskEncryptionKey.internalValue;
}
get guestOsFeatures() {
return this._guestOsFeatures;
}
putGuestOsFeatures(value) {
this._guestOsFeatures.internalValue = value;
}
resetGuestOsFeatures() {
this._guestOsFeatures.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get guestOsFeaturesInput() {
return this._guestOsFeatures.internalValue;
}
get sourceImageEncryptionKey() {
return this._sourceImageEncryptionKey;
}
putSourceImageEncryptionKey(value) {
this._sourceImageEncryptionKey.internalValue = value;
}
resetSourceImageEncryptionKey() {
this._sourceImageEncryptionKey.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get sourceImageEncryptionKeyInput() {
return this._sourceImageEncryptionKey.internalValue;
}
get sourceSnapshotEncryptionKey() {
return this._sourceSnapshotEncryptionKey;
}
putSourceSnapshotEncryptionKey(value) {
this._sourceSnapshotEncryptionKey.internalValue = value;
}
resetSourceSnapshotEncryptionKey() {
this._sourceSnapshotEncryptionKey.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get sourceSnapshotEncryptionKeyInput() {
return this._sourceSnapshotEncryptionKey.internalValue;
}
get timeouts() {
return this._timeouts;
}
putTimeouts(value) {
this._timeouts.internalValue = value;
}
resetTimeouts() {
this._timeouts.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get timeoutsInput() {
return this._timeouts.internalValue;
}
// =========
// SYNTHESIS
// =========
synthesizeAttributes() {
return {
access_mode: cdktf.stringToTerraform(this._accessMode),
description: cdktf.stringToTerraform(this._description),
enable_confidential_compute: cdktf.booleanToTerraform(this._enableConfidentialCompute),
id: cdktf.stringToTerraform(this._id),
image: cdktf.stringToTerraform(this._image),
labels: cdktf.hashMapper(cdktf.stringToTerraform)(this._labels),
licenses: cdktf.listMapper(cdktf.stringToTerraform, false)(this._licenses),
name: cdktf.stringToTerraform(this._name),
physical_block_size_bytes: cdktf.numberToTerraform(this._physicalBlockSizeBytes),
project: cdktf.stringToTerraform(this._project),
provisioned_iops: cdktf.numberToTerraform(this._provisionedIops),
provisioned_throughput: cdktf.numberToTerraform(this._provisionedThroughput),
size: cdktf.numberToTerraform(this._size),
snapshot: cdktf.stringToTerraform(this._snapshot),
source_disk: cdktf.stringToTerraform(this._sourceDisk),
storage_pool: cdktf.stringToTerraform(this._storagePool),
type: cdktf.stringToTerraform(this._type),
zone: cdktf.stringToTerraform(this._zone),
async_primary_disk: computeDiskAsyncPrimaryDiskToTerraform(this._asyncPrimaryDisk.internalValue),
disk_encryption_key: computeDiskDiskEncryptionKeyToTerraform(this._diskEncryptionKey.internalValue),
guest_os_features: cdktf.listMapper(computeDiskGuestOsFeaturesToTerraform, true)(this._guestOsFeatures.internalValue),
source_image_encryption_key: computeDiskSourceImageEncryptionKeyToTerraform(this._sourceImageEncryptionKey.internalValue),
source_snapshot_encryption_key: computeDiskSourceSnapshotEncryptionKeyToTerraform(this._sourceSnapshotEncryptionKey.internalValue),
timeouts: computeDiskTimeoutsToTerraform(this._timeouts.internalValue),
};
}
synthesizeHclAttributes() {
const attrs = {
access_mode: {
value: cdktf.stringToHclTerraform(this._accessMode),
isBlock: false,
type: "simple",
storageClassType: "string",
},
description: {
value: cdktf.stringToHclTerraform(this._description),
isBlock: false,
type: "simple",
storageClassType: "string",
},
enable_confidential_compute: {
value: cdktf.booleanToHclTerraform(this._enableConfidentialCompute),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
id: {
value: cdktf.stringToHclTerraform(this._id),
isBlock: false,
type: "simple",
storageClassType: "string",
},
image: {
value: cdktf.stringToHclTerraform(this._image),
isBlock: false,
type: "simple",
storageClassType: "string",
},
labels: {
value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(this._labels),
isBlock: false,
type: "map",
storageClassType: "stringMap",
},
licenses: {
value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(this._licenses),
isBlock: false,
type: "list",
storageClassType: "stringList",
},
name: {
value: cdktf.stringToHclTerraform(this._name),
isBlock: false,
type: "simple",
storageClassType: "string",
},
physical_block_size_bytes: {
value: cdktf.numberToHclTerraform(this._physicalBlockSizeBytes),
isBlock: false,
type: "simple",
storageClassType: "number",
},
project: {
value: cdktf.stringToHclTerraform(this._project),
isBlock: false,
type: "simple",
storageClassType: "string",
},
provisioned_iops: {
value: cdktf.numberToHclTerraform(this._provisionedIops),
isBlock: false,
type: "simple",
storageClassType: "number",
},
provisioned_throughput: {
value: cdktf.numberToHclTerraform(this._provisionedThroughput),
isBlock: false,
type: "simple",
storag