// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * AWS VPC */ export interface RouteConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/route.html#carrier_gateway_id Route#carrier_gateway_id} */ readonly carrierGatewayId?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/route.html#destination_cidr_block Route#destination_cidr_block} */ readonly destinationCidrBlock?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/route.html#destination_ipv6_cidr_block Route#destination_ipv6_cidr_block} */ readonly destinationIpv6CidrBlock?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/route.html#destination_prefix_list_id Route#destination_prefix_list_id} */ readonly destinationPrefixListId?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/route.html#egress_only_gateway_id Route#egress_only_gateway_id} */ readonly egressOnlyGatewayId?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/route.html#gateway_id Route#gateway_id} */ readonly gatewayId?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/route.html#instance_id Route#instance_id} */ readonly instanceId?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/route.html#local_gateway_id Route#local_gateway_id} */ readonly localGatewayId?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/route.html#nat_gateway_id Route#nat_gateway_id} */ readonly natGatewayId?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/route.html#network_interface_id Route#network_interface_id} */ readonly networkInterfaceId?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/route.html#route_table_id Route#route_table_id} */ readonly routeTableId: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/route.html#transit_gateway_id Route#transit_gateway_id} */ readonly transitGatewayId?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/route.html#vpc_endpoint_id Route#vpc_endpoint_id} */ readonly vpcEndpointId?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/route.html#vpc_peering_connection_id Route#vpc_peering_connection_id} */ readonly vpcPeeringConnectionId?: string; /** * timeouts block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/route.html#timeouts Route#timeouts} */ readonly timeouts?: RouteTimeouts; } export interface RouteTimeouts { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/route.html#create Route#create} */ readonly create?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/route.html#delete Route#delete} */ readonly delete?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/route.html#update Route#update} */ readonly update?: string; } export function routeTimeoutsToTerraform(struct?: RouteTimeoutsOutputReference | RouteTimeouts): 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 { create: cdktf.stringToTerraform(struct!.create), delete: cdktf.stringToTerraform(struct!.delete), update: cdktf.stringToTerraform(struct!.update), } } export class RouteTimeoutsOutputReference 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(): RouteTimeouts | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._create !== undefined) { hasAnyValues = true; internalValueResult.create = this._create; } if (this._delete !== undefined) { hasAnyValues = true; internalValueResult.delete = this._delete; } if (this._update !== undefined) { hasAnyValues = true; internalValueResult.update = this._update; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: RouteTimeouts | undefined) { if (value === undefined) { this.isEmptyObject = false; this._create = undefined; this._delete = undefined; this._update = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._create = value.create; this._delete = value.delete; this._update = value.update; } } // create - computed: false, optional: true, required: false private _create?: string; public get create() { return this.getStringAttribute('create'); } public set create(value: string) { this._create = value; } public resetCreate() { this._create = undefined; } // Temporarily expose input value. Use with caution. public get createInput() { return this._create; } // delete - computed: false, optional: true, required: false private _delete?: string; public get delete() { return this.getStringAttribute('delete'); } public set delete(value: string) { this._delete = value; } public resetDelete() { this._delete = undefined; } // Temporarily expose input value. Use with caution. public get deleteInput() { return this._delete; } // update - computed: false, optional: true, required: false private _update?: string; public get update() { return this.getStringAttribute('update'); } public set update(value: string) { this._update = value; } public resetUpdate() { this._update = undefined; } // Temporarily expose input value. Use with caution. public get updateInput() { return this._update; } } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/r/route.html aws_route} */ export class Route extends cdktf.TerraformResource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_route"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/r/route.html aws_route} 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 RouteConfig */ public constructor(scope: Construct, id: string, config: RouteConfig) { super(scope, id, { terraformResourceType: 'aws_route', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._carrierGatewayId = config.carrierGatewayId; this._destinationCidrBlock = config.destinationCidrBlock; this._destinationIpv6CidrBlock = config.destinationIpv6CidrBlock; this._destinationPrefixListId = config.destinationPrefixListId; this._egressOnlyGatewayId = config.egressOnlyGatewayId; this._gatewayId = config.gatewayId; this._instanceId = config.instanceId; this._localGatewayId = config.localGatewayId; this._natGatewayId = config.natGatewayId; this._networkInterfaceId = config.networkInterfaceId; this._routeTableId = config.routeTableId; this._transitGatewayId = config.transitGatewayId; this._vpcEndpointId = config.vpcEndpointId; this._vpcPeeringConnectionId = config.vpcPeeringConnectionId; this._timeouts.internalValue = config.timeouts; } // ========== // ATTRIBUTES // ========== // carrier_gateway_id - computed: false, optional: true, required: false private _carrierGatewayId?: string; public get carrierGatewayId() { return this.getStringAttribute('carrier_gateway_id'); } public set carrierGatewayId(value: string) { this._carrierGatewayId = value; } public resetCarrierGatewayId() { this._carrierGatewayId = undefined; } // Temporarily expose input value. Use with caution. public get carrierGatewayIdInput() { return this._carrierGatewayId; } // destination_cidr_block - computed: false, optional: true, required: false private _destinationCidrBlock?: string; public get destinationCidrBlock() { return this.getStringAttribute('destination_cidr_block'); } public set destinationCidrBlock(value: string) { this._destinationCidrBlock = value; } public resetDestinationCidrBlock() { this._destinationCidrBlock = undefined; } // Temporarily expose input value. Use with caution. public get destinationCidrBlockInput() { return this._destinationCidrBlock; } // destination_ipv6_cidr_block - computed: false, optional: true, required: false private _destinationIpv6CidrBlock?: string; public get destinationIpv6CidrBlock() { return this.getStringAttribute('destination_ipv6_cidr_block'); } public set destinationIpv6CidrBlock(value: string) { this._destinationIpv6CidrBlock = value; } public resetDestinationIpv6CidrBlock() { this._destinationIpv6CidrBlock = undefined; } // Temporarily expose input value. Use with caution. public get destinationIpv6CidrBlockInput() { return this._destinationIpv6CidrBlock; } // destination_prefix_list_id - computed: false, optional: true, required: false private _destinationPrefixListId?: string; public get destinationPrefixListId() { return this.getStringAttribute('destination_prefix_list_id'); } public set destinationPrefixListId(value: string) { this._destinationPrefixListId = value; } public resetDestinationPrefixListId() { this._destinationPrefixListId = undefined; } // Temporarily expose input value. Use with caution. public get destinationPrefixListIdInput() { return this._destinationPrefixListId; } // egress_only_gateway_id - computed: false, optional: true, required: false private _egressOnlyGatewayId?: string; public get egressOnlyGatewayId() { return this.getStringAttribute('egress_only_gateway_id'); } public set egressOnlyGatewayId(value: string) { this._egressOnlyGatewayId = value; } public resetEgressOnlyGatewayId() { this._egressOnlyGatewayId = undefined; } // Temporarily expose input value. Use with caution. public get egressOnlyGatewayIdInput() { return this._egressOnlyGatewayId; } // gateway_id - computed: false, optional: true, required: false private _gatewayId?: string; public get gatewayId() { return this.getStringAttribute('gateway_id'); } public set gatewayId(value: string) { this._gatewayId = value; } public resetGatewayId() { this._gatewayId = undefined; } // Temporarily expose input value. Use with caution. public get gatewayIdInput() { return this._gatewayId; } // id - computed: true, optional: true, required: false public get id() { return this.getStringAttribute('id'); } // instance_id - computed: true, optional: true, required: false private _instanceId?: string; public get instanceId() { return this.getStringAttribute('instance_id'); } public set instanceId(value: string) { this._instanceId = value; } public resetInstanceId() { this._instanceId = undefined; } // Temporarily expose input value. Use with caution. public get instanceIdInput() { return this._instanceId; } // instance_owner_id - computed: true, optional: false, required: false public get instanceOwnerId() { return this.getStringAttribute('instance_owner_id'); } // local_gateway_id - computed: false, optional: true, required: false private _localGatewayId?: string; public get localGatewayId() { return this.getStringAttribute('local_gateway_id'); } public set localGatewayId(value: string) { this._localGatewayId = value; } public resetLocalGatewayId() { this._localGatewayId = undefined; } // Temporarily expose input value. Use with caution. public get localGatewayIdInput() { return this._localGatewayId; } // nat_gateway_id - computed: false, optional: true, required: false private _natGatewayId?: string; public get natGatewayId() { return this.getStringAttribute('nat_gateway_id'); } public set natGatewayId(value: string) { this._natGatewayId = value; } public resetNatGatewayId() { this._natGatewayId = undefined; } // Temporarily expose input value. Use with caution. public get natGatewayIdInput() { return this._natGatewayId; } // network_interface_id - computed: true, optional: true, required: false private _networkInterfaceId?: string; public get networkInterfaceId() { return this.getStringAttribute('network_interface_id'); } public set networkInterfaceId(value: string) { this._networkInterfaceId = value; } public resetNetworkInterfaceId() { this._networkInterfaceId = undefined; } // Temporarily expose input value. Use with caution. public get networkInterfaceIdInput() { return this._networkInterfaceId; } // origin - computed: true, optional: false, required: false public get origin() { return this.getStringAttribute('origin'); } // route_table_id - computed: false, optional: false, required: true private _routeTableId?: string; public get routeTableId() { return this.getStringAttribute('route_table_id'); } public set routeTableId(value: string) { this._routeTableId = value; } // Temporarily expose input value. Use with caution. public get routeTableIdInput() { return this._routeTableId; } // state - computed: true, optional: false, required: false public get state() { return this.getStringAttribute('state'); } // transit_gateway_id - computed: false, optional: true, required: false private _transitGatewayId?: string; public get transitGatewayId() { return this.getStringAttribute('transit_gateway_id'); } public set transitGatewayId(value: string) { this._transitGatewayId = value; } public resetTransitGatewayId() { this._transitGatewayId = undefined; } // Temporarily expose input value. Use with caution. public get transitGatewayIdInput() { return this._transitGatewayId; } // vpc_endpoint_id - computed: false, optional: true, required: false private _vpcEndpointId?: string; public get vpcEndpointId() { return this.getStringAttribute('vpc_endpoint_id'); } public set vpcEndpointId(value: string) { this._vpcEndpointId = value; } public resetVpcEndpointId() { this._vpcEndpointId = undefined; } // Temporarily expose input value. Use with caution. public get vpcEndpointIdInput() { return this._vpcEndpointId; } // vpc_peering_connection_id - computed: false, optional: true, required: false private _vpcPeeringConnectionId?: string; public get vpcPeeringConnectionId() { return this.getStringAttribute('vpc_peering_connection_id'); } public set vpcPeeringConnectionId(value: string) { this._vpcPeeringConnectionId = value; } public resetVpcPeeringConnectionId() { this._vpcPeeringConnectionId = undefined; } // Temporarily expose input value. Use with caution. public get vpcPeeringConnectionIdInput() { return this._vpcPeeringConnectionId; } // timeouts - computed: false, optional: true, required: false private _timeouts = new RouteTimeoutsOutputReference(this as any, "timeouts", true); public get timeouts() { return this._timeouts; } public putTimeouts(value: RouteTimeouts) { this._timeouts.internalValue = value; } public resetTimeouts() { this._timeouts.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get timeoutsInput() { return this._timeouts.internalValue; } // ========= // SYNTHESIS // ========= protected synthesizeAttributes(): { [name: string]: any } { return { carrier_gateway_id: cdktf.stringToTerraform(this._carrierGatewayId), destination_cidr_block: cdktf.stringToTerraform(this._destinationCidrBlock), destination_ipv6_cidr_block: cdktf.stringToTerraform(this._destinationIpv6CidrBlock), destination_prefix_list_id: cdktf.stringToTerraform(this._destinationPrefixListId), egress_only_gateway_id: cdktf.stringToTerraform(this._egressOnlyGatewayId), gateway_id: cdktf.stringToTerraform(this._gatewayId), instance_id: cdktf.stringToTerraform(this._instanceId), local_gateway_id: cdktf.stringToTerraform(this._localGatewayId), nat_gateway_id: cdktf.stringToTerraform(this._natGatewayId), network_interface_id: cdktf.stringToTerraform(this._networkInterfaceId), route_table_id: cdktf.stringToTerraform(this._routeTableId), transit_gateway_id: cdktf.stringToTerraform(this._transitGatewayId), vpc_endpoint_id: cdktf.stringToTerraform(this._vpcEndpointId), vpc_peering_connection_id: cdktf.stringToTerraform(this._vpcPeeringConnectionId), timeouts: routeTimeoutsToTerraform(this._timeouts.internalValue), }; } }