UNPKG

@cdktf/provider-newrelic

Version:

Prebuilt newrelic Provider for Terraform CDK (cdktf)

1,180 lines • 183 kB
"use strict"; var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m; Object.defineProperty(exports, "__esModule", { value: true }); exports.Workload = exports.WorkloadStatusConfigStaticOutputReference = exports.WorkloadStatusConfigAutomaticOutputReference = exports.WorkloadStatusConfigAutomaticRuleList = exports.WorkloadStatusConfigAutomaticRuleOutputReference = exports.WorkloadStatusConfigAutomaticRuleRollupOutputReference = exports.WorkloadStatusConfigAutomaticRuleNrqlQueryList = exports.WorkloadStatusConfigAutomaticRuleNrqlQueryOutputReference = exports.WorkloadStatusConfigAutomaticRemainingEntitiesRuleOutputReference = exports.WorkloadStatusConfigAutomaticRemainingEntitiesRuleRemainingEntitiesRuleRollupOutputReference = exports.WorkloadEntitySearchQueryList = exports.WorkloadEntitySearchQueryOutputReference = void 0; exports.workloadEntitySearchQueryToTerraform = workloadEntitySearchQueryToTerraform; exports.workloadEntitySearchQueryToHclTerraform = workloadEntitySearchQueryToHclTerraform; exports.workloadStatusConfigAutomaticRemainingEntitiesRuleRemainingEntitiesRuleRollupToTerraform = workloadStatusConfigAutomaticRemainingEntitiesRuleRemainingEntitiesRuleRollupToTerraform; exports.workloadStatusConfigAutomaticRemainingEntitiesRuleRemainingEntitiesRuleRollupToHclTerraform = workloadStatusConfigAutomaticRemainingEntitiesRuleRemainingEntitiesRuleRollupToHclTerraform; exports.workloadStatusConfigAutomaticRemainingEntitiesRuleToTerraform = workloadStatusConfigAutomaticRemainingEntitiesRuleToTerraform; exports.workloadStatusConfigAutomaticRemainingEntitiesRuleToHclTerraform = workloadStatusConfigAutomaticRemainingEntitiesRuleToHclTerraform; exports.workloadStatusConfigAutomaticRuleNrqlQueryToTerraform = workloadStatusConfigAutomaticRuleNrqlQueryToTerraform; exports.workloadStatusConfigAutomaticRuleNrqlQueryToHclTerraform = workloadStatusConfigAutomaticRuleNrqlQueryToHclTerraform; exports.workloadStatusConfigAutomaticRuleRollupToTerraform = workloadStatusConfigAutomaticRuleRollupToTerraform; exports.workloadStatusConfigAutomaticRuleRollupToHclTerraform = workloadStatusConfigAutomaticRuleRollupToHclTerraform; exports.workloadStatusConfigAutomaticRuleToTerraform = workloadStatusConfigAutomaticRuleToTerraform; exports.workloadStatusConfigAutomaticRuleToHclTerraform = workloadStatusConfigAutomaticRuleToHclTerraform; exports.workloadStatusConfigAutomaticToTerraform = workloadStatusConfigAutomaticToTerraform; exports.workloadStatusConfigAutomaticToHclTerraform = workloadStatusConfigAutomaticToHclTerraform; exports.workloadStatusConfigStaticToTerraform = workloadStatusConfigStaticToTerraform; exports.workloadStatusConfigStaticToHclTerraform = workloadStatusConfigStaticToHclTerraform; const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti"); const cdktf = require("cdktf"); function workloadEntitySearchQueryToTerraform(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 { query: cdktf.stringToTerraform(struct.query), }; } function workloadEntitySearchQueryToHclTerraform(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 = { query: { value: cdktf.stringToHclTerraform(struct.query), isBlock: false, type: "simple", storageClassType: "string", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class WorkloadEntitySearchQueryOutputReference 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._query !== undefined) { hasAnyValues = true; internalValueResult.query = this._query; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this.resolvableValue = undefined; this._query = 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._query = value.query; } } get query() { return this.getStringAttribute('query'); } set query(value) { this._query = value; } // Temporarily expose input value. Use with caution. get queryInput() { return this._query; } } exports.WorkloadEntitySearchQueryOutputReference = WorkloadEntitySearchQueryOutputReference; _a = JSII_RTTI_SYMBOL_1; WorkloadEntitySearchQueryOutputReference[_a] = { fqn: "@cdktf/provider-newrelic.workload.WorkloadEntitySearchQueryOutputReference", version: "12.28.0" }; class WorkloadEntitySearchQueryList 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 WorkloadEntitySearchQueryOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); } } exports.WorkloadEntitySearchQueryList = WorkloadEntitySearchQueryList; _b = JSII_RTTI_SYMBOL_1; WorkloadEntitySearchQueryList[_b] = { fqn: "@cdktf/provider-newrelic.workload.WorkloadEntitySearchQueryList", version: "12.28.0" }; function workloadStatusConfigAutomaticRemainingEntitiesRuleRemainingEntitiesRuleRollupToTerraform(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 { group_by: cdktf.stringToTerraform(struct.groupBy), strategy: cdktf.stringToTerraform(struct.strategy), threshold_type: cdktf.stringToTerraform(struct.thresholdType), threshold_value: cdktf.numberToTerraform(struct.thresholdValue), }; } function workloadStatusConfigAutomaticRemainingEntitiesRuleRemainingEntitiesRuleRollupToHclTerraform(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 = { group_by: { value: cdktf.stringToHclTerraform(struct.groupBy), isBlock: false, type: "simple", storageClassType: "string", }, strategy: { value: cdktf.stringToHclTerraform(struct.strategy), isBlock: false, type: "simple", storageClassType: "string", }, threshold_type: { value: cdktf.stringToHclTerraform(struct.thresholdType), isBlock: false, type: "simple", storageClassType: "string", }, threshold_value: { value: cdktf.numberToHclTerraform(struct.thresholdValue), isBlock: false, type: "simple", storageClassType: "number", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class WorkloadStatusConfigAutomaticRemainingEntitiesRuleRemainingEntitiesRuleRollupOutputReference 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._groupBy !== undefined) { hasAnyValues = true; internalValueResult.groupBy = this._groupBy; } if (this._strategy !== undefined) { hasAnyValues = true; internalValueResult.strategy = this._strategy; } if (this._thresholdType !== undefined) { hasAnyValues = true; internalValueResult.thresholdType = this._thresholdType; } if (this._thresholdValue !== undefined) { hasAnyValues = true; internalValueResult.thresholdValue = this._thresholdValue; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._groupBy = undefined; this._strategy = undefined; this._thresholdType = undefined; this._thresholdValue = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._groupBy = value.groupBy; this._strategy = value.strategy; this._thresholdType = value.thresholdType; this._thresholdValue = value.thresholdValue; } } get groupBy() { return this.getStringAttribute('group_by'); } set groupBy(value) { this._groupBy = value; } // Temporarily expose input value. Use with caution. get groupByInput() { return this._groupBy; } get strategy() { return this.getStringAttribute('strategy'); } set strategy(value) { this._strategy = value; } // Temporarily expose input value. Use with caution. get strategyInput() { return this._strategy; } get thresholdType() { return this.getStringAttribute('threshold_type'); } set thresholdType(value) { this._thresholdType = value; } resetThresholdType() { this._thresholdType = undefined; } // Temporarily expose input value. Use with caution. get thresholdTypeInput() { return this._thresholdType; } get thresholdValue() { return this.getNumberAttribute('threshold_value'); } set thresholdValue(value) { this._thresholdValue = value; } resetThresholdValue() { this._thresholdValue = undefined; } // Temporarily expose input value. Use with caution. get thresholdValueInput() { return this._thresholdValue; } } exports.WorkloadStatusConfigAutomaticRemainingEntitiesRuleRemainingEntitiesRuleRollupOutputReference = WorkloadStatusConfigAutomaticRemainingEntitiesRuleRemainingEntitiesRuleRollupOutputReference; _c = JSII_RTTI_SYMBOL_1; WorkloadStatusConfigAutomaticRemainingEntitiesRuleRemainingEntitiesRuleRollupOutputReference[_c] = { fqn: "@cdktf/provider-newrelic.workload.WorkloadStatusConfigAutomaticRemainingEntitiesRuleRemainingEntitiesRuleRollupOutputReference", version: "12.28.0" }; function workloadStatusConfigAutomaticRemainingEntitiesRuleToTerraform(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 { remaining_entities_rule_rollup: workloadStatusConfigAutomaticRemainingEntitiesRuleRemainingEntitiesRuleRollupToTerraform(struct.remainingEntitiesRuleRollup), }; } function workloadStatusConfigAutomaticRemainingEntitiesRuleToHclTerraform(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 = { remaining_entities_rule_rollup: { value: workloadStatusConfigAutomaticRemainingEntitiesRuleRemainingEntitiesRuleRollupToHclTerraform(struct.remainingEntitiesRuleRollup), isBlock: true, type: "set", storageClassType: "WorkloadStatusConfigAutomaticRemainingEntitiesRuleRemainingEntitiesRuleRollupList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class WorkloadStatusConfigAutomaticRemainingEntitiesRuleOutputReference 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; // remaining_entities_rule_rollup - computed: false, optional: false, required: true this._remainingEntitiesRuleRollup = new WorkloadStatusConfigAutomaticRemainingEntitiesRuleRemainingEntitiesRuleRollupOutputReference(this, "remaining_entities_rule_rollup"); } get internalValue() { let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._remainingEntitiesRuleRollup?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.remainingEntitiesRuleRollup = this._remainingEntitiesRuleRollup?.internalValue; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._remainingEntitiesRuleRollup.internalValue = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._remainingEntitiesRuleRollup.internalValue = value.remainingEntitiesRuleRollup; } } get remainingEntitiesRuleRollup() { return this._remainingEntitiesRuleRollup; } putRemainingEntitiesRuleRollup(value) { this._remainingEntitiesRuleRollup.internalValue = value; } // Temporarily expose input value. Use with caution. get remainingEntitiesRuleRollupInput() { return this._remainingEntitiesRuleRollup.internalValue; } } exports.WorkloadStatusConfigAutomaticRemainingEntitiesRuleOutputReference = WorkloadStatusConfigAutomaticRemainingEntitiesRuleOutputReference; _d = JSII_RTTI_SYMBOL_1; WorkloadStatusConfigAutomaticRemainingEntitiesRuleOutputReference[_d] = { fqn: "@cdktf/provider-newrelic.workload.WorkloadStatusConfigAutomaticRemainingEntitiesRuleOutputReference", version: "12.28.0" }; function workloadStatusConfigAutomaticRuleNrqlQueryToTerraform(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 { query: cdktf.stringToTerraform(struct.query), }; } function workloadStatusConfigAutomaticRuleNrqlQueryToHclTerraform(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 = { query: { value: cdktf.stringToHclTerraform(struct.query), isBlock: false, type: "simple", storageClassType: "string", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class WorkloadStatusConfigAutomaticRuleNrqlQueryOutputReference 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._query !== undefined) { hasAnyValues = true; internalValueResult.query = this._query; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this.resolvableValue = undefined; this._query = 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._query = value.query; } } get query() { return this.getStringAttribute('query'); } set query(value) { this._query = value; } // Temporarily expose input value. Use with caution. get queryInput() { return this._query; } } exports.WorkloadStatusConfigAutomaticRuleNrqlQueryOutputReference = WorkloadStatusConfigAutomaticRuleNrqlQueryOutputReference; _e = JSII_RTTI_SYMBOL_1; WorkloadStatusConfigAutomaticRuleNrqlQueryOutputReference[_e] = { fqn: "@cdktf/provider-newrelic.workload.WorkloadStatusConfigAutomaticRuleNrqlQueryOutputReference", version: "12.28.0" }; class WorkloadStatusConfigAutomaticRuleNrqlQueryList 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 WorkloadStatusConfigAutomaticRuleNrqlQueryOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); } } exports.WorkloadStatusConfigAutomaticRuleNrqlQueryList = WorkloadStatusConfigAutomaticRuleNrqlQueryList; _f = JSII_RTTI_SYMBOL_1; WorkloadStatusConfigAutomaticRuleNrqlQueryList[_f] = { fqn: "@cdktf/provider-newrelic.workload.WorkloadStatusConfigAutomaticRuleNrqlQueryList", version: "12.28.0" }; function workloadStatusConfigAutomaticRuleRollupToTerraform(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 { strategy: cdktf.stringToTerraform(struct.strategy), threshold_type: cdktf.stringToTerraform(struct.thresholdType), threshold_value: cdktf.numberToTerraform(struct.thresholdValue), }; } function workloadStatusConfigAutomaticRuleRollupToHclTerraform(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 = { strategy: { value: cdktf.stringToHclTerraform(struct.strategy), isBlock: false, type: "simple", storageClassType: "string", }, threshold_type: { value: cdktf.stringToHclTerraform(struct.thresholdType), isBlock: false, type: "simple", storageClassType: "string", }, threshold_value: { value: cdktf.numberToHclTerraform(struct.thresholdValue), isBlock: false, type: "simple", storageClassType: "number", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class WorkloadStatusConfigAutomaticRuleRollupOutputReference 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._strategy !== undefined) { hasAnyValues = true; internalValueResult.strategy = this._strategy; } if (this._thresholdType !== undefined) { hasAnyValues = true; internalValueResult.thresholdType = this._thresholdType; } if (this._thresholdValue !== undefined) { hasAnyValues = true; internalValueResult.thresholdValue = this._thresholdValue; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._strategy = undefined; this._thresholdType = undefined; this._thresholdValue = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._strategy = value.strategy; this._thresholdType = value.thresholdType; this._thresholdValue = value.thresholdValue; } } get strategy() { return this.getStringAttribute('strategy'); } set strategy(value) { this._strategy = value; } // Temporarily expose input value. Use with caution. get strategyInput() { return this._strategy; } get thresholdType() { return this.getStringAttribute('threshold_type'); } set thresholdType(value) { this._thresholdType = value; } resetThresholdType() { this._thresholdType = undefined; } // Temporarily expose input value. Use with caution. get thresholdTypeInput() { return this._thresholdType; } get thresholdValue() { return this.getNumberAttribute('threshold_value'); } set thresholdValue(value) { this._thresholdValue = value; } resetThresholdValue() { this._thresholdValue = undefined; } // Temporarily expose input value. Use with caution. get thresholdValueInput() { return this._thresholdValue; } } exports.WorkloadStatusConfigAutomaticRuleRollupOutputReference = WorkloadStatusConfigAutomaticRuleRollupOutputReference; _g = JSII_RTTI_SYMBOL_1; WorkloadStatusConfigAutomaticRuleRollupOutputReference[_g] = { fqn: "@cdktf/provider-newrelic.workload.WorkloadStatusConfigAutomaticRuleRollupOutputReference", version: "12.28.0" }; function workloadStatusConfigAutomaticRuleToTerraform(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 { entity_guids: cdktf.listMapper(cdktf.stringToTerraform, false)(struct.entityGuids), nrql_query: cdktf.listMapper(workloadStatusConfigAutomaticRuleNrqlQueryToTerraform, true)(struct.nrqlQuery), rollup: workloadStatusConfigAutomaticRuleRollupToTerraform(struct.rollup), }; } function workloadStatusConfigAutomaticRuleToHclTerraform(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 = { entity_guids: { value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct.entityGuids), isBlock: false, type: "set", storageClassType: "stringList", }, nrql_query: { value: cdktf.listMapperHcl(workloadStatusConfigAutomaticRuleNrqlQueryToHclTerraform, true)(struct.nrqlQuery), isBlock: true, type: "set", storageClassType: "WorkloadStatusConfigAutomaticRuleNrqlQueryList", }, rollup: { value: workloadStatusConfigAutomaticRuleRollupToHclTerraform(struct.rollup), isBlock: true, type: "set", storageClassType: "WorkloadStatusConfigAutomaticRuleRollupList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class WorkloadStatusConfigAutomaticRuleOutputReference 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; // nrql_query - computed: false, optional: true, required: false this._nrqlQuery = new WorkloadStatusConfigAutomaticRuleNrqlQueryList(this, "nrql_query", true); // rollup - computed: false, optional: false, required: true this._rollup = new WorkloadStatusConfigAutomaticRuleRollupOutputReference(this, "rollup"); } get internalValue() { if (this.resolvableValue) { return this.resolvableValue; } let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._entityGuids !== undefined) { hasAnyValues = true; internalValueResult.entityGuids = this._entityGuids; } if (this._nrqlQuery?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.nrqlQuery = this._nrqlQuery?.internalValue; } if (this._rollup?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.rollup = this._rollup?.internalValue; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this.resolvableValue = undefined; this._entityGuids = undefined; this._nrqlQuery.internalValue = undefined; this._rollup.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._entityGuids = value.entityGuids; this._nrqlQuery.internalValue = value.nrqlQuery; this._rollup.internalValue = value.rollup; } } get entityGuids() { return cdktf.Fn.tolist(this.getListAttribute('entity_guids')); } set entityGuids(value) { this._entityGuids = value; } resetEntityGuids() { this._entityGuids = undefined; } // Temporarily expose input value. Use with caution. get entityGuidsInput() { return this._entityGuids; } get nrqlQuery() { return this._nrqlQuery; } putNrqlQuery(value) { this._nrqlQuery.internalValue = value; } resetNrqlQuery() { this._nrqlQuery.internalValue = undefined; } // Temporarily expose input value. Use with caution. get nrqlQueryInput() { return this._nrqlQuery.internalValue; } get rollup() { return this._rollup; } putRollup(value) { this._rollup.internalValue = value; } // Temporarily expose input value. Use with caution. get rollupInput() { return this._rollup.internalValue; } } exports.WorkloadStatusConfigAutomaticRuleOutputReference = WorkloadStatusConfigAutomaticRuleOutputReference; _h = JSII_RTTI_SYMBOL_1; WorkloadStatusConfigAutomaticRuleOutputReference[_h] = { fqn: "@cdktf/provider-newrelic.workload.WorkloadStatusConfigAutomaticRuleOutputReference", version: "12.28.0" }; class WorkloadStatusConfigAutomaticRuleList 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 WorkloadStatusConfigAutomaticRuleOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); } } exports.WorkloadStatusConfigAutomaticRuleList = WorkloadStatusConfigAutomaticRuleList; _j = JSII_RTTI_SYMBOL_1; WorkloadStatusConfigAutomaticRuleList[_j] = { fqn: "@cdktf/provider-newrelic.workload.WorkloadStatusConfigAutomaticRuleList", version: "12.28.0" }; function workloadStatusConfigAutomaticToTerraform(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 { enabled: cdktf.booleanToTerraform(struct.enabled), remaining_entities_rule: workloadStatusConfigAutomaticRemainingEntitiesRuleToTerraform(struct.remainingEntitiesRule), rule: cdktf.listMapper(workloadStatusConfigAutomaticRuleToTerraform, true)(struct.rule), }; } function workloadStatusConfigAutomaticToHclTerraform(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 = { enabled: { value: cdktf.booleanToHclTerraform(struct.enabled), isBlock: false, type: "simple", storageClassType: "boolean", }, remaining_entities_rule: { value: workloadStatusConfigAutomaticRemainingEntitiesRuleToHclTerraform(struct.remainingEntitiesRule), isBlock: true, type: "set", storageClassType: "WorkloadStatusConfigAutomaticRemainingEntitiesRuleList", }, rule: { value: cdktf.listMapperHcl(workloadStatusConfigAutomaticRuleToHclTerraform, true)(struct.rule), isBlock: true, type: "set", storageClassType: "WorkloadStatusConfigAutomaticRuleList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class WorkloadStatusConfigAutomaticOutputReference 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; // remaining_entities_rule - computed: false, optional: true, required: false this._remainingEntitiesRule = new WorkloadStatusConfigAutomaticRemainingEntitiesRuleOutputReference(this, "remaining_entities_rule"); // rule - computed: false, optional: true, required: false this._rule = new WorkloadStatusConfigAutomaticRuleList(this, "rule", true); } get internalValue() { let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._enabled !== undefined) { hasAnyValues = true; internalValueResult.enabled = this._enabled; } if (this._remainingEntitiesRule?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.remainingEntitiesRule = this._remainingEntitiesRule?.internalValue; } if (this._rule?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.rule = this._rule?.internalValue; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._enabled = undefined; this._remainingEntitiesRule.internalValue = undefined; this._rule.internalValue = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._enabled = value.enabled; this._remainingEntitiesRule.internalValue = value.remainingEntitiesRule; this._rule.internalValue = value.rule; } } get enabled() { return this.getBooleanAttribute('enabled'); } set enabled(value) { this._enabled = value; } // Temporarily expose input value. Use with caution. get enabledInput() { return this._enabled; } get remainingEntitiesRule() { return this._remainingEntitiesRule; } putRemainingEntitiesRule(value) { this._remainingEntitiesRule.internalValue = value; } resetRemainingEntitiesRule() { this._remainingEntitiesRule.internalValue = undefined; } // Temporarily expose input value. Use with caution. get remainingEntitiesRuleInput() { return this._remainingEntitiesRule.internalValue; } get rule() { return this._rule; } putRule(value) { this._rule.internalValue = value; } resetRule() { this._rule.internalValue = undefined; } // Temporarily expose input value. Use with caution. get ruleInput() { return this._rule.internalValue; } } exports.WorkloadStatusConfigAutomaticOutputReference = WorkloadStatusConfigAutomaticOutputReference; _k = JSII_RTTI_SYMBOL_1; WorkloadStatusConfigAutomaticOutputReference[_k] = { fqn: "@cdktf/provider-newrelic.workload.WorkloadStatusConfigAutomaticOutputReference", version: "12.28.0" }; function workloadStatusConfigStaticToTerraform(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 { description: cdktf.stringToTerraform(struct.description), enabled: cdktf.booleanToTerraform(struct.enabled), status: cdktf.stringToTerraform(struct.status), summary: cdktf.stringToTerraform(struct.summary), }; } function workloadStatusConfigStaticToHclTerraform(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 = { description: { value: cdktf.stringToHclTerraform(struct.description), isBlock: false, type: "simple", storageClassType: "string", }, enabled: { value: cdktf.booleanToHclTerraform(struct.enabled), isBlock: false, type: "simple", storageClassType: "boolean", }, status: { value: cdktf.stringToHclTerraform(struct.status), isBlock: false, type: "simple", storageClassType: "string", }, summary: { value: cdktf.stringToHclTerraform(struct.summary), isBlock: false, type: "simple", storageClassType: "string", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } class WorkloadStatusConfigStaticOutputReference 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._description !== undefined) { hasAnyValues = true; internalValueResult.description = this._description; } if (this._enabled !== undefined) { hasAnyValues = true; internalValueResult.enabled = this._enabled; } if (this._status !== undefined) { hasAnyValues = true; internalValueResult.status = this._status; } if (this._summary !== undefined) { hasAnyValues = true; internalValueResult.summary = this._summary; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this._description = undefined; this._enabled = undefined; this._status = undefined; this._summary = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._description = value.description; this._enabled = value.enabled; this._status = value.status; this._summary = value.summary; } } 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 enabled() { return this.getBooleanAttribute('enabled'); } set enabled(value) { this._enabled = value; } // Temporarily expose input value. Use with caution. get enabledInput() { return this._enabled; } get status() { return this.getStringAttribute('status'); } set status(value) { this._status = value; } // Temporarily expose input value. Use with caution. get statusInput() { return this._status; } get summary() { return this.getStringAttribute('summary'); } set summary(value) { this._summary = value; } resetSummary() { this._summary = undefined; } // Temporarily expose input value. Use with caution. get summaryInput() { return this._summary; } } exports.WorkloadStatusConfigStaticOutputReference = WorkloadStatusConfigStaticOutputReference; _l = JSII_RTTI_SYMBOL_1; WorkloadStatusConfigStaticOutputReference[_l] = { fqn: "@cdktf/provider-newrelic.workload.WorkloadStatusConfigStaticOutputReference", version: "12.28.0" }; /** * Represents a {@link https://registry.terraform.io/providers/newrelic/newrelic/3.59.0/docs/resources/workload newrelic_workload} */ class Workload extends cdktf.TerraformResource { // ============== // STATIC Methods // ============== /** * Generates CDKTF code for importing a Workload 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 Workload to import * @param importFromId The id of the existing Workload that should be imported. Refer to the {@link https://registry.terraform.io/providers/newrelic/newrelic/3.59.0/docs/resources/workload#import import section} in the documentation of this resource for the id to use * @param provider? Optional instance of the provider where the Workload to import is found */ static generateConfigForImport(scope, importToId, importFromId, provider) { return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "newrelic_workload", importId: importFromId, provider }); } // =========== // INITIALIZER // =========== /** * Create a new {@link https://registry.terraform.io/providers/newrelic/newrelic/3.59.0/docs/resources/workload newrelic_workload} 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 WorkloadConfig */ constructor(scope, id, config) { super(scope, id, { terraformResourceType: 'newrelic_workload', terraformGeneratorMetadata: { providerName: 'newrelic', providerVersion: '3.59.0', providerVersionConstraint: '~> 3.7' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle, provisioners: config.provisioners, connection: config.connection, forEach: config.forEach }); // entity_search_query - computed: false, optional: true, required: false this._entitySearchQuery = new WorkloadEntitySearchQueryList(this, "entity_search_query", true); // status_config_automatic - computed: false, optional: true, required: false this._statusConfigAutomatic = new WorkloadStatusConfigAutomaticOutputReference(this, "status_config_automatic"); // status_config_static - computed: false, optional: true, required: false this._statusConfigStatic = new WorkloadStatusConfigStaticOutputReference(this, "status_config_static"); this._accountId = config.accountId; this._description = config.description; this._entityGuids = config.entityGuids; this._id = config.id; this._name = config.name; this._scopeAccountIds = config.scopeAccountIds; this._entitySearchQuery.internalValue = config.entitySearchQuery; this._statusConfigAutomatic.internalValue = config.statusConfigAutomatic; this._statusConfigStatic.internalValue = config.statusConfigStatic; } get accountId() { return this.getNumberAttribute('account_id'); } set accountId(value) { this._accountId = value; } resetAccountId() { this._accountId = undefined; } // Temporarily expose input value. Use with caution. get accountIdInput() { return this._accountId; } // composite_entity_search_query - computed: true, optional: false, required: false get compositeEntitySearchQuery() { return this.getStringAttribute('composite_entity_search_query'); } 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 entityGuids() { return cdktf.Fn.tolist(this.getListAttribute('entity_guids')); } set entityGuids(value) { this._entityGuids = value; } resetEntityGuids() { this._entityGuids = undefined; } // Temporarily expose input value. Use with caution. get entityGuidsInput() { return this._entityGuids; } // guid - computed: true, optional: false, required: false get guid() { return this.getStringAttribute('guid'); } 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; } // permalink - computed: true, optional: false, required: false get permalink() { return this.getStringAttribute('permalink'); } get scopeAccountIds() { return cdktf.Token.asNumberList(cdktf.Fn.tolist(this.getNumberListAttribute('scope_account_ids'))); } set scopeAccountIds(value) { this._scopeAccountIds = value; } resetScopeAccountIds() { this._scopeAccountIds = undefined; } // Temporarily expose input value. Use with caution. get scopeAccountIdsInput() { return this._scopeAccountIds; } // workload_id - computed: true, optional: false, required: false get workloadId() { return this.getNumberAttribute('workload_id'); } get entitySearchQuery() { return this._entitySearchQuery; } putEntitySearchQuery(value) { this._entitySearchQuery.internalValue = value; } resetEntitySearchQuery() { this._entitySearchQuery.internalValue = undefined; } // Temporarily expose input value. Use with caution. get entitySearchQueryInput() { return this._entitySearchQuery.internalValue; } get statusConfigAutomatic() { return this._statusConfigAutomatic; } putStatusConfigAutomatic(value) { this._statusConfigAutomatic.internalValue = value; } resetStatusConfigAutomatic() { this._statusConfigAutomatic.internalValue = undefined; } // Temporarily expose input value. Use with caution. get statusConfigAutomaticInput() { return this._statusConfigAutomatic.inte