@cdktf/provider-google
Version:
Prebuilt google Provider for Terraform CDK (cdktf)
1,087 lines (1,086 loc) • 781 kB
JavaScript
"use strict";
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ComputeInstance = exports.ComputeInstanceTimeoutsOutputReference = exports.ComputeInstanceShieldedInstanceConfigOutputReference = exports.ComputeInstanceServiceAccountOutputReference = exports.ComputeInstanceScratchDiskList = exports.ComputeInstanceScratchDiskOutputReference = exports.ComputeInstanceSchedulingOutputReference = exports.ComputeInstanceSchedulingOnInstanceStopActionOutputReference = exports.ComputeInstanceSchedulingNodeAffinitiesList = exports.ComputeInstanceSchedulingNodeAffinitiesOutputReference = exports.ComputeInstanceSchedulingMaxRunDurationOutputReference = exports.ComputeInstanceSchedulingLocalSsdRecoveryTimeoutOutputReference = exports.ComputeInstanceReservationAffinityOutputReference = exports.ComputeInstanceReservationAffinitySpecificReservationOutputReference = exports.ComputeInstanceParamsOutputReference = exports.ComputeInstanceNetworkPerformanceConfigOutputReference = exports.ComputeInstanceNetworkInterfaceList = exports.ComputeInstanceNetworkInterfaceOutputReference = exports.ComputeInstanceNetworkInterfaceIpv6AccessConfigList = exports.ComputeInstanceNetworkInterfaceIpv6AccessConfigOutputReference = exports.ComputeInstanceNetworkInterfaceAliasIpRangeList = exports.ComputeInstanceNetworkInterfaceAliasIpRangeOutputReference = exports.ComputeInstanceNetworkInterfaceAccessConfigList = exports.ComputeInstanceNetworkInterfaceAccessConfigOutputReference = exports.ComputeInstanceInstanceEncryptionKeyOutputReference = exports.ComputeInstanceGuestAcceleratorList = exports.ComputeInstanceGuestAcceleratorOutputReference = exports.ComputeInstanceConfidentialInstanceConfigOutputReference = exports.ComputeInstanceBootDiskOutputReference = exports.ComputeInstanceBootDiskInitializeParamsOutputReference = exports.ComputeInstanceBootDiskInitializeParamsSourceSnapshotEncryptionKeyOutputReference = exports.ComputeInstanceBootDiskInitializeParamsSourceImageEncryptionKeyOutputReference = exports.ComputeInstanceAttachedDiskList = exports.ComputeInstanceAttachedDiskOutputReference = exports.ComputeInstanceAdvancedMachineFeaturesOutputReference = void 0;
exports.computeInstanceAdvancedMachineFeaturesToTerraform = computeInstanceAdvancedMachineFeaturesToTerraform;
exports.computeInstanceAdvancedMachineFeaturesToHclTerraform = computeInstanceAdvancedMachineFeaturesToHclTerraform;
exports.computeInstanceAttachedDiskToTerraform = computeInstanceAttachedDiskToTerraform;
exports.computeInstanceAttachedDiskToHclTerraform = computeInstanceAttachedDiskToHclTerraform;
exports.computeInstanceBootDiskInitializeParamsSourceImageEncryptionKeyToTerraform = computeInstanceBootDiskInitializeParamsSourceImageEncryptionKeyToTerraform;
exports.computeInstanceBootDiskInitializeParamsSourceImageEncryptionKeyToHclTerraform = computeInstanceBootDiskInitializeParamsSourceImageEncryptionKeyToHclTerraform;
exports.computeInstanceBootDiskInitializeParamsSourceSnapshotEncryptionKeyToTerraform = computeInstanceBootDiskInitializeParamsSourceSnapshotEncryptionKeyToTerraform;
exports.computeInstanceBootDiskInitializeParamsSourceSnapshotEncryptionKeyToHclTerraform = computeInstanceBootDiskInitializeParamsSourceSnapshotEncryptionKeyToHclTerraform;
exports.computeInstanceBootDiskInitializeParamsToTerraform = computeInstanceBootDiskInitializeParamsToTerraform;
exports.computeInstanceBootDiskInitializeParamsToHclTerraform = computeInstanceBootDiskInitializeParamsToHclTerraform;
exports.computeInstanceBootDiskToTerraform = computeInstanceBootDiskToTerraform;
exports.computeInstanceBootDiskToHclTerraform = computeInstanceBootDiskToHclTerraform;
exports.computeInstanceConfidentialInstanceConfigToTerraform = computeInstanceConfidentialInstanceConfigToTerraform;
exports.computeInstanceConfidentialInstanceConfigToHclTerraform = computeInstanceConfidentialInstanceConfigToHclTerraform;
exports.computeInstanceGuestAcceleratorToTerraform = computeInstanceGuestAcceleratorToTerraform;
exports.computeInstanceGuestAcceleratorToHclTerraform = computeInstanceGuestAcceleratorToHclTerraform;
exports.computeInstanceInstanceEncryptionKeyToTerraform = computeInstanceInstanceEncryptionKeyToTerraform;
exports.computeInstanceInstanceEncryptionKeyToHclTerraform = computeInstanceInstanceEncryptionKeyToHclTerraform;
exports.computeInstanceNetworkInterfaceAccessConfigToTerraform = computeInstanceNetworkInterfaceAccessConfigToTerraform;
exports.computeInstanceNetworkInterfaceAccessConfigToHclTerraform = computeInstanceNetworkInterfaceAccessConfigToHclTerraform;
exports.computeInstanceNetworkInterfaceAliasIpRangeToTerraform = computeInstanceNetworkInterfaceAliasIpRangeToTerraform;
exports.computeInstanceNetworkInterfaceAliasIpRangeToHclTerraform = computeInstanceNetworkInterfaceAliasIpRangeToHclTerraform;
exports.computeInstanceNetworkInterfaceIpv6AccessConfigToTerraform = computeInstanceNetworkInterfaceIpv6AccessConfigToTerraform;
exports.computeInstanceNetworkInterfaceIpv6AccessConfigToHclTerraform = computeInstanceNetworkInterfaceIpv6AccessConfigToHclTerraform;
exports.computeInstanceNetworkInterfaceToTerraform = computeInstanceNetworkInterfaceToTerraform;
exports.computeInstanceNetworkInterfaceToHclTerraform = computeInstanceNetworkInterfaceToHclTerraform;
exports.computeInstanceNetworkPerformanceConfigToTerraform = computeInstanceNetworkPerformanceConfigToTerraform;
exports.computeInstanceNetworkPerformanceConfigToHclTerraform = computeInstanceNetworkPerformanceConfigToHclTerraform;
exports.computeInstanceParamsToTerraform = computeInstanceParamsToTerraform;
exports.computeInstanceParamsToHclTerraform = computeInstanceParamsToHclTerraform;
exports.computeInstanceReservationAffinitySpecificReservationToTerraform = computeInstanceReservationAffinitySpecificReservationToTerraform;
exports.computeInstanceReservationAffinitySpecificReservationToHclTerraform = computeInstanceReservationAffinitySpecificReservationToHclTerraform;
exports.computeInstanceReservationAffinityToTerraform = computeInstanceReservationAffinityToTerraform;
exports.computeInstanceReservationAffinityToHclTerraform = computeInstanceReservationAffinityToHclTerraform;
exports.computeInstanceSchedulingLocalSsdRecoveryTimeoutToTerraform = computeInstanceSchedulingLocalSsdRecoveryTimeoutToTerraform;
exports.computeInstanceSchedulingLocalSsdRecoveryTimeoutToHclTerraform = computeInstanceSchedulingLocalSsdRecoveryTimeoutToHclTerraform;
exports.computeInstanceSchedulingMaxRunDurationToTerraform = computeInstanceSchedulingMaxRunDurationToTerraform;
exports.computeInstanceSchedulingMaxRunDurationToHclTerraform = computeInstanceSchedulingMaxRunDurationToHclTerraform;
exports.computeInstanceSchedulingNodeAffinitiesToTerraform = computeInstanceSchedulingNodeAffinitiesToTerraform;
exports.computeInstanceSchedulingNodeAffinitiesToHclTerraform = computeInstanceSchedulingNodeAffinitiesToHclTerraform;
exports.computeInstanceSchedulingOnInstanceStopActionToTerraform = computeInstanceSchedulingOnInstanceStopActionToTerraform;
exports.computeInstanceSchedulingOnInstanceStopActionToHclTerraform = computeInstanceSchedulingOnInstanceStopActionToHclTerraform;
exports.computeInstanceSchedulingToTerraform = computeInstanceSchedulingToTerraform;
exports.computeInstanceSchedulingToHclTerraform = computeInstanceSchedulingToHclTerraform;
exports.computeInstanceScratchDiskToTerraform = computeInstanceScratchDiskToTerraform;
exports.computeInstanceScratchDiskToHclTerraform = computeInstanceScratchDiskToHclTerraform;
exports.computeInstanceServiceAccountToTerraform = computeInstanceServiceAccountToTerraform;
exports.computeInstanceServiceAccountToHclTerraform = computeInstanceServiceAccountToHclTerraform;
exports.computeInstanceShieldedInstanceConfigToTerraform = computeInstanceShieldedInstanceConfigToTerraform;
exports.computeInstanceShieldedInstanceConfigToHclTerraform = computeInstanceShieldedInstanceConfigToHclTerraform;
exports.computeInstanceTimeoutsToTerraform = computeInstanceTimeoutsToTerraform;
exports.computeInstanceTimeoutsToHclTerraform = computeInstanceTimeoutsToHclTerraform;
const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
const cdktf = require("cdktf");
function computeInstanceAdvancedMachineFeaturesToTerraform(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 {
enable_nested_virtualization: cdktf.booleanToTerraform(struct.enableNestedVirtualization),
enable_uefi_networking: cdktf.booleanToTerraform(struct.enableUefiNetworking),
performance_monitoring_unit: cdktf.stringToTerraform(struct.performanceMonitoringUnit),
threads_per_core: cdktf.numberToTerraform(struct.threadsPerCore),
turbo_mode: cdktf.stringToTerraform(struct.turboMode),
visible_core_count: cdktf.numberToTerraform(struct.visibleCoreCount),
};
}
function computeInstanceAdvancedMachineFeaturesToHclTerraform(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 = {
enable_nested_virtualization: {
value: cdktf.booleanToHclTerraform(struct.enableNestedVirtualization),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
enable_uefi_networking: {
value: cdktf.booleanToHclTerraform(struct.enableUefiNetworking),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
performance_monitoring_unit: {
value: cdktf.stringToHclTerraform(struct.performanceMonitoringUnit),
isBlock: false,
type: "simple",
storageClassType: "string",
},
threads_per_core: {
value: cdktf.numberToHclTerraform(struct.threadsPerCore),
isBlock: false,
type: "simple",
storageClassType: "number",
},
turbo_mode: {
value: cdktf.stringToHclTerraform(struct.turboMode),
isBlock: false,
type: "simple",
storageClassType: "string",
},
visible_core_count: {
value: cdktf.numberToHclTerraform(struct.visibleCoreCount),
isBlock: false,
type: "simple",
storageClassType: "number",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class ComputeInstanceAdvancedMachineFeaturesOutputReference 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._enableNestedVirtualization !== undefined) {
hasAnyValues = true;
internalValueResult.enableNestedVirtualization = this._enableNestedVirtualization;
}
if (this._enableUefiNetworking !== undefined) {
hasAnyValues = true;
internalValueResult.enableUefiNetworking = this._enableUefiNetworking;
}
if (this._performanceMonitoringUnit !== undefined) {
hasAnyValues = true;
internalValueResult.performanceMonitoringUnit = this._performanceMonitoringUnit;
}
if (this._threadsPerCore !== undefined) {
hasAnyValues = true;
internalValueResult.threadsPerCore = this._threadsPerCore;
}
if (this._turboMode !== undefined) {
hasAnyValues = true;
internalValueResult.turboMode = this._turboMode;
}
if (this._visibleCoreCount !== undefined) {
hasAnyValues = true;
internalValueResult.visibleCoreCount = this._visibleCoreCount;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._enableNestedVirtualization = undefined;
this._enableUefiNetworking = undefined;
this._performanceMonitoringUnit = undefined;
this._threadsPerCore = undefined;
this._turboMode = undefined;
this._visibleCoreCount = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._enableNestedVirtualization = value.enableNestedVirtualization;
this._enableUefiNetworking = value.enableUefiNetworking;
this._performanceMonitoringUnit = value.performanceMonitoringUnit;
this._threadsPerCore = value.threadsPerCore;
this._turboMode = value.turboMode;
this._visibleCoreCount = value.visibleCoreCount;
}
}
get enableNestedVirtualization() {
return this.getBooleanAttribute('enable_nested_virtualization');
}
set enableNestedVirtualization(value) {
this._enableNestedVirtualization = value;
}
resetEnableNestedVirtualization() {
this._enableNestedVirtualization = undefined;
}
// Temporarily expose input value. Use with caution.
get enableNestedVirtualizationInput() {
return this._enableNestedVirtualization;
}
get enableUefiNetworking() {
return this.getBooleanAttribute('enable_uefi_networking');
}
set enableUefiNetworking(value) {
this._enableUefiNetworking = value;
}
resetEnableUefiNetworking() {
this._enableUefiNetworking = undefined;
}
// Temporarily expose input value. Use with caution.
get enableUefiNetworkingInput() {
return this._enableUefiNetworking;
}
get performanceMonitoringUnit() {
return this.getStringAttribute('performance_monitoring_unit');
}
set performanceMonitoringUnit(value) {
this._performanceMonitoringUnit = value;
}
resetPerformanceMonitoringUnit() {
this._performanceMonitoringUnit = undefined;
}
// Temporarily expose input value. Use with caution.
get performanceMonitoringUnitInput() {
return this._performanceMonitoringUnit;
}
get threadsPerCore() {
return this.getNumberAttribute('threads_per_core');
}
set threadsPerCore(value) {
this._threadsPerCore = value;
}
resetThreadsPerCore() {
this._threadsPerCore = undefined;
}
// Temporarily expose input value. Use with caution.
get threadsPerCoreInput() {
return this._threadsPerCore;
}
get turboMode() {
return this.getStringAttribute('turbo_mode');
}
set turboMode(value) {
this._turboMode = value;
}
resetTurboMode() {
this._turboMode = undefined;
}
// Temporarily expose input value. Use with caution.
get turboModeInput() {
return this._turboMode;
}
get visibleCoreCount() {
return this.getNumberAttribute('visible_core_count');
}
set visibleCoreCount(value) {
this._visibleCoreCount = value;
}
resetVisibleCoreCount() {
this._visibleCoreCount = undefined;
}
// Temporarily expose input value. Use with caution.
get visibleCoreCountInput() {
return this._visibleCoreCount;
}
}
exports.ComputeInstanceAdvancedMachineFeaturesOutputReference = ComputeInstanceAdvancedMachineFeaturesOutputReference;
_a = JSII_RTTI_SYMBOL_1;
ComputeInstanceAdvancedMachineFeaturesOutputReference[_a] = { fqn: "@cdktf/provider-google.computeInstance.ComputeInstanceAdvancedMachineFeaturesOutputReference", version: "14.35.0" };
function computeInstanceAttachedDiskToTerraform(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 {
device_name: cdktf.stringToTerraform(struct.deviceName),
disk_encryption_key_raw: cdktf.stringToTerraform(struct.diskEncryptionKeyRaw),
disk_encryption_key_rsa: cdktf.stringToTerraform(struct.diskEncryptionKeyRsa),
disk_encryption_service_account: cdktf.stringToTerraform(struct.diskEncryptionServiceAccount),
force_attach: cdktf.booleanToTerraform(struct.forceAttach),
kms_key_self_link: cdktf.stringToTerraform(struct.kmsKeySelfLink),
mode: cdktf.stringToTerraform(struct.mode),
source: cdktf.stringToTerraform(struct.source),
};
}
function computeInstanceAttachedDiskToHclTerraform(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 = {
device_name: {
value: cdktf.stringToHclTerraform(struct.deviceName),
isBlock: false,
type: "simple",
storageClassType: "string",
},
disk_encryption_key_raw: {
value: cdktf.stringToHclTerraform(struct.diskEncryptionKeyRaw),
isBlock: false,
type: "simple",
storageClassType: "string",
},
disk_encryption_key_rsa: {
value: cdktf.stringToHclTerraform(struct.diskEncryptionKeyRsa),
isBlock: false,
type: "simple",
storageClassType: "string",
},
disk_encryption_service_account: {
value: cdktf.stringToHclTerraform(struct.diskEncryptionServiceAccount),
isBlock: false,
type: "simple",
storageClassType: "string",
},
force_attach: {
value: cdktf.booleanToHclTerraform(struct.forceAttach),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
kms_key_self_link: {
value: cdktf.stringToHclTerraform(struct.kmsKeySelfLink),
isBlock: false,
type: "simple",
storageClassType: "string",
},
mode: {
value: cdktf.stringToHclTerraform(struct.mode),
isBlock: false,
type: "simple",
storageClassType: "string",
},
source: {
value: cdktf.stringToHclTerraform(struct.source),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class ComputeInstanceAttachedDiskOutputReference 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._deviceName !== undefined) {
hasAnyValues = true;
internalValueResult.deviceName = this._deviceName;
}
if (this._diskEncryptionKeyRaw !== undefined) {
hasAnyValues = true;
internalValueResult.diskEncryptionKeyRaw = this._diskEncryptionKeyRaw;
}
if (this._diskEncryptionKeyRsa !== undefined) {
hasAnyValues = true;
internalValueResult.diskEncryptionKeyRsa = this._diskEncryptionKeyRsa;
}
if (this._diskEncryptionServiceAccount !== undefined) {
hasAnyValues = true;
internalValueResult.diskEncryptionServiceAccount = this._diskEncryptionServiceAccount;
}
if (this._forceAttach !== undefined) {
hasAnyValues = true;
internalValueResult.forceAttach = this._forceAttach;
}
if (this._kmsKeySelfLink !== undefined) {
hasAnyValues = true;
internalValueResult.kmsKeySelfLink = this._kmsKeySelfLink;
}
if (this._mode !== undefined) {
hasAnyValues = true;
internalValueResult.mode = this._mode;
}
if (this._source !== undefined) {
hasAnyValues = true;
internalValueResult.source = this._source;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this.resolvableValue = undefined;
this._deviceName = undefined;
this._diskEncryptionKeyRaw = undefined;
this._diskEncryptionKeyRsa = undefined;
this._diskEncryptionServiceAccount = undefined;
this._forceAttach = undefined;
this._kmsKeySelfLink = undefined;
this._mode = undefined;
this._source = 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._deviceName = value.deviceName;
this._diskEncryptionKeyRaw = value.diskEncryptionKeyRaw;
this._diskEncryptionKeyRsa = value.diskEncryptionKeyRsa;
this._diskEncryptionServiceAccount = value.diskEncryptionServiceAccount;
this._forceAttach = value.forceAttach;
this._kmsKeySelfLink = value.kmsKeySelfLink;
this._mode = value.mode;
this._source = value.source;
}
}
get deviceName() {
return this.getStringAttribute('device_name');
}
set deviceName(value) {
this._deviceName = value;
}
resetDeviceName() {
this._deviceName = undefined;
}
// Temporarily expose input value. Use with caution.
get deviceNameInput() {
return this._deviceName;
}
get diskEncryptionKeyRaw() {
return this.getStringAttribute('disk_encryption_key_raw');
}
set diskEncryptionKeyRaw(value) {
this._diskEncryptionKeyRaw = value;
}
resetDiskEncryptionKeyRaw() {
this._diskEncryptionKeyRaw = undefined;
}
// Temporarily expose input value. Use with caution.
get diskEncryptionKeyRawInput() {
return this._diskEncryptionKeyRaw;
}
get diskEncryptionKeyRsa() {
return this.getStringAttribute('disk_encryption_key_rsa');
}
set diskEncryptionKeyRsa(value) {
this._diskEncryptionKeyRsa = value;
}
resetDiskEncryptionKeyRsa() {
this._diskEncryptionKeyRsa = undefined;
}
// Temporarily expose input value. Use with caution.
get diskEncryptionKeyRsaInput() {
return this._diskEncryptionKeyRsa;
}
// disk_encryption_key_sha256 - computed: true, optional: false, required: false
get diskEncryptionKeySha256() {
return this.getStringAttribute('disk_encryption_key_sha256');
}
get diskEncryptionServiceAccount() {
return this.getStringAttribute('disk_encryption_service_account');
}
set diskEncryptionServiceAccount(value) {
this._diskEncryptionServiceAccount = value;
}
resetDiskEncryptionServiceAccount() {
this._diskEncryptionServiceAccount = undefined;
}
// Temporarily expose input value. Use with caution.
get diskEncryptionServiceAccountInput() {
return this._diskEncryptionServiceAccount;
}
get forceAttach() {
return this.getBooleanAttribute('force_attach');
}
set forceAttach(value) {
this._forceAttach = value;
}
resetForceAttach() {
this._forceAttach = undefined;
}
// Temporarily expose input value. Use with caution.
get forceAttachInput() {
return this._forceAttach;
}
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 mode() {
return this.getStringAttribute('mode');
}
set mode(value) {
this._mode = value;
}
resetMode() {
this._mode = undefined;
}
// Temporarily expose input value. Use with caution.
get modeInput() {
return this._mode;
}
get source() {
return this.getStringAttribute('source');
}
set source(value) {
this._source = value;
}
// Temporarily expose input value. Use with caution.
get sourceInput() {
return this._source;
}
}
exports.ComputeInstanceAttachedDiskOutputReference = ComputeInstanceAttachedDiskOutputReference;
_b = JSII_RTTI_SYMBOL_1;
ComputeInstanceAttachedDiskOutputReference[_b] = { fqn: "@cdktf/provider-google.computeInstance.ComputeInstanceAttachedDiskOutputReference", version: "14.35.0" };
class ComputeInstanceAttachedDiskList 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 ComputeInstanceAttachedDiskOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);
}
}
exports.ComputeInstanceAttachedDiskList = ComputeInstanceAttachedDiskList;
_c = JSII_RTTI_SYMBOL_1;
ComputeInstanceAttachedDiskList[_c] = { fqn: "@cdktf/provider-google.computeInstance.ComputeInstanceAttachedDiskList", version: "14.35.0" };
function computeInstanceBootDiskInitializeParamsSourceImageEncryptionKeyToTerraform(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),
};
}
function computeInstanceBootDiskInitializeParamsSourceImageEncryptionKeyToHclTerraform(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));
}
class ComputeInstanceBootDiskInitializeParamsSourceImageEncryptionKeyOutputReference 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.ComputeInstanceBootDiskInitializeParamsSourceImageEncryptionKeyOutputReference = ComputeInstanceBootDiskInitializeParamsSourceImageEncryptionKeyOutputReference;
_d = JSII_RTTI_SYMBOL_1;
ComputeInstanceBootDiskInitializeParamsSourceImageEncryptionKeyOutputReference[_d] = { fqn: "@cdktf/provider-google.computeInstance.ComputeInstanceBootDiskInitializeParamsSourceImageEncryptionKeyOutputReference", version: "14.35.0" };
function computeInstanceBootDiskInitializeParamsSourceSnapshotEncryptionKeyToTerraform(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),
};
}
function computeInstanceBootDiskInitializeParamsSourceSnapshotEncryptionKeyToHclTerraform(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));
}
class ComputeInstanceBootDiskInitializeParamsSourceSnapshotEncryptionKeyOutputReference 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.ComputeInstanceBootDiskInitializeParamsSourceSnapshotEncryptionKeyOutputReference = ComputeInstanceBootDiskInitializeParamsSourceSnapshotEncryptionKeyOutputReference;
_e = JSII_RTTI_SYMBOL_1;
ComputeInstanceBootDiskInitializeParamsSourceSnapshotEncryptionKeyOutputReference[_e] = { fqn: "@cdktf/provider-google.computeInstance.ComputeInstanceBootDiskInitializeParamsSourceSnapshotEncryptionKeyOutputReference", version: "14.35.0" };
function computeInstanceBootDiskInitializeParamsToTerraform(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 {
architecture: cdktf.stringToTerraform(struct.architecture),
enable_confidential_compute: cdktf.booleanToTerraform(struct.enableConfidentialCompute),
image: cdktf.stringToTerraform(struct.image),
labels: cdktf.hashMapper(cdktf.stringToTerraform)(struct.labels),
provisioned_iops: cdktf.numberToTerraform(struct.provisionedIops),
provisioned_throughput: cdktf.numberToTerraform(struct.provisionedThroughput),
resource_manager_tags: cdktf.hashMapper(cdktf.stringToTerraform)(struct.resourceManagerTags),
resource_policies: cdktf.listMapper(cdktf.stringToTerraform, false)(struct.resourcePolicies),
size: cdktf.numberToTerraform(struct.size),
snapshot: cdktf.stringToTerraform(struct.snapshot),
storage_pool: cdktf.stringToTerraform(struct.storagePool),
type: cdktf.stringToTerraform(struct.type),
source_image_encryption_key: computeInstanceBootDiskInitializeParamsSourceImageEncryptionKeyToTerraform(struct.sourceImageEncryptionKey),
source_snapshot_encryption_key: computeInstanceBootDiskInitializeParamsSourceSnapshotEncryptionKeyToTerraform(struct.sourceSnapshotEncryptionKey),
};
}
function computeInstanceBootDiskInitializeParamsToHclTerraform(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 = {
architecture: {
value: cdktf.stringToHclTerraform(struct.architecture),
isBlock: false,
type: "simple",
storageClassType: "string",
},
enable_confidential_compute: {
value: cdktf.booleanToHclTerraform(struct.enableConfidentialCompute),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
image: {
value: cdktf.stringToHclTerraform(struct.image),
isBlock: false,
type: "simple",
storageClassType: "string",
},
labels: {
value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct.labels),
isBlock: false,
type: "map",
storageClassType: "stringMap",
},
provisioned_iops: {
value: cdktf.numberToHclTerraform(struct.provisionedIops),
isBlock: false,
type: "simple",
storageClassType: "number",
},
provisioned_throughput: {
value: cdktf.numberToHclTerraform(struct.provisionedThroughput),
isBlock: false,
type: "simple",
storageClassType: "number",
},
resource_manager_tags: {
value: cdktf.hashMapperHcl(cdktf.stringToHclTerraform)(struct.resourceManagerTags),
isBlock: false,
type: "map",
storageClassType: "stringMap",
},
resource_policies: {
value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct.resourcePolicies),
isBlock: false,
type: "list",
storageClassType: "stringList",
},
size: {
value: cdktf.numberToHclTerraform(struct.size),
isBlock: false,
type: "simple",
storageClassType: "number",
},
snapshot: {
value: cdktf.stringToHclTerraform(struct.snapshot),
isBlock: false,
type: "simple",
storageClassType: "string",
},
storage_pool: {
value: cdktf.stringToHclTerraform(struct.storagePool),
isBlock: false,
type: "simple",
storageClassType: "string",
},
type: {
value: cdktf.stringToHclTerraform(struct.type),
isBlock: false,
type: "simple",
storageClassType: "string",
},
source_image_encryption_key: {
value: computeInstanceBootDiskInitializeParamsSourceImageEncryptionKeyToHclTerraform(struct.sourceImageEncryptionKey),
isBlock: true,
type: "list",
storageClassType: "ComputeInstanceBootDiskInitializeParamsSourceImageEncryptionKeyList",
},
source_snapshot_encryption_key: {
value: computeInstanceBootDiskInitializeParamsSourceSnapshotEncryptionKeyToHclTerraform(struct.sourceSnapshotEncryptionKey),
isBlock: true,
type: "list",
storageClassType: "ComputeInstanceBootDiskInitializeParamsSourceSnapshotEncryptionKeyList",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
class ComputeInstanceBootDiskInitializeParamsOutputReference 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;
// source_image_encryption_key - computed: false, optional: true, required: false
this._sourceImageEncryptionKey = new ComputeInstanceBootDiskInitializeParamsSourceImageEncryptionKeyOutputReference(this, "source_image_encryption_key");
// source_snapshot_encryption_key - computed: false, optional: true, required: false
this._sourceSnapshotEncryptionKey = new ComputeInstanceBootDiskInitializeParamsSourceSnapshotEncryptionKeyOutputReference(this, "source_snapshot_encryption_key");
}
get internalValue() {
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._architecture !== undefined) {
hasAnyValues = true;
internalValueResult.architecture = this._architecture;
}
if (this._enableConfidentialCompute !== undefined) {
hasAnyValues = true;
internalValueResult.enableConfidentialCompute = this._enableConfidentialCompute;
}
if (this._image !== undefined) {
hasAnyValues = true;
internalValueResult.image = this._image;
}
if (this._labels !== undefined) {
hasAnyValues = true;
internalValueResult.labels = this._labels;
}
if (this._provisionedIops !== undefined) {
hasAnyValues = true;
internalValueResult.provisionedIops = this._provisionedIops;
}
if (this._provisionedThroughput !== undefined) {
hasAnyValues = true;
internalValueResult.provisionedThroughput = this._provisionedThroughput;
}
if (this._resourceManagerTags !== undefined) {
hasAnyValues = true;
internalValueResult.resourceManagerTags = this._resourceManagerTags;
}
if (this._resourcePolicies !== undefined) {
hasAnyValues = true;
internalValueResult.resourcePolicies = this._resourcePolicies;
}
if (this._size !== undefined) {
hasAnyValues = true;
internalValueResult.size = this._size;
}
if (this._snapshot !== undefined) {
hasAnyValues = true;
internalValueResult.snapshot = this._snapshot;
}
if (this._storagePool !== undefined) {
hasAnyValues = true;
internalValueResult.storagePool = this._storagePool;
}
if (this._type !== undefined) {
hasAnyValues = true;
internalValueResult.type = this._type;
}
if (this._sourceImageEncryptionKey?.internalValue !== undefined) {
hasAnyValues = true;
internalValueResult.sourceImageEncryptionKey = this._sourceImageEncryptionKey?.internalValue;
}
if (this._sourceSnapshotEncryptionKey?.internalValue !== undefined) {
hasAnyValues = true;
internalValueResult.sourceSnapshotEncryptionKey = this._sourceSnapshotEncryptionKey?.internalValue;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._architecture = undefined;
this._enableConfidentialCompute = undefined;
this._image = undefined;
this._labels = undefined;
this._provisionedIops = undefined;
this._provisionedThroughput = undefined;
this._resourceManagerTags = undefined;
this._resourcePolicies = undefined;
this._size = undefined;
this._snapshot = undefined;
this._storagePool = undefined;
this._type = undefined;
this._sourceImageEncryptionKey.internalValue = undefined;
this._sourceSnapshotEncryptionKey.internalValue = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._architecture = value.architecture;
this._enableConfidentialCompute = value.enableConfidentialCompute;
this._image = value.image;
this._labels = value.labels;
this._provisionedIops = value.provisionedIops;
this._provisionedThroughput = value.provisionedThroughput;
this._resourceManagerTags = value.resourceManagerTags;
this._resourcePolicies = value.resourcePolicies;