// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * AWS Config */ export interface ConfigConfigRuleConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/config_config_rule.html#description ConfigConfigRule#description} */ readonly description?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/config_config_rule.html#input_parameters ConfigConfigRule#input_parameters} */ readonly inputParameters?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/config_config_rule.html#maximum_execution_frequency ConfigConfigRule#maximum_execution_frequency} */ readonly maximumExecutionFrequency?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/config_config_rule.html#name ConfigConfigRule#name} */ readonly name: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/config_config_rule.html#tags ConfigConfigRule#tags} */ readonly tags?: { [key: string]: string } | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/config_config_rule.html#tags_all ConfigConfigRule#tags_all} */ readonly tagsAll?: { [key: string]: string } | cdktf.IResolvable; /** * scope block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/config_config_rule.html#scope ConfigConfigRule#scope} */ readonly scope?: ConfigConfigRuleScope; /** * source block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/config_config_rule.html#source ConfigConfigRule#source} */ readonly source: ConfigConfigRuleSource; } export interface ConfigConfigRuleScope { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/config_config_rule.html#compliance_resource_id ConfigConfigRule#compliance_resource_id} */ readonly complianceResourceId?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/config_config_rule.html#compliance_resource_types ConfigConfigRule#compliance_resource_types} */ readonly complianceResourceTypes?: string[]; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/config_config_rule.html#tag_key ConfigConfigRule#tag_key} */ readonly tagKey?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/config_config_rule.html#tag_value ConfigConfigRule#tag_value} */ readonly tagValue?: string; } export function configConfigRuleScopeToTerraform(struct?: ConfigConfigRuleScopeOutputReference | ConfigConfigRuleScope): any { if (!cdktf.canInspect(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 { compliance_resource_id: cdktf.stringToTerraform(struct!.complianceResourceId), compliance_resource_types: cdktf.listMapper(cdktf.stringToTerraform)(struct!.complianceResourceTypes), tag_key: cdktf.stringToTerraform(struct!.tagKey), tag_value: cdktf.stringToTerraform(struct!.tagValue), } } export class ConfigConfigRuleScopeOutputReference extends cdktf.ComplexObject { private isEmptyObject = false; /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing * @param isSingleItem True if this is a block, false if it's a list */ public constructor(terraformResource: cdktf.ITerraformResource, terraformAttribute: string, isSingleItem: boolean) { super(terraformResource, terraformAttribute, isSingleItem); } public get internalValue(): ConfigConfigRuleScope | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._complianceResourceId !== undefined) { hasAnyValues = true; internalValueResult.complianceResourceId = this._complianceResourceId; } if (this._complianceResourceTypes !== undefined) { hasAnyValues = true; internalValueResult.complianceResourceTypes = this._complianceResourceTypes; } if (this._tagKey !== undefined) { hasAnyValues = true; internalValueResult.tagKey = this._tagKey; } if (this._tagValue !== undefined) { hasAnyValues = true; internalValueResult.tagValue = this._tagValue; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: ConfigConfigRuleScope | undefined) { if (value === undefined) { this.isEmptyObject = false; this._complianceResourceId = undefined; this._complianceResourceTypes = undefined; this._tagKey = undefined; this._tagValue = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._complianceResourceId = value.complianceResourceId; this._complianceResourceTypes = value.complianceResourceTypes; this._tagKey = value.tagKey; this._tagValue = value.tagValue; } } // compliance_resource_id - computed: false, optional: true, required: false private _complianceResourceId?: string; public get complianceResourceId() { return this.getStringAttribute('compliance_resource_id'); } public set complianceResourceId(value: string) { this._complianceResourceId = value; } public resetComplianceResourceId() { this._complianceResourceId = undefined; } // Temporarily expose input value. Use with caution. public get complianceResourceIdInput() { return this._complianceResourceId; } // compliance_resource_types - computed: false, optional: true, required: false private _complianceResourceTypes?: string[]; public get complianceResourceTypes() { return this.getListAttribute('compliance_resource_types'); } public set complianceResourceTypes(value: string[]) { this._complianceResourceTypes = value; } public resetComplianceResourceTypes() { this._complianceResourceTypes = undefined; } // Temporarily expose input value. Use with caution. public get complianceResourceTypesInput() { return this._complianceResourceTypes; } // tag_key - computed: false, optional: true, required: false private _tagKey?: string; public get tagKey() { return this.getStringAttribute('tag_key'); } public set tagKey(value: string) { this._tagKey = value; } public resetTagKey() { this._tagKey = undefined; } // Temporarily expose input value. Use with caution. public get tagKeyInput() { return this._tagKey; } // tag_value - computed: false, optional: true, required: false private _tagValue?: string; public get tagValue() { return this.getStringAttribute('tag_value'); } public set tagValue(value: string) { this._tagValue = value; } public resetTagValue() { this._tagValue = undefined; } // Temporarily expose input value. Use with caution. public get tagValueInput() { return this._tagValue; } } export interface ConfigConfigRuleSourceSourceDetail { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/config_config_rule.html#event_source ConfigConfigRule#event_source} */ readonly eventSource?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/config_config_rule.html#maximum_execution_frequency ConfigConfigRule#maximum_execution_frequency} */ readonly maximumExecutionFrequency?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/config_config_rule.html#message_type ConfigConfigRule#message_type} */ readonly messageType?: string; } export function configConfigRuleSourceSourceDetailToTerraform(struct?: ConfigConfigRuleSourceSourceDetail): any { if (!cdktf.canInspect(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 { event_source: cdktf.stringToTerraform(struct!.eventSource), maximum_execution_frequency: cdktf.stringToTerraform(struct!.maximumExecutionFrequency), message_type: cdktf.stringToTerraform(struct!.messageType), } } export interface ConfigConfigRuleSource { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/config_config_rule.html#owner ConfigConfigRule#owner} */ readonly owner: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/config_config_rule.html#source_identifier ConfigConfigRule#source_identifier} */ readonly sourceIdentifier: string; /** * source_detail block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/config_config_rule.html#source_detail ConfigConfigRule#source_detail} */ readonly sourceDetail?: ConfigConfigRuleSourceSourceDetail[]; } export function configConfigRuleSourceToTerraform(struct?: ConfigConfigRuleSourceOutputReference | ConfigConfigRuleSource): any { if (!cdktf.canInspect(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 { owner: cdktf.stringToTerraform(struct!.owner), source_identifier: cdktf.stringToTerraform(struct!.sourceIdentifier), source_detail: cdktf.listMapper(configConfigRuleSourceSourceDetailToTerraform)(struct!.sourceDetail), } } export class ConfigConfigRuleSourceOutputReference extends cdktf.ComplexObject { private isEmptyObject = false; /** * @param terraformResource The parent resource * @param terraformAttribute The attribute on the parent resource this class is referencing * @param isSingleItem True if this is a block, false if it's a list */ public constructor(terraformResource: cdktf.ITerraformResource, terraformAttribute: string, isSingleItem: boolean) { super(terraformResource, terraformAttribute, isSingleItem); } public get internalValue(): ConfigConfigRuleSource | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._owner !== undefined) { hasAnyValues = true; internalValueResult.owner = this._owner; } if (this._sourceIdentifier !== undefined) { hasAnyValues = true; internalValueResult.sourceIdentifier = this._sourceIdentifier; } if (this._sourceDetail !== undefined) { hasAnyValues = true; internalValueResult.sourceDetail = this._sourceDetail; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: ConfigConfigRuleSource | undefined) { if (value === undefined) { this.isEmptyObject = false; this._owner = undefined; this._sourceIdentifier = undefined; this._sourceDetail = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._owner = value.owner; this._sourceIdentifier = value.sourceIdentifier; this._sourceDetail = value.sourceDetail; } } // owner - computed: false, optional: false, required: true private _owner?: string; public get owner() { return this.getStringAttribute('owner'); } public set owner(value: string) { this._owner = value; } // Temporarily expose input value. Use with caution. public get ownerInput() { return this._owner; } // source_identifier - computed: false, optional: false, required: true private _sourceIdentifier?: string; public get sourceIdentifier() { return this.getStringAttribute('source_identifier'); } public set sourceIdentifier(value: string) { this._sourceIdentifier = value; } // Temporarily expose input value. Use with caution. public get sourceIdentifierInput() { return this._sourceIdentifier; } // source_detail - computed: false, optional: true, required: false private _sourceDetail?: ConfigConfigRuleSourceSourceDetail[]; public get sourceDetail() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('source_detail') as any; } public set sourceDetail(value: ConfigConfigRuleSourceSourceDetail[]) { this._sourceDetail = value; } public resetSourceDetail() { this._sourceDetail = undefined; } // Temporarily expose input value. Use with caution. public get sourceDetailInput() { return this._sourceDetail; } } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/r/config_config_rule.html aws_config_config_rule} */ export class ConfigConfigRule extends cdktf.TerraformResource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_config_config_rule"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/r/config_config_rule.html aws_config_config_rule} 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 ConfigConfigRuleConfig */ public constructor(scope: Construct, id: string, config: ConfigConfigRuleConfig) { super(scope, id, { terraformResourceType: 'aws_config_config_rule', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._description = config.description; this._inputParameters = config.inputParameters; this._maximumExecutionFrequency = config.maximumExecutionFrequency; this._name = config.name; this._tags = config.tags; this._tagsAll = config.tagsAll; this._scope.internalValue = config.scope; this._source.internalValue = config.source; } // ========== // ATTRIBUTES // ========== // arn - computed: true, optional: false, required: false public get arn() { return this.getStringAttribute('arn'); } // description - computed: false, optional: true, required: false private _description?: string; public get description() { return this.getStringAttribute('description'); } public set description(value: string) { this._description = value; } public resetDescription() { this._description = undefined; } // Temporarily expose input value. Use with caution. public get descriptionInput() { return this._description; } // id - computed: true, optional: true, required: false public get id() { return this.getStringAttribute('id'); } // input_parameters - computed: false, optional: true, required: false private _inputParameters?: string; public get inputParameters() { return this.getStringAttribute('input_parameters'); } public set inputParameters(value: string) { this._inputParameters = value; } public resetInputParameters() { this._inputParameters = undefined; } // Temporarily expose input value. Use with caution. public get inputParametersInput() { return this._inputParameters; } // maximum_execution_frequency - computed: false, optional: true, required: false private _maximumExecutionFrequency?: string; public get maximumExecutionFrequency() { return this.getStringAttribute('maximum_execution_frequency'); } public set maximumExecutionFrequency(value: string) { this._maximumExecutionFrequency = value; } public resetMaximumExecutionFrequency() { this._maximumExecutionFrequency = undefined; } // Temporarily expose input value. Use with caution. public get maximumExecutionFrequencyInput() { return this._maximumExecutionFrequency; } // name - computed: false, optional: false, required: true private _name?: string; public get name() { return this.getStringAttribute('name'); } public set name(value: string) { this._name = value; } // Temporarily expose input value. Use with caution. public get nameInput() { return this._name; } // rule_id - computed: true, optional: false, required: false public get ruleId() { return this.getStringAttribute('rule_id'); } // tags - computed: false, optional: true, required: false private _tags?: { [key: string]: string } | cdktf.IResolvable; public get tags() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('tags') as any; } public set tags(value: { [key: string]: string } | cdktf.IResolvable) { this._tags = value; } public resetTags() { this._tags = undefined; } // Temporarily expose input value. Use with caution. public get tagsInput() { return this._tags; } // tags_all - computed: true, optional: true, required: false private _tagsAll?: { [key: string]: string } | cdktf.IResolvable; public get tagsAll() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('tags_all') as any; } public set tagsAll(value: { [key: string]: string } | cdktf.IResolvable) { this._tagsAll = value; } public resetTagsAll() { this._tagsAll = undefined; } // Temporarily expose input value. Use with caution. public get tagsAllInput() { return this._tagsAll; } // scope - computed: false, optional: true, required: false private _scope = new ConfigConfigRuleScopeOutputReference(this as any, "scope", true); public get scope() { return this._scope; } public putScope(value: ConfigConfigRuleScope) { this._scope.internalValue = value; } public resetScope() { this._scope.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get scopeInput() { return this._scope.internalValue; } // source - computed: false, optional: false, required: true private _source = new ConfigConfigRuleSourceOutputReference(this as any, "source", true); public get source() { return this._source; } public putSource(value: ConfigConfigRuleSource) { this._source.internalValue = value; } // Temporarily expose input value. Use with caution. public get sourceInput() { return this._source.internalValue; } // ========= // SYNTHESIS // ========= protected synthesizeAttributes(): { [name: string]: any } { return { description: cdktf.stringToTerraform(this._description), input_parameters: cdktf.stringToTerraform(this._inputParameters), maximum_execution_frequency: cdktf.stringToTerraform(this._maximumExecutionFrequency), name: cdktf.stringToTerraform(this._name), tags: cdktf.hashMapper(cdktf.anyToTerraform)(this._tags), tags_all: cdktf.hashMapper(cdktf.anyToTerraform)(this._tagsAll), scope: configConfigRuleScopeToTerraform(this._scope.internalValue), source: configConfigRuleSourceToTerraform(this._source.internalValue), }; } }