UNPKG

@cdktf/provider-aws

Version:

Prebuilt aws Provider for Terraform CDK (cdktf)

1,200 lines (1,199 loc) 181 kB
"use strict"; var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l; Object.defineProperty(exports, "__esModule", { value: true }); exports.Cloudtrail = exports.CloudtrailInsightSelectorList = exports.CloudtrailInsightSelectorOutputReference = exports.cloudtrailInsightSelectorToHclTerraform = exports.cloudtrailInsightSelectorToTerraform = exports.CloudtrailEventSelectorList = exports.CloudtrailEventSelectorOutputReference = exports.cloudtrailEventSelectorToHclTerraform = exports.cloudtrailEventSelectorToTerraform = exports.CloudtrailEventSelectorDataResourceList = exports.CloudtrailEventSelectorDataResourceOutputReference = exports.cloudtrailEventSelectorDataResourceToHclTerraform = exports.cloudtrailEventSelectorDataResourceToTerraform = exports.CloudtrailAdvancedEventSelectorList = exports.CloudtrailAdvancedEventSelectorOutputReference = exports.cloudtrailAdvancedEventSelectorToHclTerraform = exports.cloudtrailAdvancedEventSelectorToTerraform = exports.CloudtrailAdvancedEventSelectorFieldSelectorList = exports.CloudtrailAdvancedEventSelectorFieldSelectorOutputReference = exports.cloudtrailAdvancedEventSelectorFieldSelectorToHclTerraform = exports.cloudtrailAdvancedEventSelectorFieldSelectorToTerraform = void 0; const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti"); const cdktf = require("cdktf"); function cloudtrailAdvancedEventSelectorFieldSelectorToTerraform(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 { ends_with: cdktf.listMapper(cdktf.stringToTerraform, false)(struct.endsWith), equals: cdktf.listMapper(cdktf.stringToTerraform, false)(struct.equalTo), field: cdktf.stringToTerraform(struct.field), not_ends_with: cdktf.listMapper(cdktf.stringToTerraform, false)(struct.notEndsWith), not_equals: cdktf.listMapper(cdktf.stringToTerraform, false)(struct.notEquals), not_starts_with: cdktf.listMapper(cdktf.stringToTerraform, false)(struct.notStartsWith), starts_with: cdktf.listMapper(cdktf.stringToTerraform, false)(struct.startsWith), }; } exports.cloudtrailAdvancedEventSelectorFieldSelectorToTerraform = cloudtrailAdvancedEventSelectorFieldSelectorToTerraform; function cloudtrailAdvancedEventSelectorFieldSelectorToHclTerraform(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 = { ends_with: { value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct.endsWith), isBlock: false, type: "list", storageClassType: "stringList", }, equals: { value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct.equalTo), isBlock: false, type: "list", storageClassType: "stringList", }, field: { value: cdktf.stringToHclTerraform(struct.field), isBlock: false, type: "simple", storageClassType: "string", }, not_ends_with: { value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct.notEndsWith), isBlock: false, type: "list", storageClassType: "stringList", }, not_equals: { value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct.notEquals), isBlock: false, type: "list", storageClassType: "stringList", }, not_starts_with: { value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct.notStartsWith), isBlock: false, type: "list", storageClassType: "stringList", }, starts_with: { value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct.startsWith), isBlock: false, type: "list", storageClassType: "stringList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } exports.cloudtrailAdvancedEventSelectorFieldSelectorToHclTerraform = cloudtrailAdvancedEventSelectorFieldSelectorToHclTerraform; class CloudtrailAdvancedEventSelectorFieldSelectorOutputReference 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._endsWith !== undefined) { hasAnyValues = true; internalValueResult.endsWith = this._endsWith; } if (this._equals !== undefined) { hasAnyValues = true; internalValueResult.equalTo = this._equals; } if (this._field !== undefined) { hasAnyValues = true; internalValueResult.field = this._field; } if (this._notEndsWith !== undefined) { hasAnyValues = true; internalValueResult.notEndsWith = this._notEndsWith; } if (this._notEquals !== undefined) { hasAnyValues = true; internalValueResult.notEquals = this._notEquals; } if (this._notStartsWith !== undefined) { hasAnyValues = true; internalValueResult.notStartsWith = this._notStartsWith; } if (this._startsWith !== undefined) { hasAnyValues = true; internalValueResult.startsWith = this._startsWith; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this.resolvableValue = undefined; this._endsWith = undefined; this._equals = undefined; this._field = undefined; this._notEndsWith = undefined; this._notEquals = undefined; this._notStartsWith = undefined; this._startsWith = 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._endsWith = value.endsWith; this._equals = value.equalTo; this._field = value.field; this._notEndsWith = value.notEndsWith; this._notEquals = value.notEquals; this._notStartsWith = value.notStartsWith; this._startsWith = value.startsWith; } } get endsWith() { return this.getListAttribute('ends_with'); } set endsWith(value) { this._endsWith = value; } resetEndsWith() { this._endsWith = undefined; } // Temporarily expose input value. Use with caution. get endsWithInput() { return this._endsWith; } get equalTo() { return this.getListAttribute('equals'); } set equalTo(value) { this._equals = value; } resetEqualTo() { this._equals = undefined; } // Temporarily expose input value. Use with caution. get equalToInput() { return this._equals; } get field() { return this.getStringAttribute('field'); } set field(value) { this._field = value; } // Temporarily expose input value. Use with caution. get fieldInput() { return this._field; } get notEndsWith() { return this.getListAttribute('not_ends_with'); } set notEndsWith(value) { this._notEndsWith = value; } resetNotEndsWith() { this._notEndsWith = undefined; } // Temporarily expose input value. Use with caution. get notEndsWithInput() { return this._notEndsWith; } get notEquals() { return this.getListAttribute('not_equals'); } set notEquals(value) { this._notEquals = value; } resetNotEquals() { this._notEquals = undefined; } // Temporarily expose input value. Use with caution. get notEqualsInput() { return this._notEquals; } get notStartsWith() { return this.getListAttribute('not_starts_with'); } set notStartsWith(value) { this._notStartsWith = value; } resetNotStartsWith() { this._notStartsWith = undefined; } // Temporarily expose input value. Use with caution. get notStartsWithInput() { return this._notStartsWith; } get startsWith() { return this.getListAttribute('starts_with'); } set startsWith(value) { this._startsWith = value; } resetStartsWith() { this._startsWith = undefined; } // Temporarily expose input value. Use with caution. get startsWithInput() { return this._startsWith; } } exports.CloudtrailAdvancedEventSelectorFieldSelectorOutputReference = CloudtrailAdvancedEventSelectorFieldSelectorOutputReference; _a = JSII_RTTI_SYMBOL_1; CloudtrailAdvancedEventSelectorFieldSelectorOutputReference[_a] = { fqn: "@cdktf/provider-aws.cloudtrail.CloudtrailAdvancedEventSelectorFieldSelectorOutputReference", version: "19.50.0" }; class CloudtrailAdvancedEventSelectorFieldSelectorList 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 CloudtrailAdvancedEventSelectorFieldSelectorOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); } } exports.CloudtrailAdvancedEventSelectorFieldSelectorList = CloudtrailAdvancedEventSelectorFieldSelectorList; _b = JSII_RTTI_SYMBOL_1; CloudtrailAdvancedEventSelectorFieldSelectorList[_b] = { fqn: "@cdktf/provider-aws.cloudtrail.CloudtrailAdvancedEventSelectorFieldSelectorList", version: "19.50.0" }; function cloudtrailAdvancedEventSelectorToTerraform(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 { name: cdktf.stringToTerraform(struct.name), field_selector: cdktf.listMapper(cloudtrailAdvancedEventSelectorFieldSelectorToTerraform, true)(struct.fieldSelector), }; } exports.cloudtrailAdvancedEventSelectorToTerraform = cloudtrailAdvancedEventSelectorToTerraform; function cloudtrailAdvancedEventSelectorToHclTerraform(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 = { name: { value: cdktf.stringToHclTerraform(struct.name), isBlock: false, type: "simple", storageClassType: "string", }, field_selector: { value: cdktf.listMapperHcl(cloudtrailAdvancedEventSelectorFieldSelectorToHclTerraform, true)(struct.fieldSelector), isBlock: true, type: "set", storageClassType: "CloudtrailAdvancedEventSelectorFieldSelectorList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } exports.cloudtrailAdvancedEventSelectorToHclTerraform = cloudtrailAdvancedEventSelectorToHclTerraform; class CloudtrailAdvancedEventSelectorOutputReference 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; // field_selector - computed: false, optional: false, required: true this._fieldSelector = new CloudtrailAdvancedEventSelectorFieldSelectorList(this, "field_selector", true); } get internalValue() { if (this.resolvableValue) { return this.resolvableValue; } let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._name !== undefined) { hasAnyValues = true; internalValueResult.name = this._name; } if (this._fieldSelector?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.fieldSelector = this._fieldSelector?.internalValue; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this.resolvableValue = undefined; this._name = undefined; this._fieldSelector.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._name = value.name; this._fieldSelector.internalValue = value.fieldSelector; } } get name() { return this.getStringAttribute('name'); } set name(value) { this._name = value; } resetName() { this._name = undefined; } // Temporarily expose input value. Use with caution. get nameInput() { return this._name; } get fieldSelector() { return this._fieldSelector; } putFieldSelector(value) { this._fieldSelector.internalValue = value; } // Temporarily expose input value. Use with caution. get fieldSelectorInput() { return this._fieldSelector.internalValue; } } exports.CloudtrailAdvancedEventSelectorOutputReference = CloudtrailAdvancedEventSelectorOutputReference; _c = JSII_RTTI_SYMBOL_1; CloudtrailAdvancedEventSelectorOutputReference[_c] = { fqn: "@cdktf/provider-aws.cloudtrail.CloudtrailAdvancedEventSelectorOutputReference", version: "19.50.0" }; class CloudtrailAdvancedEventSelectorList 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 CloudtrailAdvancedEventSelectorOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); } } exports.CloudtrailAdvancedEventSelectorList = CloudtrailAdvancedEventSelectorList; _d = JSII_RTTI_SYMBOL_1; CloudtrailAdvancedEventSelectorList[_d] = { fqn: "@cdktf/provider-aws.cloudtrail.CloudtrailAdvancedEventSelectorList", version: "19.50.0" }; function cloudtrailEventSelectorDataResourceToTerraform(struct) { if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } return { type: cdktf.stringToTerraform(struct.type), values: cdktf.listMapper(cdktf.stringToTerraform, false)(struct.values), }; } exports.cloudtrailEventSelectorDataResourceToTerraform = cloudtrailEventSelectorDataResourceToTerraform; function cloudtrailEventSelectorDataResourceToHclTerraform(struct) { if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(struct)) { return struct; } if (cdktf.isComplexElement(struct)) { throw new Error("A complex element was used as configuration, this is not supported: https://cdk.tf/complex-object-as-configuration"); } const attrs = { type: { value: cdktf.stringToHclTerraform(struct.type), isBlock: false, type: "simple", storageClassType: "string", }, values: { value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct.values), isBlock: false, type: "list", storageClassType: "stringList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } exports.cloudtrailEventSelectorDataResourceToHclTerraform = cloudtrailEventSelectorDataResourceToHclTerraform; class CloudtrailEventSelectorDataResourceOutputReference extends cdktf.ComplexObject { /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing * @param complexObjectIndex the index of this item in the list * @param complexObjectIsFromSet whether the list is wrapping a set (will add tolist() to be able to access an item via an index) */ constructor(terraformResource, terraformAttribute, complexObjectIndex, complexObjectIsFromSet) { super(terraformResource, terraformAttribute, complexObjectIsFromSet, complexObjectIndex); this.isEmptyObject = false; } get internalValue() { if (this.resolvableValue) { return this.resolvableValue; } let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._type !== undefined) { hasAnyValues = true; internalValueResult.type = this._type; } if (this._values !== undefined) { hasAnyValues = true; internalValueResult.values = this._values; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this.resolvableValue = undefined; this._type = undefined; this._values = undefined; } else if (cdktf.Tokenization.isResolvable(value)) { this.isEmptyObject = false; this.resolvableValue = value; } else { this.isEmptyObject = Object.keys(value).length === 0; this.resolvableValue = undefined; this._type = value.type; this._values = value.values; } } get type() { return this.getStringAttribute('type'); } set type(value) { this._type = value; } // Temporarily expose input value. Use with caution. get typeInput() { return this._type; } get values() { return this.getListAttribute('values'); } set values(value) { this._values = value; } // Temporarily expose input value. Use with caution. get valuesInput() { return this._values; } } exports.CloudtrailEventSelectorDataResourceOutputReference = CloudtrailEventSelectorDataResourceOutputReference; _e = JSII_RTTI_SYMBOL_1; CloudtrailEventSelectorDataResourceOutputReference[_e] = { fqn: "@cdktf/provider-aws.cloudtrail.CloudtrailEventSelectorDataResourceOutputReference", version: "19.50.0" }; class CloudtrailEventSelectorDataResourceList 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 CloudtrailEventSelectorDataResourceOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); } } exports.CloudtrailEventSelectorDataResourceList = CloudtrailEventSelectorDataResourceList; _f = JSII_RTTI_SYMBOL_1; CloudtrailEventSelectorDataResourceList[_f] = { fqn: "@cdktf/provider-aws.cloudtrail.CloudtrailEventSelectorDataResourceList", version: "19.50.0" }; function cloudtrailEventSelectorToTerraform(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 { exclude_management_event_sources: cdktf.listMapper(cdktf.stringToTerraform, false)(struct.excludeManagementEventSources), include_management_events: cdktf.booleanToTerraform(struct.includeManagementEvents), read_write_type: cdktf.stringToTerraform(struct.readWriteType), data_resource: cdktf.listMapper(cloudtrailEventSelectorDataResourceToTerraform, true)(struct.dataResource), }; } exports.cloudtrailEventSelectorToTerraform = cloudtrailEventSelectorToTerraform; function cloudtrailEventSelectorToHclTerraform(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 = { exclude_management_event_sources: { value: cdktf.listMapperHcl(cdktf.stringToHclTerraform, false)(struct.excludeManagementEventSources), isBlock: false, type: "set", storageClassType: "stringList", }, include_management_events: { value: cdktf.booleanToHclTerraform(struct.includeManagementEvents), isBlock: false, type: "simple", storageClassType: "boolean", }, read_write_type: { value: cdktf.stringToHclTerraform(struct.readWriteType), isBlock: false, type: "simple", storageClassType: "string", }, data_resource: { value: cdktf.listMapperHcl(cloudtrailEventSelectorDataResourceToHclTerraform, true)(struct.dataResource), isBlock: true, type: "list", storageClassType: "CloudtrailEventSelectorDataResourceList", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } exports.cloudtrailEventSelectorToHclTerraform = cloudtrailEventSelectorToHclTerraform; class CloudtrailEventSelectorOutputReference 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; // data_resource - computed: false, optional: true, required: false this._dataResource = new CloudtrailEventSelectorDataResourceList(this, "data_resource", false); } get internalValue() { if (this.resolvableValue) { return this.resolvableValue; } let hasAnyValues = this.isEmptyObject; const internalValueResult = {}; if (this._excludeManagementEventSources !== undefined) { hasAnyValues = true; internalValueResult.excludeManagementEventSources = this._excludeManagementEventSources; } if (this._includeManagementEvents !== undefined) { hasAnyValues = true; internalValueResult.includeManagementEvents = this._includeManagementEvents; } if (this._readWriteType !== undefined) { hasAnyValues = true; internalValueResult.readWriteType = this._readWriteType; } if (this._dataResource?.internalValue !== undefined) { hasAnyValues = true; internalValueResult.dataResource = this._dataResource?.internalValue; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this.resolvableValue = undefined; this._excludeManagementEventSources = undefined; this._includeManagementEvents = undefined; this._readWriteType = undefined; this._dataResource.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._excludeManagementEventSources = value.excludeManagementEventSources; this._includeManagementEvents = value.includeManagementEvents; this._readWriteType = value.readWriteType; this._dataResource.internalValue = value.dataResource; } } get excludeManagementEventSources() { return cdktf.Fn.tolist(this.getListAttribute('exclude_management_event_sources')); } set excludeManagementEventSources(value) { this._excludeManagementEventSources = value; } resetExcludeManagementEventSources() { this._excludeManagementEventSources = undefined; } // Temporarily expose input value. Use with caution. get excludeManagementEventSourcesInput() { return this._excludeManagementEventSources; } get includeManagementEvents() { return this.getBooleanAttribute('include_management_events'); } set includeManagementEvents(value) { this._includeManagementEvents = value; } resetIncludeManagementEvents() { this._includeManagementEvents = undefined; } // Temporarily expose input value. Use with caution. get includeManagementEventsInput() { return this._includeManagementEvents; } get readWriteType() { return this.getStringAttribute('read_write_type'); } set readWriteType(value) { this._readWriteType = value; } resetReadWriteType() { this._readWriteType = undefined; } // Temporarily expose input value. Use with caution. get readWriteTypeInput() { return this._readWriteType; } get dataResource() { return this._dataResource; } putDataResource(value) { this._dataResource.internalValue = value; } resetDataResource() { this._dataResource.internalValue = undefined; } // Temporarily expose input value. Use with caution. get dataResourceInput() { return this._dataResource.internalValue; } } exports.CloudtrailEventSelectorOutputReference = CloudtrailEventSelectorOutputReference; _g = JSII_RTTI_SYMBOL_1; CloudtrailEventSelectorOutputReference[_g] = { fqn: "@cdktf/provider-aws.cloudtrail.CloudtrailEventSelectorOutputReference", version: "19.50.0" }; class CloudtrailEventSelectorList 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 CloudtrailEventSelectorOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); } } exports.CloudtrailEventSelectorList = CloudtrailEventSelectorList; _h = JSII_RTTI_SYMBOL_1; CloudtrailEventSelectorList[_h] = { fqn: "@cdktf/provider-aws.cloudtrail.CloudtrailEventSelectorList", version: "19.50.0" }; function cloudtrailInsightSelectorToTerraform(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 { insight_type: cdktf.stringToTerraform(struct.insightType), }; } exports.cloudtrailInsightSelectorToTerraform = cloudtrailInsightSelectorToTerraform; function cloudtrailInsightSelectorToHclTerraform(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 = { insight_type: { value: cdktf.stringToHclTerraform(struct.insightType), isBlock: false, type: "simple", storageClassType: "string", }, }; // remove undefined attributes return Object.fromEntries(Object.entries(attrs).filter(([_, value]) => value !== undefined && value.value !== undefined)); } exports.cloudtrailInsightSelectorToHclTerraform = cloudtrailInsightSelectorToHclTerraform; class CloudtrailInsightSelectorOutputReference 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._insightType !== undefined) { hasAnyValues = true; internalValueResult.insightType = this._insightType; } return hasAnyValues ? internalValueResult : undefined; } set internalValue(value) { if (value === undefined) { this.isEmptyObject = false; this.resolvableValue = undefined; this._insightType = 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._insightType = value.insightType; } } get insightType() { return this.getStringAttribute('insight_type'); } set insightType(value) { this._insightType = value; } // Temporarily expose input value. Use with caution. get insightTypeInput() { return this._insightType; } } exports.CloudtrailInsightSelectorOutputReference = CloudtrailInsightSelectorOutputReference; _j = JSII_RTTI_SYMBOL_1; CloudtrailInsightSelectorOutputReference[_j] = { fqn: "@cdktf/provider-aws.cloudtrail.CloudtrailInsightSelectorOutputReference", version: "19.50.0" }; class CloudtrailInsightSelectorList 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 CloudtrailInsightSelectorOutputReference(this.terraformResource, this.terraformAttribute, index, this.wrapsSet); } } exports.CloudtrailInsightSelectorList = CloudtrailInsightSelectorList; _k = JSII_RTTI_SYMBOL_1; CloudtrailInsightSelectorList[_k] = { fqn: "@cdktf/provider-aws.cloudtrail.CloudtrailInsightSelectorList", version: "19.50.0" }; /** * Represents a {@link https://registry.terraform.io/providers/hashicorp/aws/5.84.0/docs/resources/cloudtrail aws_cloudtrail} */ class Cloudtrail extends cdktf.TerraformResource { // ============== // STATIC Methods // ============== /** * Generates CDKTF code for importing a Cloudtrail 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 Cloudtrail to import * @param importFromId The id of the existing Cloudtrail that should be imported. Refer to the {@link https://registry.terraform.io/providers/hashicorp/aws/5.84.0/docs/resources/cloudtrail#import import section} in the documentation of this resource for the id to use * @param provider? Optional instance of the provider where the Cloudtrail to import is found */ static generateConfigForImport(scope, importToId, importFromId, provider) { return new cdktf.ImportableResource(scope, importToId, { terraformResourceType: "aws_cloudtrail", importId: importFromId, provider }); } // =========== // INITIALIZER // =========== /** * Create a new {@link https://registry.terraform.io/providers/hashicorp/aws/5.84.0/docs/resources/cloudtrail aws_cloudtrail} 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 CloudtrailConfig */ constructor(scope, id, config) { super(scope, id, { terraformResourceType: 'aws_cloudtrail', terraformGeneratorMetadata: { providerName: 'aws', providerVersion: '5.84.0', providerVersionConstraint: '~> 5.0' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle, provisioners: config.provisioners, connection: config.connection, forEach: config.forEach }); // advanced_event_selector - computed: false, optional: true, required: false this._advancedEventSelector = new CloudtrailAdvancedEventSelectorList(this, "advanced_event_selector", false); // event_selector - computed: false, optional: true, required: false this._eventSelector = new CloudtrailEventSelectorList(this, "event_selector", false); // insight_selector - computed: false, optional: true, required: false this._insightSelector = new CloudtrailInsightSelectorList(this, "insight_selector", true); this._cloudWatchLogsGroupArn = config.cloudWatchLogsGroupArn; this._cloudWatchLogsRoleArn = config.cloudWatchLogsRoleArn; this._enableLogFileValidation = config.enableLogFileValidation; this._enableLogging = config.enableLogging; this._id = config.id; this._includeGlobalServiceEvents = config.includeGlobalServiceEvents; this._isMultiRegionTrail = config.isMultiRegionTrail; this._isOrganizationTrail = config.isOrganizationTrail; this._kmsKeyId = config.kmsKeyId; this._name = config.name; this._s3BucketName = config.s3BucketName; this._s3KeyPrefix = config.s3KeyPrefix; this._snsTopicName = config.snsTopicName; this._tags = config.tags; this._tagsAll = config.tagsAll; this._advancedEventSelector.internalValue = config.advancedEventSelector; this._eventSelector.internalValue = config.eventSelector; this._insightSelector.internalValue = config.insightSelector; } // ========== // ATTRIBUTES // ========== // arn - computed: true, optional: false, required: false get arn() { return this.getStringAttribute('arn'); } get cloudWatchLogsGroupArn() { return this.getStringAttribute('cloud_watch_logs_group_arn'); } set cloudWatchLogsGroupArn(value) { this._cloudWatchLogsGroupArn = value; } resetCloudWatchLogsGroupArn() { this._cloudWatchLogsGroupArn = undefined; } // Temporarily expose input value. Use with caution. get cloudWatchLogsGroupArnInput() { return this._cloudWatchLogsGroupArn; } get cloudWatchLogsRoleArn() { return this.getStringAttribute('cloud_watch_logs_role_arn'); } set cloudWatchLogsRoleArn(value) { this._cloudWatchLogsRoleArn = value; } resetCloudWatchLogsRoleArn() { this._cloudWatchLogsRoleArn = undefined; } // Temporarily expose input value. Use with caution. get cloudWatchLogsRoleArnInput() { return this._cloudWatchLogsRoleArn; } get enableLogFileValidation() { return this.getBooleanAttribute('enable_log_file_validation'); } set enableLogFileValidation(value) { this._enableLogFileValidation = value; } resetEnableLogFileValidation() { this._enableLogFileValidation = undefined; } // Temporarily expose input value. Use with caution. get enableLogFileValidationInput() { return this._enableLogFileValidation; } get enableLogging() { return this.getBooleanAttribute('enable_logging'); } set enableLogging(value) { this._enableLogging = value; } resetEnableLogging() { this._enableLogging = undefined; } // Temporarily expose input value. Use with caution. get enableLoggingInput() { return this._enableLogging; } // home_region - computed: true, optional: false, required: false get homeRegion() { return this.getStringAttribute('home_region'); } 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 includeGlobalServiceEvents() { return this.getBooleanAttribute('include_global_service_events'); } set includeGlobalServiceEvents(value) { this._includeGlobalServiceEvents = value; } resetIncludeGlobalServiceEvents() { this._includeGlobalServiceEvents = undefined; } // Temporarily expose input value. Use with caution. get includeGlobalServiceEventsInput() { return this._includeGlobalServiceEvents; } get isMultiRegionTrail() { return this.getBooleanAttribute('is_multi_region_trail'); } set isMultiRegionTrail(value) { this._isMultiRegionTrail = value; } resetIsMultiRegionTrail() { this._isMultiRegionTrail = undefined; } // Temporarily expose input value. Use with caution. get isMultiRegionTrailInput() { return this._isMultiRegionTrail; } get isOrganizationTrail() { return this.getBooleanAttribute('is_organization_trail'); } set isOrganizationTrail(value) { this._isOrganizationTrail = value; } resetIsOrganizationTrail() { this._isOrganizationTrail = undefined; } // Temporarily expose input value. Use with caution. get isOrganizationTrailInput() { return this._isOrganizationTrail; } get kmsKeyId() { return this.getStringAttribute('kms_key_id'); } set kmsKeyId(value) { this._kmsKeyId = value; } resetKmsKeyId() { this._kmsKeyId = undefined; } // Temporarily expose input value. Use with caution. get kmsKeyIdInput() { return this._kmsKeyId; } 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 s3BucketName() { return this.getStringAttribute('s3_bucket_name'); } set s3BucketName(value) { this._s3BucketName = value; } // Temporarily expose input value. Use with caution. get s3BucketNameInput() { return this._s3BucketName; } get s3KeyPrefix() { return this.getStringAttribute('s3_key_prefix'); } set s3KeyPrefix(value) { this._s3KeyPrefix = value; } resetS3KeyPrefix() { this._s3KeyPrefix = undefined; } // Temporarily expose input value. Use with caution. get s3KeyPrefixInput() { return this._s3KeyPrefix; } get snsTopicName() { return this.getStringAttribute('sns_topic_name'); } set snsTopicName(value) { this._snsTopicName = value; } resetSnsTopicName() { this._snsTopicName = undefined; } // Temporarily expose input value. Use with caution. get snsTopicNameInput() { return this._snsTopicName; } get tags() { return this.getStringMapAttribute('tags'); } set tags(value) { this._tags = value; } resetTags() { this._tags = undefined; } // Temporarily expose input value. Use with caution. get tagsInput() { return this._tags; } get tagsAll() { return this.getStringMapAttribute('tags_all'); } set tagsAll(value) { this._tagsAll = value; } resetTagsAll() { this._tagsAll = undefined; } // Temporarily expose input value. Use with caution. get tagsAllInput() { return this._tagsAll; } get advancedEventSelector() { return this._advancedEventSelector; } putAdvancedEventSelector(value) { this._advancedEventSelector.internalValue = value; } resetAdvancedEventSelector() { this._advancedEventSelector.internalValue = undefined; } // Temporarily expose input value. Use with caution. get advancedEventSelectorInput() { return this._advancedEventSelector.internalValue; } get eventSelector() { return this._eventSelector; } putEventSelector(value) { this._eventSelector.internalValue = value; } resetEventSelector() { this._eventSelector.internalValue = undefined; } // Temporarily expose input value. Use with caution. get eventSelectorInput() { return this._eventSelector.internalValue; } get insightSelector() { return this._insightSelector; } putInsightSelector(value) { this._insightSelector.internalValue = value; } resetInsightSelector() { this._insightSelector.internalValue = undefined; } // Temporarily expose input value. Use with caution. get insightSelectorInput() { return this._insightSelector.internalValue; } // ========= // SYNTHESIS // ========= synthesizeAttributes() { return { cloud_watch_logs_group_arn: cdktf.stringToTerraform(this._cloudWatchLogsGroupArn), cloud_watch_logs_role_arn: cdktf.stringToTerraform(this._cloudWatchLogsRoleArn), enable_log_file_validation: cdktf.booleanToTerraform(this._enableLogFileValidation), enable_logging: cdktf.booleanToTerraform(this._enableLogging), id: cdktf.stringToTerraform(this._id), include_global_service_events: cdktf.booleanToTerraform(this._includeGlobalServiceEvents), is_multi_region_trail: cdktf.booleanToTerraform(this._isMultiRegionTrail), is_organization_trail: cdktf.booleanToTerraform(this._isOrganizationTrail), kms_key_id: cdktf.stringToTerraform(this._kmsKeyId), name: cdktf.stringToTerraform(this._name), s3_bucket_name: cdktf.stringToTerraform(this._s3BucketName), s3_key_prefix: cdktf.stringToTerraform(this._s3KeyPrefix), sns_topic_name: cdktf.stringToTerraform(this._snsTopicName), tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags), tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll), advanced_event_selector: cdktf.listMapper(cloudtrailAdvancedEventSelectorToTerraform, true)(this._advancedEventSelector.internalValue), event_selector: cdktf.listMapper(cloudtrailEventSelectorToTerraform, true)(this._eventSelector.internalValue), insight_selector: cdktf.listMapper(cloudtrailInsightSelectorToTerraform, true)(this._insightSelector.internalValue), }; } synthesizeHclAttributes() { const attrs = { cloud_watch_logs_group_arn: { value: cdktf.stringToHclTerraform(this._cloudWatchLogsGroupArn), isBlock: false, type: "simple", storageClassType: "string", }, cloud_watch_logs_role_arn: { value: cdktf.stringToHclTerraform(this._cloudWatchLogsRoleArn), isBlock: false, type: "simple", storageClassType: "string", }, enable_log_file_validation: { value: cdktf.booleanToHclTerraform(this._enableLogFileValidation), isBlock: false, type: "simple", storageClassType: "boolean", }, enable_logging: { value: cdktf.booleanToHclTerraform(this._enableLogging), isBlock: false, type: "simple", storageClassType: "boolean", }, id: { value: cdktf.stringToHclTerraform(this._id), isBlock: false, type: "simple", storageClassType: "string", }, include_global_service_events: { value: cdktf.booleanToHclTerraform(this._includeGlobalServiceEvents), isBlock: false, type: "simple", storageClassType: "boolean", }, is_multi_region_trail: { value: cdktf.booleanToHclTerraform(this._isMultiRegionTrail), isBlock: false,