// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * AWS Data Sources */ export interface DataAwsPrefixListConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/d/prefix_list.html#name DataAwsPrefixList#name} */ readonly name?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/d/prefix_list.html#prefix_list_id DataAwsPrefixList#prefix_list_id} */ readonly prefixListId?: string; /** * filter block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/d/prefix_list.html#filter DataAwsPrefixList#filter} */ readonly filter?: DataAwsPrefixListFilter[]; } export interface DataAwsPrefixListFilter { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/d/prefix_list.html#name DataAwsPrefixList#name} */ readonly name: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/d/prefix_list.html#values DataAwsPrefixList#values} */ readonly values: string[]; } export function dataAwsPrefixListFilterToTerraform(struct?: DataAwsPrefixListFilter): 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 { name: cdktf.stringToTerraform(struct!.name), values: cdktf.listMapper(cdktf.stringToTerraform)(struct!.values), } } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/d/prefix_list.html aws_prefix_list} */ export class DataAwsPrefixList extends cdktf.TerraformDataSource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_prefix_list"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/d/prefix_list.html aws_prefix_list} Data Source * * @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 DataAwsPrefixListConfig = {} */ public constructor(scope: Construct, id: string, config: DataAwsPrefixListConfig = {}) { super(scope, id, { terraformResourceType: 'aws_prefix_list', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._name = config.name; this._prefixListId = config.prefixListId; this._filter = config.filter; } // ========== // ATTRIBUTES // ========== // cidr_blocks - computed: true, optional: false, required: false public get cidrBlocks() { return this.getListAttribute('cidr_blocks'); } // id - computed: true, optional: true, required: false public get id() { return this.getStringAttribute('id'); } // name - computed: true, optional: true, required: false private _name?: string; public get name() { return this.getStringAttribute('name'); } public set name(value: string) { this._name = value; } public resetName() { this._name = undefined; } // Temporarily expose input value. Use with caution. public get nameInput() { return this._name; } // prefix_list_id - computed: false, optional: true, required: false private _prefixListId?: string; public get prefixListId() { return this.getStringAttribute('prefix_list_id'); } public set prefixListId(value: string) { this._prefixListId = value; } public resetPrefixListId() { this._prefixListId = undefined; } // Temporarily expose input value. Use with caution. public get prefixListIdInput() { return this._prefixListId; } // filter - computed: false, optional: true, required: false private _filter?: DataAwsPrefixListFilter[]; public get filter() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('filter') as any; } public set filter(value: DataAwsPrefixListFilter[]) { this._filter = value; } public resetFilter() { this._filter = undefined; } // Temporarily expose input value. Use with caution. public get filterInput() { return this._filter; } // ========= // SYNTHESIS // ========= protected synthesizeAttributes(): { [name: string]: any } { return { name: cdktf.stringToTerraform(this._name), prefix_list_id: cdktf.stringToTerraform(this._prefixListId), filter: cdktf.listMapper(dataAwsPrefixListFilterToTerraform)(this._filter), }; } }