// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * AWS VPC */ export interface VpcIpamPoolCidrConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/vpc_ipam_pool_cidr.html#cidr VpcIpamPoolCidr#cidr} */ readonly cidr?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/vpc_ipam_pool_cidr.html#ipam_pool_id VpcIpamPoolCidr#ipam_pool_id} */ readonly ipamPoolId: string; /** * cidr_authorization_context block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/vpc_ipam_pool_cidr.html#cidr_authorization_context VpcIpamPoolCidr#cidr_authorization_context} */ readonly cidrAuthorizationContext?: VpcIpamPoolCidrCidrAuthorizationContext; } export interface VpcIpamPoolCidrCidrAuthorizationContext { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/vpc_ipam_pool_cidr.html#message VpcIpamPoolCidr#message} */ readonly message?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/vpc_ipam_pool_cidr.html#signature VpcIpamPoolCidr#signature} */ readonly signature?: string; } export function vpcIpamPoolCidrCidrAuthorizationContextToTerraform(struct?: VpcIpamPoolCidrCidrAuthorizationContextOutputReference | VpcIpamPoolCidrCidrAuthorizationContext): 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 { message: cdktf.stringToTerraform(struct!.message), signature: cdktf.stringToTerraform(struct!.signature), } } export class VpcIpamPoolCidrCidrAuthorizationContextOutputReference 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(): VpcIpamPoolCidrCidrAuthorizationContext | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._message !== undefined) { hasAnyValues = true; internalValueResult.message = this._message; } if (this._signature !== undefined) { hasAnyValues = true; internalValueResult.signature = this._signature; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: VpcIpamPoolCidrCidrAuthorizationContext | undefined) { if (value === undefined) { this.isEmptyObject = false; this._message = undefined; this._signature = undefined; } else { this.isEmptyObject = Object.keys(value).length === 0; this._message = value.message; this._signature = value.signature; } } // message - computed: false, optional: true, required: false private _message?: string; public get message() { return this.getStringAttribute('message'); } public set message(value: string) { this._message = value; } public resetMessage() { this._message = undefined; } // Temporarily expose input value. Use with caution. public get messageInput() { return this._message; } // signature - computed: false, optional: true, required: false private _signature?: string; public get signature() { return this.getStringAttribute('signature'); } public set signature(value: string) { this._signature = value; } public resetSignature() { this._signature = undefined; } // Temporarily expose input value. Use with caution. public get signatureInput() { return this._signature; } } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/r/vpc_ipam_pool_cidr.html aws_vpc_ipam_pool_cidr} */ export class VpcIpamPoolCidr extends cdktf.TerraformResource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_vpc_ipam_pool_cidr"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/r/vpc_ipam_pool_cidr.html aws_vpc_ipam_pool_cidr} 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 VpcIpamPoolCidrConfig */ public constructor(scope: Construct, id: string, config: VpcIpamPoolCidrConfig) { super(scope, id, { terraformResourceType: 'aws_vpc_ipam_pool_cidr', terraformGeneratorMetadata: { providerName: 'aws' }, provider: config.provider, dependsOn: config.dependsOn, count: config.count, lifecycle: config.lifecycle }); this._cidr = config.cidr; this._ipamPoolId = config.ipamPoolId; this._cidrAuthorizationContext.internalValue = config.cidrAuthorizationContext; } // ========== // ATTRIBUTES // ========== // cidr - computed: true, optional: true, required: false private _cidr?: string; public get cidr() { return this.getStringAttribute('cidr'); } public set cidr(value: string) { this._cidr = value; } public resetCidr() { this._cidr = undefined; } // Temporarily expose input value. Use with caution. public get cidrInput() { return this._cidr; } // id - computed: true, optional: true, required: false public get id() { return this.getStringAttribute('id'); } // ipam_pool_id - computed: false, optional: false, required: true private _ipamPoolId?: string; public get ipamPoolId() { return this.getStringAttribute('ipam_pool_id'); } public set ipamPoolId(value: string) { this._ipamPoolId = value; } // Temporarily expose input value. Use with caution. public get ipamPoolIdInput() { return this._ipamPoolId; } // cidr_authorization_context - computed: false, optional: true, required: false private _cidrAuthorizationContext = new VpcIpamPoolCidrCidrAuthorizationContextOutputReference(this as any, "cidr_authorization_context", true); public get cidrAuthorizationContext() { return this._cidrAuthorizationContext; } public putCidrAuthorizationContext(value: VpcIpamPoolCidrCidrAuthorizationContext) { this._cidrAuthorizationContext.internalValue = value; } public resetCidrAuthorizationContext() { this._cidrAuthorizationContext.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get cidrAuthorizationContextInput() { return this._cidrAuthorizationContext.internalValue; } // ========= // SYNTHESIS // ========= protected synthesizeAttributes(): { [name: string]: any } { return { cidr: cdktf.stringToTerraform(this._cidr), ipam_pool_id: cdktf.stringToTerraform(this._ipamPoolId), cidr_authorization_context: vpcIpamPoolCidrCidrAuthorizationContextToTerraform(this._cidrAuthorizationContext.internalValue), }; } }