UNPKG

@cdktf/provider-azurerm

Version:

Prebuilt azurerm Provider for Terraform CDK (cdktf)

1,221 lines 184 kB
"use strict"; var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l; Object.defineProperty(exports, "__esModule", { value: true }); exports.MonitorDiagnosticSetting = exports.MonitorDiagnosticSettingTimeoutsOutputReference = exports.monitorDiagnosticSettingTimeoutsToHclTerraform = exports.monitorDiagnosticSettingTimeoutsToTerraform = exports.MonitorDiagnosticSettingMetricList = exports.MonitorDiagnosticSettingMetricOutputReference = exports.monitorDiagnosticSettingMetricToHclTerraform = exports.monitorDiagnosticSettingMetricToTerraform = exports.MonitorDiagnosticSettingMetricRetentionPolicyOutputReference = exports.monitorDiagnosticSettingMetricRetentionPolicyToHclTerraform = exports.monitorDiagnosticSettingMetricRetentionPolicyToTerraform = exports.MonitorDiagnosticSettingLogList = exports.MonitorDiagnosticSettingLogOutputReference = exports.monitorDiagnosticSettingLogToHclTerraform = exports.monitorDiagnosticSettingLogToTerraform = exports.MonitorDiagnosticSettingLogRetentionPolicyOutputReference = exports.monitorDiagnosticSettingLogRetentionPolicyToHclTerraform = exports.monitorDiagnosticSettingLogRetentionPolicyToTerraform = exports.MonitorDiagnosticSettingEnabledLogList = exports.MonitorDiagnosticSettingEnabledLogOutputReference = exports.monitorDiagnosticSettingEnabledLogToHclTerraform = exports.monitorDiagnosticSettingEnabledLogToTerraform = exports.MonitorDiagnosticSettingEnabledLogRetentionPolicyOutputReference = exports.monitorDiagnosticSettingEnabledLogRetentionPolicyToHclTerraform = exports.monitorDiagnosticSettingEnabledLogRetentionPolicyToTerraform = void 0; const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti"); const cdktf = require("cdktf"); function monitorDiagnosticSettingEnabledLogRetentionPolicyToTerraform(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 { days: cdktf.numberToTerraform(struct.days), enabled: cdktf.booleanToTerraform(struct.enabled), }; } exports.monitorDiagnosticSettingEnabledLogRetentionPolicyToTerraform = monitorDiagnosticSettingEnabledLogRetentionPolicyToTerraform; function monitorDiagnosticSettingEnabledLogRetentionPolicyToHclTerraform(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 = { days: { value: cdktf.numberToHclTerraform(struct.days), isBlock: false, type: "simple", storageClassType: "number", }, enabled: { value: cdktf.booleanToHclTerraform(struct.enabled), isBlock: false, type: "simple", storageClassType: "boolean", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } exports.monitorDiagnosticSettingEnabledLogRetentionPolicyToHclTerraform = monitorDiagnosticSettingEnabledLogRetentionPolicyToHclTerraform; class MonitorDiagnosticSettingEnabledLogRetentionPolicyOutputReference 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._days !== undefined) { hasAnyValues = true; internalValueResult.days = this._days; } if (this._enabled !== undefined) { hasAnyValues = true; internalValueResult.enabled = this._enabled; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._days = undefined; this._enabled = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._days = value.days; this._enabled = value.enabled; } } get days() { return this.getNumberAttribute('days'); } set days(value) { this._days = value; } resetDays() { this._days = undefined; } // Temporarily expose input value. Use with caution. get daysInput() { return this._days; } get enabled() { return this.getBooleanAttribute('enabled'); } set enabled(value) { this._enabled = value; } // Temporarily expose input value. Use with caution. get enabledInput() { return this._enabled; } } exports.MonitorDiagnosticSettingEnabledLogRetentionPolicyOutputReference = MonitorDiagnosticSettingEnabledLogRetentionPolicyOutputReference; _a = JSII_RTTI_SYMBOL_1; MonitorDiagnosticSettingEnabledLogRetentionPolicyOutputReference[_a] = { fqn: "@cdktf/provider-azurerm.monitorDiagnosticSetting.MonitorDiagnosticSettingEnabledLogRetentionPolicyOutputReference", version: "12.27.0" }; function monitorDiagnosticSettingEnabledLogToTerraform(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 { category: cdktf.stringToTerraform(struct.category), category_group: cdktf.stringToTerraform(struct.categoryGroup), retention_policy: monitorDiagnosticSettingEnabledLogRetentionPolicyToTerraform(struct.retentionPolicy), }; } exports.monitorDiagnosticSettingEnabledLogToTerraform = monitorDiagnosticSettingEnabledLogToTerraform; function monitorDiagnosticSettingEnabledLogToHclTerraform(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 = { category: { value: cdktf.stringToHclTerraform(struct.category), isBlock: false, type: "simple", storageClassType: "string", }, category_group: { value: cdktf.stringToHclTerraform(struct.categoryGroup), isBlock: false, type: "simple", storageClassType: "string", }, retention_policy: { value: monitorDiagnosticSettingEnabledLogRetentionPolicyToHclTerraform(struct.retentionPolicy), isBlock: true, type: "list", storageClassType: "MonitorDiagnosticSettingEnabledLogRetentionPolicyList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } exports.monitorDiagnosticSettingEnabledLogToHclTerraform = monitorDiagnosticSettingEnabledLogToHclTerraform; class MonitorDiagnosticSettingEnabledLogOutputReference 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; // retention_policy - computed: false, optional: true, required: false this._retentionPolicy = new MonitorDiagnosticSettingEnabledLogRetentionPolicyOutputReference(this, "retention_policy"); } get internalValue() { if (this.resolvableValue) { return this.resolvableValue; } let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._category !== undefined) { hasAnyValues = true; internalValueResult.category = this._category; } if (this._categoryGroup !== undefined) { hasAnyValues = true; internalValueResult.categoryGroup = this._categoryGroup; } if (this._retentionPolicy?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.retentionPolicy = this._retentionPolicy?.internalValue; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this.resolvableValue = undefined; this._category = undefined; this._categoryGroup = undefined; this._retentionPolicy.internalValue = 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._category = value.category; this._categoryGroup = value.categoryGroup; this._retentionPolicy.internalValue = value.retentionPolicy; } } get category() { return this.getStringAttribute('category'); } set category(value) { this._category = value; } resetCategory() { this._category = undefined; } // Temporarily expose input value. Use with caution. get categoryInput() { return this._category; } get categoryGroup() { return this.getStringAttribute('category_group'); } set categoryGroup(value) { this._categoryGroup = value; } resetCategoryGroup() { this._categoryGroup = undefined; } // Temporarily expose input value. Use with caution. get categoryGroupInput() { return this._categoryGroup; } get retentionPolicy() { return this._retentionPolicy; } putRetentionPolicy(value) { this._retentionPolicy.internalValue = value; } resetRetentionPolicy() { this._retentionPolicy.internalValue = undefined; } // Temporarily expose input value. Use with caution. get retentionPolicyInput() { return this._retentionPolicy.internalValue; } } exports.MonitorDiagnosticSettingEnabledLogOutputReference = MonitorDiagnosticSettingEnabledLogOutputReference; _b = JSII_RTTI_SYMBOL_1; MonitorDiagnosticSettingEnabledLogOutputReference[_b] = { fqn: "@cdktf/provider-azurerm.monitorDiagnosticSetting.MonitorDiagnosticSettingEnabledLogOutputReference", version: "12.27.0" }; class MonitorDiagnosticSettingEnabledLogList 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 MonitorDiagnosticSettingEnabledLogOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); } } exports.MonitorDiagnosticSettingEnabledLogList = MonitorDiagnosticSettingEnabledLogList; _c = JSII_RTTI_SYMBOL_1; MonitorDiagnosticSettingEnabledLogList[_c] = { fqn: "@cdktf/provider-azurerm.monitorDiagnosticSetting.MonitorDiagnosticSettingEnabledLogList", version: "12.27.0" }; function monitorDiagnosticSettingLogRetentionPolicyToTerraform(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 { days: cdktf.numberToTerraform(struct.days), enabled: cdktf.booleanToTerraform(struct.enabled), }; } exports.monitorDiagnosticSettingLogRetentionPolicyToTerraform = monitorDiagnosticSettingLogRetentionPolicyToTerraform; function monitorDiagnosticSettingLogRetentionPolicyToHclTerraform(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 = { days: { value: cdktf.numberToHclTerraform(struct.days), isBlock: false, type: "simple", storageClassType: "number", }, enabled: { value: cdktf.booleanToHclTerraform(struct.enabled), isBlock: false, type: "simple", storageClassType: "boolean", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } exports.monitorDiagnosticSettingLogRetentionPolicyToHclTerraform = monitorDiagnosticSettingLogRetentionPolicyToHclTerraform; class MonitorDiagnosticSettingLogRetentionPolicyOutputReference 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._days !== undefined) { hasAnyValues = true; internalValueResult.days = this._days; } if (this._enabled !== undefined) { hasAnyValues = true; internalValueResult.enabled = this._enabled; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._days = undefined; this._enabled = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._days = value.days; this._enabled = value.enabled; } } get days() { return this.getNumberAttribute('days'); } set days(value) { this._days = value; } resetDays() { this._days = undefined; } // Temporarily expose input value. Use with caution. get daysInput() { return this._days; } get enabled() { return this.getBooleanAttribute('enabled'); } set enabled(value) { this._enabled = value; } // Temporarily expose input value. Use with caution. get enabledInput() { return this._enabled; } } exports.MonitorDiagnosticSettingLogRetentionPolicyOutputReference = MonitorDiagnosticSettingLogRetentionPolicyOutputReference; _d = JSII_RTTI_SYMBOL_1; MonitorDiagnosticSettingLogRetentionPolicyOutputReference[_d] = { fqn: "@cdktf/provider-azurerm.monitorDiagnosticSetting.MonitorDiagnosticSettingLogRetentionPolicyOutputReference", version: "12.27.0" }; function monitorDiagnosticSettingLogToTerraform(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 { category: cdktf.stringToTerraform(struct.category), category_group: cdktf.stringToTerraform(struct.categoryGroup), enabled: cdktf.booleanToTerraform(struct.enabled), retention_policy: monitorDiagnosticSettingLogRetentionPolicyToTerraform(struct.retentionPolicy), }; } exports.monitorDiagnosticSettingLogToTerraform = monitorDiagnosticSettingLogToTerraform; function monitorDiagnosticSettingLogToHclTerraform(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 = { category: { value: cdktf.stringToHclTerraform(struct.category), isBlock: false, type: "simple", storageClassType: "string", }, category_group: { value: cdktf.stringToHclTerraform(struct.categoryGroup), isBlock: false, type: "simple", storageClassType: "string", }, enabled: { value: cdktf.booleanToHclTerraform(struct.enabled), isBlock: false, type: "simple", storageClassType: "boolean", }, retention_policy: { value: monitorDiagnosticSettingLogRetentionPolicyToHclTerraform(struct.retentionPolicy), isBlock: true, type: "list", storageClassType: "MonitorDiagnosticSettingLogRetentionPolicyList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } exports.monitorDiagnosticSettingLogToHclTerraform = monitorDiagnosticSettingLogToHclTerraform; class MonitorDiagnosticSettingLogOutputReference 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; // retention_policy - computed: false, optional: true, required: false this._retentionPolicy = new MonitorDiagnosticSettingLogRetentionPolicyOutputReference(this, "retention_policy"); } get internalValue() { if (this.resolvableValue) { return this.resolvableValue; } let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._category !== undefined) { hasAnyValues = true; internalValueResult.category = this._category; } if (this._categoryGroup !== undefined) { hasAnyValues = true; internalValueResult.categoryGroup = this._categoryGroup; } if (this._enabled !== undefined) { hasAnyValues = true; internalValueResult.enabled = this._enabled; } if (this._retentionPolicy?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.retentionPolicy = this._retentionPolicy?.internalValue; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this.resolvableValue = undefined; this._category = undefined; this._categoryGroup = undefined; this._enabled = undefined; this._retentionPolicy.internalValue = 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._category = value.category; this._categoryGroup = value.categoryGroup; this._enabled = value.enabled; this._retentionPolicy.internalValue = value.retentionPolicy; } } get category() { return this.getStringAttribute('category'); } set category(value) { this._category = value; } resetCategory() { this._category = undefined; } // Temporarily expose input value. Use with caution. get categoryInput() { return this._category; } get categoryGroup() { return this.getStringAttribute('category_group'); } set categoryGroup(value) { this._categoryGroup = value; } resetCategoryGroup() { this._categoryGroup = undefined; } // Temporarily expose input value. Use with caution. get categoryGroupInput() { return this._categoryGroup; } get enabled() { return this.getBooleanAttribute('enabled'); } set enabled(value) { this._enabled = value; } resetEnabled() { this._enabled = undefined; } // Temporarily expose input value. Use with caution. get enabledInput() { return this._enabled; } get retentionPolicy() { return this._retentionPolicy; } putRetentionPolicy(value) { this._retentionPolicy.internalValue = value; } resetRetentionPolicy() { this._retentionPolicy.internalValue = undefined; } // Temporarily expose input value. Use with caution. get retentionPolicyInput() { return this._retentionPolicy.internalValue; } } exports.MonitorDiagnosticSettingLogOutputReference = MonitorDiagnosticSettingLogOutputReference; _e = JSII_RTTI_SYMBOL_1; MonitorDiagnosticSettingLogOutputReference[_e] = { fqn: "@cdktf/provider-azurerm.monitorDiagnosticSetting.MonitorDiagnosticSettingLogOutputReference", version: "12.27.0" }; class MonitorDiagnosticSettingLogList 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 MonitorDiagnosticSettingLogOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); } } exports.MonitorDiagnosticSettingLogList = MonitorDiagnosticSettingLogList; _f = JSII_RTTI_SYMBOL_1; MonitorDiagnosticSettingLogList[_f] = { fqn: "@cdktf/provider-azurerm.monitorDiagnosticSetting.MonitorDiagnosticSettingLogList", version: "12.27.0" }; function monitorDiagnosticSettingMetricRetentionPolicyToTerraform(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 { days: cdktf.numberToTerraform(struct.days), enabled: cdktf.booleanToTerraform(struct.enabled), }; } exports.monitorDiagnosticSettingMetricRetentionPolicyToTerraform = monitorDiagnosticSettingMetricRetentionPolicyToTerraform; function monitorDiagnosticSettingMetricRetentionPolicyToHclTerraform(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 = { days: { value: cdktf.numberToHclTerraform(struct.days), isBlock: false, type: "simple", storageClassType: "number", }, enabled: { value: cdktf.booleanToHclTerraform(struct.enabled), isBlock: false, type: "simple", storageClassType: "boolean", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } exports.monitorDiagnosticSettingMetricRetentionPolicyToHclTerraform = monitorDiagnosticSettingMetricRetentionPolicyToHclTerraform; class MonitorDiagnosticSettingMetricRetentionPolicyOutputReference 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._days !== undefined) { hasAnyValues = true; internalValueResult.days = this._days; } if (this._enabled !== undefined) { hasAnyValues = true; internalValueResult.enabled = this._enabled; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._days = undefined; this._enabled = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._days = value.days; this._enabled = value.enabled; } } get days() { return this.getNumberAttribute('days'); } set days(value) { this._days = value; } resetDays() { this._days = undefined; } // Temporarily expose input value. Use with caution. get daysInput() { return this._days; } get enabled() { return this.getBooleanAttribute('enabled'); } set enabled(value) { this._enabled = value; } // Temporarily expose input value. Use with caution. get enabledInput() { return this._enabled; } } exports.MonitorDiagnosticSettingMetricRetentionPolicyOutputReference = MonitorDiagnosticSettingMetricRetentionPolicyOutputReference; _g = JSII_RTTI_SYMBOL_1; MonitorDiagnosticSettingMetricRetentionPolicyOutputReference[_g] = { fqn: "@cdktf/provider-azurerm.monitorDiagnosticSetting.MonitorDiagnosticSettingMetricRetentionPolicyOutputReference", version: "12.27.0" }; function monitorDiagnosticSettingMetricToTerraform(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 { category: cdktf.stringToTerraform(struct.category), enabled: cdktf.booleanToTerraform(struct.enabled), retention_policy: monitorDiagnosticSettingMetricRetentionPolicyToTerraform(struct.retentionPolicy), }; } exports.monitorDiagnosticSettingMetricToTerraform = monitorDiagnosticSettingMetricToTerraform; function monitorDiagnosticSettingMetricToHclTerraform(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 = { category: { value: cdktf.stringToHclTerraform(struct.category), isBlock: false, type: "simple", storageClassType: "string", }, enabled: { value: cdktf.booleanToHclTerraform(struct.enabled), isBlock: false, type: "simple", storageClassType: "boolean", }, retention_policy: { value: monitorDiagnosticSettingMetricRetentionPolicyToHclTerraform(struct.retentionPolicy), isBlock: true, type: "list", storageClassType: "MonitorDiagnosticSettingMetricRetentionPolicyList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } exports.monitorDiagnosticSettingMetricToHclTerraform = monitorDiagnosticSettingMetricToHclTerraform; class MonitorDiagnosticSettingMetricOutputReference 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; // retention_policy - computed: false, optional: true, required: false this._retentionPolicy = new MonitorDiagnosticSettingMetricRetentionPolicyOutputReference(this, "retention_policy"); } get internalValue() { if (this.resolvableValue) { return this.resolvableValue; } let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._category !== undefined) { hasAnyValues = true; internalValueResult.category = this._category; } if (this._enabled !== undefined) { hasAnyValues = true; internalValueResult.enabled = this._enabled; } if (this._retentionPolicy?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.retentionPolicy = this._retentionPolicy?.internalValue; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this.resolvableValue = undefined; this._category = undefined; this._enabled = undefined; this._retentionPolicy.internalValue = 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._category = value.category; this._enabled = value.enabled; this._retentionPolicy.internalValue = value.retentionPolicy; } } get category() { return this.getStringAttribute('category'); } set category(value) { this._category = value; } // Temporarily expose input value. Use with caution. get categoryInput() { return this._category; } get enabled() { return this.getBooleanAttribute('enabled'); } set enabled(value) { this._enabled = value; } resetEnabled() { this._enabled = undefined; } // Temporarily expose input value. Use with caution. get enabledInput() { return this._enabled; } get retentionPolicy() { return this._retentionPolicy; } putRetentionPolicy(value) { this._retentionPolicy.internalValue = value; } resetRetentionPolicy() { this._retentionPolicy.internalValue = undefined; } // Temporarily expose input value. Use with caution. get retentionPolicyInput() { return this._retentionPolicy.internalValue; } } exports.MonitorDiagnosticSettingMetricOutputReference = MonitorDiagnosticSettingMetricOutputReference; _h = JSII_RTTI_SYMBOL_1; MonitorDiagnosticSettingMetricOutputReference[_h] = { fqn: "@cdktf/provider-azurerm.monitorDiagnosticSetting.MonitorDiagnosticSettingMetricOutputReference", version: "12.27.0" }; class MonitorDiagnosticSettingMetricList 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 MonitorDiagnosticSettingMetricOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); } } exports.MonitorDiagnosticSettingMetricList = MonitorDiagnosticSettingMetricList; _j = JSII_RTTI_SYMBOL_1; MonitorDiagnosticSettingMetricList[_j] = { fqn: "@cdktf/provider-azurerm.monitorDiagnosticSetting.MonitorDiagnosticSettingMetricList", version: "12.27.0" }; function monitorDiagnosticSettingTimeoutsToTerraform(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), read: cdktf.stringToTerraform(struct.read), update: cdktf.stringToTerraform(struct.update), }; } exports.monitorDiagnosticSettingTimeoutsToTerraform = monitorDiagnosticSettingTimeoutsToTerraform; function monitorDiagnosticSettingTimeoutsToHclTerraform(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", }, read: { value: cdktf.stringToHclTerraform(struct.read), 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.monitorDiagnosticSettingTimeoutsToHclTerraform = monitorDiagnosticSettingTimeoutsToHclTerraform; class MonitorDiagnosticSettingTimeoutsOutputReference 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._read !== undefined) { hasAnyValues = true; internalValueResult.read = this._read; } 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._read = 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._read = value.read; 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 read() { return this.getStringAttribute('read'); } set read(value) { this._read = value; } resetRead() { this._read = undefined; } // Temporarily expose input value. Use with caution. get readInput() { return this._read; } 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.MonitorDiagnosticSettingTimeoutsOutputReference = MonitorDiagnosticSettingTimeoutsOutputReference; _k = JSII_RTTI_SYMBOL_1; MonitorDiagnosticSettingTimeoutsOutputReference[_k] = { fqn: "@cdktf/provider-azurerm.monitorDiagnosticSetting.MonitorDiagnosticSettingTimeoutsOutputReference", version: "12.27.0" }; /** * Represents a {@link https://registry.terraform.io/providers/hashicorp/azurerm/3.116.0/docs/resources/monitor_diagnostic_setting azurerm_monitor_diagnostic_setting} */ class MonitorDiagnosticSetting extends cdktf.TerraformResource { // ============== // STATIC Methods // ============== /** * Generates CDKTF code for importing a MonitorDiagnosticSetting 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 MonitorDiagnosticSetting to import * @param importFromId The id of the existing MonitorDiagnosticSetting that should be imported. Refer to the {@link https://registry.terraform.io/providers/hashicorp/azurerm/3.116.0/docs/resources/monitor_diagnostic_setting#import import section} in the documentation of this resource for the id to use * @param provider? Optional instance of the provider where the MonitorDiagnosticSetting to import is found */ static generateConfigForImport(scope, importToId, importFromId, provider) { return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "azurerm_monitor_diagnostic_setting", importId: importFromId, provider }); } // =========== // INITIALIZER // =========== /** * Create a new {@link https://registry.terraform.io/providers/hashicorp/azurerm/3.116.0/docs/resources/monitor_diagnostic_setting azurerm_monitor_diagnostic_setting} 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 MonitorDiagnosticSettingConfig */ constructor(scope, id, config) { super(scope, id, { terraformResourceType: 'azurerm_monitor_diagnostic_setting', terraformGeneratorMetadata: { providerName: 'azurerm', providerVersion: '3.116.0', providerVersionConstraint: '~> 3.10' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle, provisioners: config.provisioners, connection: config.connection, forEach: config.forEach }); // enabled_log - computed: false, optional: true, required: false this._enabledLog = new MonitorDiagnosticSettingEnabledLogList(this, "enabled_log", true); // log - computed: false, optional: true, required: false this._log = new MonitorDiagnosticSettingLogList(this, "log", true); // metric - computed: false, optional: true, required: false this._metric = new MonitorDiagnosticSettingMetricList(this, "metric", true); // timeouts - computed: false, optional: true, required: false this._timeouts = new MonitorDiagnosticSettingTimeoutsOutputReference(this, "timeouts"); this._eventhubAuthorizationRuleId = config.eventhubAuthorizationRuleId; this._eventhubName = config.eventhubName; this._id = config.id; this._logAnalyticsDestinationType = config.logAnalyticsDestinationType; this._logAnalyticsWorkspaceId = config.logAnalyticsWorkspaceId; this._name = config.name; this._partnerSolutionId = config.partnerSolutionId; this._storageAccountId = config.storageAccountId; this._targetResourceId = config.targetResourceId; this._enabledLog.internalValue = config.enabledLog; this._log.internalValue = config.log; this._metric.internalValue = config.metric; this._timeouts.internalValue = config.timeouts; } get eventhubAuthorizationRuleId() { return this.getStringAttribute('eventhub_authorization_rule_id'); } set eventhubAuthorizationRuleId(value) { this._eventhubAuthorizationRuleId = value; } resetEventhubAuthorizationRuleId() { this._eventhubAuthorizationRuleId = undefined; } // Temporarily expose input value. Use with caution. get eventhubAuthorizationRuleIdInput() { return this._eventhubAuthorizationRuleId; } get eventhubName() { return this.getStringAttribute('eventhub_name'); } set eventhubName(value) { this._eventhubName = value; } resetEventhubName() { this._eventhubName = undefined; } // Temporarily expose input value. Use with caution. get eventhubNameInput() { return this._eventhubName; } 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 logAnalyticsDestinationType() { return this.getStringAttribute('log_analytics_destination_type'); } set logAnalyticsDestinationType(value) { this._logAnalyticsDestinationType = value; } resetLogAnalyticsDestinationType() { this._logAnalyticsDestinationType = undefined; } // Temporarily expose input value. Use with caution. get logAnalyticsDestinationTypeInput() { return this._logAnalyticsDestinationType; } get logAnalyticsWorkspaceId() { return this.getStringAttribute('log_analytics_workspace_id'); } set logAnalyticsWorkspaceId(value) { this._logAnalyticsWorkspaceId = value; } resetLogAnalyticsWorkspaceId() { this._logAnalyticsWorkspaceId = undefined; } // Temporarily expose input value. Use with caution. get logAnalyticsWorkspaceIdInput() { return this._logAnalyticsWorkspaceId; } 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 partnerSolutionId() { return this.getStringAttribute('partner_solution_id'); } set partnerSolutionId(value) { this._partnerSolutionId = value; } resetPartnerSolutionId() { this._partnerSolutionId = undefined; } // Temporarily expose input value. Use with caution. get partnerSolutionIdInput() { return this._partnerSolutionId; } get storageAccountId() { return this.getStringAttribute('storage_account_id'); } set storageAccountId(value) { this._storageAccountId = value; } resetStorageAccountId() { this._storageAccountId = undefined; } // Temporarily expose input value. Use with caution. get storageAccountIdInput() { return this._storageAccountId; } get targetResourceId() { return this.getStringAttribute('target_resource_id'); } set targetResourceId(value) { this._targetResourceId = value; } // Temporarily expose input value. Use with caution. get targetResourceIdInput() { return this._targetResourceId; } get enabledLog() { return this._enabledLog; } putEnabledLog(value) { this._enabledLog.internalValue = value; } resetEnabledLog() { this._enabledLog.internalValue = undefined; } // Temporarily expose input value. Use with caution. get enabledLogInput() { return this._enabledLog.internalValue; } get log() { return this._log; } putLog(value) { this._log.internalValue = value; } resetLog() { this._log.internalValue = undefined; } // Temporarily expose input value. Use with caution. get logInput() { return this._log.internalValue; } get metric() { return this._metric; } putMetric(value) { this._metric.internalValue = value; } resetMetric() { this._metric.internalValue = undefined; } // Temporarily expose input value. Use with caution. get metricInput() { return this._metric.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 { eventhub_authorization_rule_id: cdktf.stringToTerraform(this._eventhubAuthorizationRuleId), eventhub_name: cdktf.stringToTerraform(this._eventhubName), id: cdktf.stringToTerraform(this._id), log_analytics_destination_type: cdktf.stringToTerraform(this._logAnalyticsDestinationType), log_analytics_workspace_id: cdktf.stringToTerraform(this._logAnalyticsWorkspaceId), name: cdktf.stringToTerraform(this._name), partner_solution_id: cdktf.stringToTerraform(this._partnerSolutionId), storage_account_id: cdktf.stringToTerraform(this._storageAccountId), target_resource_id: cdktf.stringToTerraform(this._targetResourceId), enabled_log: cdktf.listMapper(monitorDiagnosti