// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * AWS VPC */ export interface DataAwsSubnetConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/d/subnet.html#availability_zone DataAwsSubnet#availability_zone} */ readonly availabilityZone?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/d/subnet.html#availability_zone_id DataAwsSubnet#availability_zone_id} */ readonly availabilityZoneId?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/d/subnet.html#cidr_block DataAwsSubnet#cidr_block} */ readonly cidrBlock?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/d/subnet.html#default_for_az DataAwsSubnet#default_for_az} */ readonly defaultForAz?: boolean | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/d/subnet.html#ipv6_cidr_block DataAwsSubnet#ipv6_cidr_block} */ readonly ipv6CidrBlock?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/d/subnet.html#state DataAwsSubnet#state} */ readonly state?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/d/subnet.html#tags DataAwsSubnet#tags} */ readonly tags?: { [key: string]: string } | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/d/subnet.html#vpc_id DataAwsSubnet#vpc_id} */ readonly vpcId?: string; /** * filter block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/d/subnet.html#filter DataAwsSubnet#filter} */ readonly filter?: DataAwsSubnetFilter[]; } export interface DataAwsSubnetFilter { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/d/subnet.html#name DataAwsSubnet#name} */ readonly name: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/d/subnet.html#values DataAwsSubnet#values} */ readonly values: string[]; } export function dataAwsSubnetFilterToTerraform(struct?: DataAwsSubnetFilter): 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/subnet.html aws_subnet} */ export class DataAwsSubnet extends cdktf.TerraformDataSource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_subnet"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/d/subnet.html aws_subnet} 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 DataAwsSubnetConfig = {} */ public constructor(scope: Construct, id: string, config: DataAwsSubnetConfig = {}) { super(scope, id, { terraformResourceType: 'aws_subnet', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._availabilityZone = config.availabilityZone; this._availabilityZoneId = config.availabilityZoneId; this._cidrBlock = config.cidrBlock; this._defaultForAz = config.defaultForAz; this._ipv6CidrBlock = config.ipv6CidrBlock; this._state = config.state; this._tags = config.tags; this._vpcId = config.vpcId; this._filter = config.filter; } // ========== // ATTRIBUTES // ========== // arn - computed: true, optional: false, required: false public get arn() { return this.getStringAttribute('arn'); } // assign_ipv6_address_on_creation - computed: true, optional: false, required: false public get assignIpv6AddressOnCreation() { return this.getBooleanAttribute('assign_ipv6_address_on_creation') as any; } // availability_zone - computed: true, optional: true, required: false private _availabilityZone?: string; public get availabilityZone() { return this.getStringAttribute('availability_zone'); } public set availabilityZone(value: string) { this._availabilityZone = value; } public resetAvailabilityZone() { this._availabilityZone = undefined; } // Temporarily expose input value. Use with caution. public get availabilityZoneInput() { return this._availabilityZone; } // availability_zone_id - computed: true, optional: true, required: false private _availabilityZoneId?: string; public get availabilityZoneId() { return this.getStringAttribute('availability_zone_id'); } public set availabilityZoneId(value: string) { this._availabilityZoneId = value; } public resetAvailabilityZoneId() { this._availabilityZoneId = undefined; } // Temporarily expose input value. Use with caution. public get availabilityZoneIdInput() { return this._availabilityZoneId; } // available_ip_address_count - computed: true, optional: false, required: false public get availableIpAddressCount() { return this.getNumberAttribute('available_ip_address_count'); } // cidr_block - computed: true, optional: true, required: false private _cidrBlock?: string; public get cidrBlock() { return this.getStringAttribute('cidr_block'); } public set cidrBlock(value: string) { this._cidrBlock = value; } public resetCidrBlock() { this._cidrBlock = undefined; } // Temporarily expose input value. Use with caution. public get cidrBlockInput() { return this._cidrBlock; } // customer_owned_ipv4_pool - computed: true, optional: false, required: false public get customerOwnedIpv4Pool() { return this.getStringAttribute('customer_owned_ipv4_pool'); } // default_for_az - computed: true, optional: true, required: false private _defaultForAz?: boolean | cdktf.IResolvable; public get defaultForAz() { return this.getBooleanAttribute('default_for_az') as any; } public set defaultForAz(value: boolean | cdktf.IResolvable) { this._defaultForAz = value; } public resetDefaultForAz() { this._defaultForAz = undefined; } // Temporarily expose input value. Use with caution. public get defaultForAzInput() { return this._defaultForAz; } // id - computed: true, optional: true, required: false public get id() { return this.getStringAttribute('id'); } // ipv6_cidr_block - computed: true, optional: true, required: false private _ipv6CidrBlock?: string; public get ipv6CidrBlock() { return this.getStringAttribute('ipv6_cidr_block'); } public set ipv6CidrBlock(value: string) { this._ipv6CidrBlock = value; } public resetIpv6CidrBlock() { this._ipv6CidrBlock = undefined; } // Temporarily expose input value. Use with caution. public get ipv6CidrBlockInput() { return this._ipv6CidrBlock; } // ipv6_cidr_block_association_id - computed: true, optional: false, required: false public get ipv6CidrBlockAssociationId() { return this.getStringAttribute('ipv6_cidr_block_association_id'); } // map_customer_owned_ip_on_launch - computed: true, optional: false, required: false public get mapCustomerOwnedIpOnLaunch() { return this.getBooleanAttribute('map_customer_owned_ip_on_launch') as any; } // map_public_ip_on_launch - computed: true, optional: false, required: false public get mapPublicIpOnLaunch() { return this.getBooleanAttribute('map_public_ip_on_launch') as any; } // outpost_arn - computed: true, optional: false, required: false public get outpostArn() { return this.getStringAttribute('outpost_arn'); } // owner_id - computed: true, optional: false, required: false public get ownerId() { return this.getStringAttribute('owner_id'); } // state - computed: true, optional: true, required: false private _state?: string; public get state() { return this.getStringAttribute('state'); } public set state(value: string) { this._state = value; } public resetState() { this._state = undefined; } // Temporarily expose input value. Use with caution. public get stateInput() { return this._state; } // tags - computed: true, 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; } // vpc_id - computed: true, optional: true, required: false private _vpcId?: string; public get vpcId() { return this.getStringAttribute('vpc_id'); } public set vpcId(value: string) { this._vpcId = value; } public resetVpcId() { this._vpcId = undefined; } // Temporarily expose input value. Use with caution. public get vpcIdInput() { return this._vpcId; } // filter - computed: false, optional: true, required: false private _filter?: DataAwsSubnetFilter[]; public get filter() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('filter') as any; } public set filter(value: DataAwsSubnetFilter[]) { 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 { availability_zone: cdktf.stringToTerraform(this._availabilityZone), availability_zone_id: cdktf.stringToTerraform(this._availabilityZoneId), cidr_block: cdktf.stringToTerraform(this._cidrBlock), default_for_az: cdktf.booleanToTerraform(this._defaultForAz), ipv6_cidr_block: cdktf.stringToTerraform(this._ipv6CidrBlock), state: cdktf.stringToTerraform(this._state), tags: cdktf.hashMapper(cdktf.anyToTerraform)(this._tags), vpc_id: cdktf.stringToTerraform(this._vpcId), filter: cdktf.listMapper(dataAwsSubnetFilterToTerraform)(this._filter), }; } }