@cdktf/provider-google
Version:
Prebuilt google Provider for Terraform CDK (cdktf)
1,138 lines • 170 kB
JavaScript
"use strict";
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
Object.defineProperty(exports, "__esModule", { value: true });
exports.ComputeReservation = exports.ComputeReservationTimeoutsOutputReference = exports.computeReservationTimeoutsToHclTerraform = exports.computeReservationTimeoutsToTerraform = exports.ComputeReservationSpecificReservationOutputReference = exports.computeReservationSpecificReservationToHclTerraform = exports.computeReservationSpecificReservationToTerraform = exports.ComputeReservationSpecificReservationInstancePropertiesOutputReference = exports.computeReservationSpecificReservationInstancePropertiesToHclTerraform = exports.computeReservationSpecificReservationInstancePropertiesToTerraform = exports.ComputeReservationSpecificReservationInstancePropertiesLocalSsdsList = exports.ComputeReservationSpecificReservationInstancePropertiesLocalSsdsOutputReference = exports.computeReservationSpecificReservationInstancePropertiesLocalSsdsToHclTerraform = exports.computeReservationSpecificReservationInstancePropertiesLocalSsdsToTerraform = exports.ComputeReservationSpecificReservationInstancePropertiesGuestAcceleratorsList = exports.ComputeReservationSpecificReservationInstancePropertiesGuestAcceleratorsOutputReference = exports.computeReservationSpecificReservationInstancePropertiesGuestAcceleratorsToHclTerraform = exports.computeReservationSpecificReservationInstancePropertiesGuestAcceleratorsToTerraform = exports.ComputeReservationShareSettingsOutputReference = exports.computeReservationShareSettingsToHclTerraform = exports.computeReservationShareSettingsToTerraform = exports.ComputeReservationShareSettingsProjectMapList = exports.ComputeReservationShareSettingsProjectMapOutputReference = exports.computeReservationShareSettingsProjectMapToHclTerraform = exports.computeReservationShareSettingsProjectMapToTerraform = void 0;
const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
const cdktf = require("cdktf");
function computeReservationShareSettingsProjectMapToTerraform(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 {
id: cdktf.stringToTerraform(struct.id),
project_id: cdktf.stringToTerraform(struct.projectId),
};
}
exports.computeReservationShareSettingsProjectMapToTerraform = computeReservationShareSettingsProjectMapToTerraform;
function computeReservationShareSettingsProjectMapToHclTerraform(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 = {
id: {
value: cdktf.stringToHclTerraform(struct.id),
isBlock: false,
type: "simple",
storageClassType: "string",
},
project_id: {
value: cdktf.stringToHclTerraform(struct.projectId),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.computeReservationShareSettingsProjectMapToHclTerraform = computeReservationShareSettingsProjectMapToHclTerraform;
class ComputeReservationShareSettingsProjectMapOutputReference 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._id !== undefined) {
hasAnyValues = true;
internalValueResult.id = this._id;
}
if (this._projectId !== undefined) {
hasAnyValues = true;
internalValueResult.projectId = this._projectId;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this.resolvableValue = undefined;
this._id = undefined;
this._projectId = 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._id = value.id;
this._projectId = value.projectId;
}
}
get id() {
return this.getStringAttribute('id');
}
set id(value) {
this._id = value;
}
// Temporarily expose input value. Use with caution.
get idInput() {
return this._id;
}
get projectId() {
return this.getStringAttribute('project_id');
}
set projectId(value) {
this._projectId = value;
}
resetProjectId() {
this._projectId = undefined;
}
// Temporarily expose input value. Use with caution.
get projectIdInput() {
return this._projectId;
}
}
exports.ComputeReservationShareSettingsProjectMapOutputReference = ComputeReservationShareSettingsProjectMapOutputReference;
_a = JSII_RTTI_SYMBOL_1;
ComputeReservationShareSettingsProjectMapOutputReference[_a] = { fqn: "@cdktf/provider-google.computeReservation.ComputeReservationShareSettingsProjectMapOutputReference", version: "14.12.0" };
class ComputeReservationShareSettingsProjectMapList 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 ComputeReservationShareSettingsProjectMapOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);
}
}
exports.ComputeReservationShareSettingsProjectMapList = ComputeReservationShareSettingsProjectMapList;
_b = JSII_RTTI_SYMBOL_1;
ComputeReservationShareSettingsProjectMapList[_b] = { fqn: "@cdktf/provider-google.computeReservation.ComputeReservationShareSettingsProjectMapList", version: "14.12.0" };
function computeReservationShareSettingsToTerraform(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 {
share_type: cdktf.stringToTerraform(struct.shareType),
project_map: cdktf.listMapper(computeReservationShareSettingsProjectMapToTerraform, true)(struct.projectMap),
};
}
exports.computeReservationShareSettingsToTerraform = computeReservationShareSettingsToTerraform;
function computeReservationShareSettingsToHclTerraform(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 = {
share_type: {
value: cdktf.stringToHclTerraform(struct.shareType),
isBlock: false,
type: "simple",
storageClassType: "string",
},
project_map: {
value: cdktf.listMapperHcl(computeReservationShareSettingsProjectMapToHclTerraform, true)(struct.projectMap),
isBlock: true,
type: "set",
storageClassType: "ComputeReservationShareSettingsProjectMapList",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.computeReservationShareSettingsToHclTerraform = computeReservationShareSettingsToHclTerraform;
class ComputeReservationShareSettingsOutputReference 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;
// project_map - computed: false, optional: true, required: false
this._projectMap = new ComputeReservationShareSettingsProjectMapList(this, "project_map", true);
}
get internalValue() {
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._shareType !== undefined) {
hasAnyValues = true;
internalValueResult.shareType = this._shareType;
}
if (this._projectMap?.internalValue !== undefined) {
hasAnyValues = true;
internalValueResult.projectMap = this._projectMap?.internalValue;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._shareType = undefined;
this._projectMap.internalValue = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._shareType = value.shareType;
this._projectMap.internalValue = value.projectMap;
}
}
get shareType() {
return this.getStringAttribute('share_type');
}
set shareType(value) {
this._shareType = value;
}
resetShareType() {
this._shareType = undefined;
}
// Temporarily expose input value. Use with caution.
get shareTypeInput() {
return this._shareType;
}
get projectMap() {
return this._projectMap;
}
putProjectMap(value) {
this._projectMap.internalValue = value;
}
resetProjectMap() {
this._projectMap.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get projectMapInput() {
return this._projectMap.internalValue;
}
}
exports.ComputeReservationShareSettingsOutputReference = ComputeReservationShareSettingsOutputReference;
_c = JSII_RTTI_SYMBOL_1;
ComputeReservationShareSettingsOutputReference[_c] = { fqn: "@cdktf/provider-google.computeReservation.ComputeReservationShareSettingsOutputReference", version: "14.12.0" };
function computeReservationSpecificReservationInstancePropertiesGuestAcceleratorsToTerraform(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 {
accelerator_count: cdktf.numberToTerraform(struct.acceleratorCount),
accelerator_type: cdktf.stringToTerraform(struct.acceleratorType),
};
}
exports.computeReservationSpecificReservationInstancePropertiesGuestAcceleratorsToTerraform = computeReservationSpecificReservationInstancePropertiesGuestAcceleratorsToTerraform;
function computeReservationSpecificReservationInstancePropertiesGuestAcceleratorsToHclTerraform(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 = {
accelerator_count: {
value: cdktf.numberToHclTerraform(struct.acceleratorCount),
isBlock: false,
type: "simple",
storageClassType: "number",
},
accelerator_type: {
value: cdktf.stringToHclTerraform(struct.acceleratorType),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.computeReservationSpecificReservationInstancePropertiesGuestAcceleratorsToHclTerraform = computeReservationSpecificReservationInstancePropertiesGuestAcceleratorsToHclTerraform;
class ComputeReservationSpecificReservationInstancePropertiesGuestAcceleratorsOutputReference 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._acceleratorCount !== undefined) {
hasAnyValues = true;
internalValueResult.acceleratorCount = this._acceleratorCount;
}
if (this._acceleratorType !== undefined) {
hasAnyValues = true;
internalValueResult.acceleratorType = this._acceleratorType;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this.resolvableValue = undefined;
this._acceleratorCount = undefined;
this._acceleratorType = 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._acceleratorCount = value.acceleratorCount;
this._acceleratorType = value.acceleratorType;
}
}
get acceleratorCount() {
return this.getNumberAttribute('accelerator_count');
}
set acceleratorCount(value) {
this._acceleratorCount = value;
}
// Temporarily expose input value. Use with caution.
get acceleratorCountInput() {
return this._acceleratorCount;
}
get acceleratorType() {
return this.getStringAttribute('accelerator_type');
}
set acceleratorType(value) {
this._acceleratorType = value;
}
// Temporarily expose input value. Use with caution.
get acceleratorTypeInput() {
return this._acceleratorType;
}
}
exports.ComputeReservationSpecificReservationInstancePropertiesGuestAcceleratorsOutputReference = ComputeReservationSpecificReservationInstancePropertiesGuestAcceleratorsOutputReference;
_d = JSII_RTTI_SYMBOL_1;
ComputeReservationSpecificReservationInstancePropertiesGuestAcceleratorsOutputReference[_d] = { fqn: "@cdktf/provider-google.computeReservation.ComputeReservationSpecificReservationInstancePropertiesGuestAcceleratorsOutputReference", version: "14.12.0" };
class ComputeReservationSpecificReservationInstancePropertiesGuestAcceleratorsList 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 ComputeReservationSpecificReservationInstancePropertiesGuestAcceleratorsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);
}
}
exports.ComputeReservationSpecificReservationInstancePropertiesGuestAcceleratorsList = ComputeReservationSpecificReservationInstancePropertiesGuestAcceleratorsList;
_e = JSII_RTTI_SYMBOL_1;
ComputeReservationSpecificReservationInstancePropertiesGuestAcceleratorsList[_e] = { fqn: "@cdktf/provider-google.computeReservation.ComputeReservationSpecificReservationInstancePropertiesGuestAcceleratorsList", version: "14.12.0" };
function computeReservationSpecificReservationInstancePropertiesLocalSsdsToTerraform(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_size_gb: cdktf.numberToTerraform(struct.diskSizeGb),
interface: cdktf.stringToTerraform(struct.interface),
};
}
exports.computeReservationSpecificReservationInstancePropertiesLocalSsdsToTerraform = computeReservationSpecificReservationInstancePropertiesLocalSsdsToTerraform;
function computeReservationSpecificReservationInstancePropertiesLocalSsdsToHclTerraform(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_size_gb: {
value: cdktf.numberToHclTerraform(struct.diskSizeGb),
isBlock: false,
type: "simple",
storageClassType: "number",
},
interface: {
value: cdktf.stringToHclTerraform(struct.interface),
isBlock: false,
type: "simple",
storageClassType: "string",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.computeReservationSpecificReservationInstancePropertiesLocalSsdsToHclTerraform = computeReservationSpecificReservationInstancePropertiesLocalSsdsToHclTerraform;
class ComputeReservationSpecificReservationInstancePropertiesLocalSsdsOutputReference 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._diskSizeGb !== undefined) {
hasAnyValues = true;
internalValueResult.diskSizeGb = this._diskSizeGb;
}
if (this._interface !== undefined) {
hasAnyValues = true;
internalValueResult.interface = this._interface;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this.resolvableValue = undefined;
this._diskSizeGb = undefined;
this._interface = 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._diskSizeGb = value.diskSizeGb;
this._interface = value.interface;
}
}
get diskSizeGb() {
return this.getNumberAttribute('disk_size_gb');
}
set diskSizeGb(value) {
this._diskSizeGb = value;
}
// Temporarily expose input value. Use with caution.
get diskSizeGbInput() {
return this._diskSizeGb;
}
get interface() {
return this.getStringAttribute('interface');
}
set interface(value) {
this._interface = value;
}
resetInterface() {
this._interface = undefined;
}
// Temporarily expose input value. Use with caution.
get interfaceInput() {
return this._interface;
}
}
exports.ComputeReservationSpecificReservationInstancePropertiesLocalSsdsOutputReference = ComputeReservationSpecificReservationInstancePropertiesLocalSsdsOutputReference;
_f = JSII_RTTI_SYMBOL_1;
ComputeReservationSpecificReservationInstancePropertiesLocalSsdsOutputReference[_f] = { fqn: "@cdktf/provider-google.computeReservation.ComputeReservationSpecificReservationInstancePropertiesLocalSsdsOutputReference", version: "14.12.0" };
class ComputeReservationSpecificReservationInstancePropertiesLocalSsdsList 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 ComputeReservationSpecificReservationInstancePropertiesLocalSsdsOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet);
}
}
exports.ComputeReservationSpecificReservationInstancePropertiesLocalSsdsList = ComputeReservationSpecificReservationInstancePropertiesLocalSsdsList;
_g = JSII_RTTI_SYMBOL_1;
ComputeReservationSpecificReservationInstancePropertiesLocalSsdsList[_g] = { fqn: "@cdktf/provider-google.computeReservation.ComputeReservationSpecificReservationInstancePropertiesLocalSsdsList", version: "14.12.0" };
function computeReservationSpecificReservationInstancePropertiesToTerraform(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 {
machine_type: cdktf.stringToTerraform(struct.machineType),
min_cpu_platform: cdktf.stringToTerraform(struct.minCpuPlatform),
guest_accelerators: cdktf.listMapper(computeReservationSpecificReservationInstancePropertiesGuestAcceleratorsToTerraform, true)(struct.guestAccelerators),
local_ssds: cdktf.listMapper(computeReservationSpecificReservationInstancePropertiesLocalSsdsToTerraform, true)(struct.localSsds),
};
}
exports.computeReservationSpecificReservationInstancePropertiesToTerraform = computeReservationSpecificReservationInstancePropertiesToTerraform;
function computeReservationSpecificReservationInstancePropertiesToHclTerraform(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 = {
machine_type: {
value: cdktf.stringToHclTerraform(struct.machineType),
isBlock: false,
type: "simple",
storageClassType: "string",
},
min_cpu_platform: {
value: cdktf.stringToHclTerraform(struct.minCpuPlatform),
isBlock: false,
type: "simple",
storageClassType: "string",
},
guest_accelerators: {
value: cdktf.listMapperHcl(computeReservationSpecificReservationInstancePropertiesGuestAcceleratorsToHclTerraform, true)(struct.guestAccelerators),
isBlock: true,
type: "list",
storageClassType: "ComputeReservationSpecificReservationInstancePropertiesGuestAcceleratorsList",
},
local_ssds: {
value: cdktf.listMapperHcl(computeReservationSpecificReservationInstancePropertiesLocalSsdsToHclTerraform, true)(struct.localSsds),
isBlock: true,
type: "list",
storageClassType: "ComputeReservationSpecificReservationInstancePropertiesLocalSsdsList",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.computeReservationSpecificReservationInstancePropertiesToHclTerraform = computeReservationSpecificReservationInstancePropertiesToHclTerraform;
class ComputeReservationSpecificReservationInstancePropertiesOutputReference 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;
// guest_accelerators - computed: false, optional: true, required: false
this._guestAccelerators = new ComputeReservationSpecificReservationInstancePropertiesGuestAcceleratorsList(this, "guest_accelerators", false);
// local_ssds - computed: false, optional: true, required: false
this._localSsds = new ComputeReservationSpecificReservationInstancePropertiesLocalSsdsList(this, "local_ssds", false);
}
get internalValue() {
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._machineType !== undefined) {
hasAnyValues = true;
internalValueResult.machineType = this._machineType;
}
if (this._minCpuPlatform !== undefined) {
hasAnyValues = true;
internalValueResult.minCpuPlatform = this._minCpuPlatform;
}
if (this._guestAccelerators?.internalValue !== undefined) {
hasAnyValues = true;
internalValueResult.guestAccelerators = this._guestAccelerators?.internalValue;
}
if (this._localSsds?.internalValue !== undefined) {
hasAnyValues = true;
internalValueResult.localSsds = this._localSsds?.internalValue;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._machineType = undefined;
this._minCpuPlatform = undefined;
this._guestAccelerators.internalValue = undefined;
this._localSsds.internalValue = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._machineType = value.machineType;
this._minCpuPlatform = value.minCpuPlatform;
this._guestAccelerators.internalValue = value.guestAccelerators;
this._localSsds.internalValue = value.localSsds;
}
}
get machineType() {
return this.getStringAttribute('machine_type');
}
set machineType(value) {
this._machineType = value;
}
// Temporarily expose input value. Use with caution.
get machineTypeInput() {
return this._machineType;
}
get minCpuPlatform() {
return this.getStringAttribute('min_cpu_platform');
}
set minCpuPlatform(value) {
this._minCpuPlatform = value;
}
resetMinCpuPlatform() {
this._minCpuPlatform = undefined;
}
// Temporarily expose input value. Use with caution.
get minCpuPlatformInput() {
return this._minCpuPlatform;
}
get guestAccelerators() {
return this._guestAccelerators;
}
putGuestAccelerators(value) {
this._guestAccelerators.internalValue = value;
}
resetGuestAccelerators() {
this._guestAccelerators.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get guestAcceleratorsInput() {
return this._guestAccelerators.internalValue;
}
get localSsds() {
return this._localSsds;
}
putLocalSsds(value) {
this._localSsds.internalValue = value;
}
resetLocalSsds() {
this._localSsds.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get localSsdsInput() {
return this._localSsds.internalValue;
}
}
exports.ComputeReservationSpecificReservationInstancePropertiesOutputReference = ComputeReservationSpecificReservationInstancePropertiesOutputReference;
_h = JSII_RTTI_SYMBOL_1;
ComputeReservationSpecificReservationInstancePropertiesOutputReference[_h] = { fqn: "@cdktf/provider-google.computeReservation.ComputeReservationSpecificReservationInstancePropertiesOutputReference", version: "14.12.0" };
function computeReservationSpecificReservationToTerraform(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 {
count: cdktf.numberToTerraform(struct.count),
instance_properties: computeReservationSpecificReservationInstancePropertiesToTerraform(struct.instanceProperties),
};
}
exports.computeReservationSpecificReservationToTerraform = computeReservationSpecificReservationToTerraform;
function computeReservationSpecificReservationToHclTerraform(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 = {
count: {
value: cdktf.numberToHclTerraform(struct.count),
isBlock: false,
type: "simple",
storageClassType: "number",
},
instance_properties: {
value: computeReservationSpecificReservationInstancePropertiesToHclTerraform(struct.instanceProperties),
isBlock: true,
type: "list",
storageClassType: "ComputeReservationSpecificReservationInstancePropertiesList",
},
};
// remove undefined attributes
return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined));
}
exports.computeReservationSpecificReservationToHclTerraform = computeReservationSpecificReservationToHclTerraform;
class ComputeReservationSpecificReservationOutputReference 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;
// instance_properties - computed: false, optional: false, required: true
this._instanceProperties = new ComputeReservationSpecificReservationInstancePropertiesOutputReference(this, "instance_properties");
}
get internalValue() {
let hasAnyValues = this.isEmptyObject;
const internalValueResult = {};
if (this._count !== undefined) {
hasAnyValues = true;
internalValueResult.count = this._count;
}
if (this._instanceProperties?.internalValue !== undefined) {
hasAnyValues = true;
internalValueResult.instanceProperties = this._instanceProperties?.internalValue;
}
return hasAnyValues ? internalValueResult : undefined;
}
set internalValue(value) {
if (value === undefined) {
this.isEmptyObject = false;
this._count = undefined;
this._instanceProperties.internalValue = undefined;
}
else {
this.isEmptyObject = Object.keys(value).length === 0;
this._count = value.count;
this._instanceProperties.internalValue = value.instanceProperties;
}
}
get count() {
return this.getNumberAttribute('count');
}
set count(value) {
this._count = value;
}
// Temporarily expose input value. Use with caution.
get countInput() {
return this._count;
}
// in_use_count - computed: true, optional: false, required: false
get inUseCount() {
return this.getNumberAttribute('in_use_count');
}
get instanceProperties() {
return this._instanceProperties;
}
putInstanceProperties(value) {
this._instanceProperties.internalValue = value;
}
// Temporarily expose input value. Use with caution.
get instancePropertiesInput() {
return this._instanceProperties.internalValue;
}
}
exports.ComputeReservationSpecificReservationOutputReference = ComputeReservationSpecificReservationOutputReference;
_j = JSII_RTTI_SYMBOL_1;
ComputeReservationSpecificReservationOutputReference[_j] = { fqn: "@cdktf/provider-google.computeReservation.ComputeReservationSpecificReservationOutputReference", version: "14.12.0" };
function computeReservationTimeoutsToTerraform(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.computeReservationTimeoutsToTerraform = computeReservationTimeoutsToTerraform;
function computeReservationTimeoutsToHclTerraform(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.computeReservationTimeoutsToHclTerraform = computeReservationTimeoutsToHclTerraform;
class ComputeReservationTimeoutsOutputReference 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.ComputeReservationTimeoutsOutputReference = ComputeReservationTimeoutsOutputReference;
_k = JSII_RTTI_SYMBOL_1;
ComputeReservationTimeoutsOutputReference[_k] = { fqn: "@cdktf/provider-google.computeReservation.ComputeReservationTimeoutsOutputReference", version: "14.12.0" };
/**
* Represents a {@link https://registry.terraform.io/providers/hashicorp/google/6.13.0/docs/resources/compute_reservation google_compute_reservation}
*/
class ComputeReservation extends cdktf.TerraformResource {
// ==============
// STATIC Methods
// ==============
/**
* Generates CDKTF code for importing a ComputeReservation 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 ComputeReservation to import
* @param importFromId The id of the existing ComputeReservation that should be imported. Refer to the {@link https://registry.terraform.io/providers/hashicorp/google/6.13.0/docs/resources/compute_reservation#import import section} in the documentation of this resource for the id to use
* @param provider? Optional instance of the provider where the ComputeReservation to import is found
*/
static generateConfigForImport(scope, importToId, importFromId, provider) {
return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "google_compute_reservation", importId: importFromId, provider });
}
// ===========
// INITIALIZER
// ===========
/**
* Create a new {@link https://registry.terraform.io/providers/hashicorp/google/6.13.0/docs/resources/compute_reservation google_compute_reservation} 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 ComputeReservationConfig
*/
constructor(scope, id, config) {
super(scope, id, {
terraformResourceType: 'google_compute_reservation',
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
});
// share_settings - computed: false, optional: true, required: false
this._shareSettings = new ComputeReservationShareSettingsOutputReference(this, "share_settings");
// specific_reservation - computed: false, optional: false, required: true
this._specificReservation = new ComputeReservationSpecificReservationOutputReference(this, "specific_reservation");
// timeouts - computed: false, optional: true, required: false
this._timeouts = new ComputeReservationTimeoutsOutputReference(this, "timeouts");
this._description = config.description;
this._id = config.id;
this._name = config.name;
this._project = config.project;
this._specificReservationRequired = config.specificReservationRequired;
this._zone = config.zone;
this._shareSettings.internalValue = config.shareSettings;
this._specificReservation.internalValue = config.specificReservation;
this._timeouts.internalValue = config.timeouts;
}
// ==========
// ATTRIBUTES
// ==========
// commitment - computed: true, optional: false, required: false
get commitment() {
return this.getStringAttribute('commitment');
}
// 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;
}
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 name() {
return this.getStringAttribute('name');
}
set name(value) {
this._name = value;
}
// Temporarily expose input value. Use with caution.
get nameInput() {
return this._name;
}
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;
}
// self_link - computed: true, optional: false, required: false
get selfLink() {
return this.getStringAttribute('self_link');
}
get specificReservationRequired() {
return this.getBooleanAttribute('specific_reservation_required');
}
set specificReservationRequired(value) {
this._specificReservationRequired = value;
}
resetSpecificReservationRequired() {
this._specificReservationRequired = undefined;
}
// Temporarily expose input value. Use with caution.
get specificReservationRequiredInput() {
return this._specificReservationRequired;
}
// status - computed: true, optional: false, required: false
get status() {
return this.getStringAttribute('status');
}
get zone() {
return this.getStringAttribute('zone');
}
set zone(value) {
this._zone = value;
}
// Temporarily expose input value. Use with caution.
get zoneInput() {
return this._zone;
}
get shareSettings() {
return this._shareSettings;
}
putShareSettings(value) {
this._shareSettings.internalValue = value;
}
resetShareSettings() {
this._shareSettings.internalValue = undefined;
}
// Temporarily expose input value. Use with caution.
get shareSettingsInput() {
return this._shareSettings.internalValue;
}
get specificReservation() {
return this._specificReservation;
}
putSpecificReservation(value) {
this._specificReservation.internalValue = value;
}
// Temporarily expose input value. Use with caution.
get specificReservationInput() {
return this._specificReservation.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 {
description: cdktf.stringToTerraform(this._description),
id: cdktf.stringToTerraform(this._id),
name: cdktf.stringToTerraform(this._name),
project: cdktf.stringToTerraform(this._project),
specific_reservation_required: cdktf.booleanToTerraform(this._specificReservationRequired),
zone: cdktf.stringToTerraform(this._zone),
share_settings: computeReservationShareSettingsToTerraform(this._shareSettings.internalValue),
specific_reservation: computeReservationSpecificReservationToTerraform(this._specificReservation.internalValue),
timeouts: computeReservationTimeoutsToTerraform(this._timeouts.internalValue),
};
}
synthesizeHclAttributes() {
const attrs = {
description: {
value: cdktf.stringToHclTerraform(this._description),
isBlock: false,
type: "simple",
storageClassType: "string",
},
id: {
value: cdktf.stringToHclTerraform(this._id),
isBlock: false,
type: "simple",
storageClassType: "string",
},
name: {
value: cdktf.stringToHclTerraform(this._name),
isBlock: false,
type: "simple",
storageClassType: "string",
},
project: {
value: cdktf.stringToHclTerraform(this._project),
isBlock: false,
type: "simple",
storageClassType: "string",
},
specific_reservation_required: {
value: cdktf.booleanToHclTerraform(this._specificReservationRequired),
isBlock: false,
type: "simple",
storageClassType: "boolean",
},
zone: {
value: cdktf.stringToHclTerraform(this._zone),
isBlock: false,
type: "simple",
storageClassType: "string",
},
sh