// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function subnetTimeoutsToTerraform(struct) {
    if (!cdktf.canInspect(struct) || cdktf.Tokenization.isResolvable(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),
    };
}
export class SubnetTimeoutsOutputReference extends cdktf.ComplexObject {
    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
    */
    constructor(terraformResource, terraformAttribute, isSingleItem) {
        super(terraformResource, terraformAttribute, isSingleItem);
    }
    get internalValue() {
        let hasAnyValues = this.isEmptyObject;
        const internalValueResult = {};
        if (this._create !== undefined) {
            hasAnyValues = true;
            internalValueResult.create = this._create;
        }
        if (this._delete !== undefined) {
            hasAnyValues = true;
            internalValueResult.delete = this._delete;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._create = undefined;
            this._delete = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._create = value.create;
            this._delete = value.delete;
        }
    }
    // create - computed: false, optional: true, required: false
    _create;
    get create() {
        return this.getStringAttribute('create');
    }
    set create(value) {
        this._create = value;
    }
    resetCreate() {
        this._create = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get createInput() {
        return this._create;
    }
    // delete - computed: false, optional: true, required: false
    _delete;
    get delete() {
        return this.getStringAttribute('delete');
    }
    set delete(value) {
        this._delete = value;
    }
    resetDelete() {
        this._delete = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get deleteInput() {
        return this._delete;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/subnet aws_subnet}
*/
export class Subnet extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_subnet";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/subnet aws_subnet} 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 SubnetConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_subnet',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._assignIpv6AddressOnCreation = config.assignIpv6AddressOnCreation;
        this._availabilityZone = config.availabilityZone;
        this._availabilityZoneId = config.availabilityZoneId;
        this._cidrBlock = config.cidrBlock;
        this._customerOwnedIpv4Pool = config.customerOwnedIpv4Pool;
        this._enableDns64 = config.enableDns64;
        this._enableResourceNameDnsARecordOnLaunch = config.enableResourceNameDnsARecordOnLaunch;
        this._enableResourceNameDnsAaaaRecordOnLaunch = config.enableResourceNameDnsAaaaRecordOnLaunch;
        this._ipv6CidrBlock = config.ipv6CidrBlock;
        this._ipv6Native = config.ipv6Native;
        this._mapCustomerOwnedIpOnLaunch = config.mapCustomerOwnedIpOnLaunch;
        this._mapPublicIpOnLaunch = config.mapPublicIpOnLaunch;
        this._outpostArn = config.outpostArn;
        this._privateDnsHostnameTypeOnLaunch = config.privateDnsHostnameTypeOnLaunch;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._vpcId = config.vpcId;
        this._timeouts.internalValue = config.timeouts;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // assign_ipv6_address_on_creation - computed: false, optional: true, required: false
    _assignIpv6AddressOnCreation;
    get assignIpv6AddressOnCreation() {
        return this.getBooleanAttribute('assign_ipv6_address_on_creation');
    }
    set assignIpv6AddressOnCreation(value) {
        this._assignIpv6AddressOnCreation = value;
    }
    resetAssignIpv6AddressOnCreation() {
        this._assignIpv6AddressOnCreation = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get assignIpv6AddressOnCreationInput() {
        return this._assignIpv6AddressOnCreation;
    }
    // availability_zone - computed: true, optional: true, required: false
    _availabilityZone;
    get availabilityZone() {
        return this.getStringAttribute('availability_zone');
    }
    set availabilityZone(value) {
        this._availabilityZone = value;
    }
    resetAvailabilityZone() {
        this._availabilityZone = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get availabilityZoneInput() {
        return this._availabilityZone;
    }
    // availability_zone_id - computed: true, optional: true, required: false
    _availabilityZoneId;
    get availabilityZoneId() {
        return this.getStringAttribute('availability_zone_id');
    }
    set availabilityZoneId(value) {
        this._availabilityZoneId = value;
    }
    resetAvailabilityZoneId() {
        this._availabilityZoneId = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get availabilityZoneIdInput() {
        return this._availabilityZoneId;
    }
    // cidr_block - computed: false, optional: true, required: false
    _cidrBlock;
    get cidrBlock() {
        return this.getStringAttribute('cidr_block');
    }
    set cidrBlock(value) {
        this._cidrBlock = value;
    }
    resetCidrBlock() {
        this._cidrBlock = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get cidrBlockInput() {
        return this._cidrBlock;
    }
    // customer_owned_ipv4_pool - computed: false, optional: true, required: false
    _customerOwnedIpv4Pool;
    get customerOwnedIpv4Pool() {
        return this.getStringAttribute('customer_owned_ipv4_pool');
    }
    set customerOwnedIpv4Pool(value) {
        this._customerOwnedIpv4Pool = value;
    }
    resetCustomerOwnedIpv4Pool() {
        this._customerOwnedIpv4Pool = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get customerOwnedIpv4PoolInput() {
        return this._customerOwnedIpv4Pool;
    }
    // enable_dns64 - computed: false, optional: true, required: false
    _enableDns64;
    get enableDns64() {
        return this.getBooleanAttribute('enable_dns64');
    }
    set enableDns64(value) {
        this._enableDns64 = value;
    }
    resetEnableDns64() {
        this._enableDns64 = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get enableDns64Input() {
        return this._enableDns64;
    }
    // enable_resource_name_dns_a_record_on_launch - computed: false, optional: true, required: false
    _enableResourceNameDnsARecordOnLaunch;
    get enableResourceNameDnsARecordOnLaunch() {
        return this.getBooleanAttribute('enable_resource_name_dns_a_record_on_launch');
    }
    set enableResourceNameDnsARecordOnLaunch(value) {
        this._enableResourceNameDnsARecordOnLaunch = value;
    }
    resetEnableResourceNameDnsARecordOnLaunch() {
        this._enableResourceNameDnsARecordOnLaunch = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get enableResourceNameDnsARecordOnLaunchInput() {
        return this._enableResourceNameDnsARecordOnLaunch;
    }
    // enable_resource_name_dns_aaaa_record_on_launch - computed: false, optional: true, required: false
    _enableResourceNameDnsAaaaRecordOnLaunch;
    get enableResourceNameDnsAaaaRecordOnLaunch() {
        return this.getBooleanAttribute('enable_resource_name_dns_aaaa_record_on_launch');
    }
    set enableResourceNameDnsAaaaRecordOnLaunch(value) {
        this._enableResourceNameDnsAaaaRecordOnLaunch = value;
    }
    resetEnableResourceNameDnsAaaaRecordOnLaunch() {
        this._enableResourceNameDnsAaaaRecordOnLaunch = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get enableResourceNameDnsAaaaRecordOnLaunchInput() {
        return this._enableResourceNameDnsAaaaRecordOnLaunch;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // ipv6_cidr_block - computed: false, optional: true, required: false
    _ipv6CidrBlock;
    get ipv6CidrBlock() {
        return this.getStringAttribute('ipv6_cidr_block');
    }
    set ipv6CidrBlock(value) {
        this._ipv6CidrBlock = value;
    }
    resetIpv6CidrBlock() {
        this._ipv6CidrBlock = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get ipv6CidrBlockInput() {
        return this._ipv6CidrBlock;
    }
    // ipv6_cidr_block_association_id - computed: true, optional: false, required: false
    get ipv6CidrBlockAssociationId() {
        return this.getStringAttribute('ipv6_cidr_block_association_id');
    }
    // ipv6_native - computed: false, optional: true, required: false
    _ipv6Native;
    get ipv6Native() {
        return this.getBooleanAttribute('ipv6_native');
    }
    set ipv6Native(value) {
        this._ipv6Native = value;
    }
    resetIpv6Native() {
        this._ipv6Native = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get ipv6NativeInput() {
        return this._ipv6Native;
    }
    // map_customer_owned_ip_on_launch - computed: false, optional: true, required: false
    _mapCustomerOwnedIpOnLaunch;
    get mapCustomerOwnedIpOnLaunch() {
        return this.getBooleanAttribute('map_customer_owned_ip_on_launch');
    }
    set mapCustomerOwnedIpOnLaunch(value) {
        this._mapCustomerOwnedIpOnLaunch = value;
    }
    resetMapCustomerOwnedIpOnLaunch() {
        this._mapCustomerOwnedIpOnLaunch = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get mapCustomerOwnedIpOnLaunchInput() {
        return this._mapCustomerOwnedIpOnLaunch;
    }
    // map_public_ip_on_launch - computed: false, optional: true, required: false
    _mapPublicIpOnLaunch;
    get mapPublicIpOnLaunch() {
        return this.getBooleanAttribute('map_public_ip_on_launch');
    }
    set mapPublicIpOnLaunch(value) {
        this._mapPublicIpOnLaunch = value;
    }
    resetMapPublicIpOnLaunch() {
        this._mapPublicIpOnLaunch = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get mapPublicIpOnLaunchInput() {
        return this._mapPublicIpOnLaunch;
    }
    // outpost_arn - computed: false, optional: true, required: false
    _outpostArn;
    get outpostArn() {
        return this.getStringAttribute('outpost_arn');
    }
    set outpostArn(value) {
        this._outpostArn = value;
    }
    resetOutpostArn() {
        this._outpostArn = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get outpostArnInput() {
        return this._outpostArn;
    }
    // owner_id - computed: true, optional: false, required: false
    get ownerId() {
        return this.getStringAttribute('owner_id');
    }
    // private_dns_hostname_type_on_launch - computed: true, optional: true, required: false
    _privateDnsHostnameTypeOnLaunch;
    get privateDnsHostnameTypeOnLaunch() {
        return this.getStringAttribute('private_dns_hostname_type_on_launch');
    }
    set privateDnsHostnameTypeOnLaunch(value) {
        this._privateDnsHostnameTypeOnLaunch = value;
    }
    resetPrivateDnsHostnameTypeOnLaunch() {
        this._privateDnsHostnameTypeOnLaunch = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get privateDnsHostnameTypeOnLaunchInput() {
        return this._privateDnsHostnameTypeOnLaunch;
    }
    // tags - computed: false, optional: true, required: false
    _tags;
    get tags() {
        return this.getStringMapAttribute('tags');
    }
    set tags(value) {
        this._tags = value;
    }
    resetTags() {
        this._tags = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get tagsInput() {
        return this._tags;
    }
    // tags_all - computed: true, optional: true, required: false
    _tagsAll;
    get tagsAll() {
        return this.getStringMapAttribute('tags_all');
    }
    set tagsAll(value) {
        this._tagsAll = value;
    }
    resetTagsAll() {
        this._tagsAll = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get tagsAllInput() {
        return this._tagsAll;
    }
    // vpc_id - computed: false, optional: false, required: true
    _vpcId;
    get vpcId() {
        return this.getStringAttribute('vpc_id');
    }
    set vpcId(value) {
        this._vpcId = value;
    }
    // Temporarily expose input value. Use with caution.
    get vpcIdInput() {
        return this._vpcId;
    }
    // timeouts - computed: false, optional: true, required: false
    _timeouts = new SubnetTimeoutsOutputReference(this, "timeouts", true);
    get timeouts() {
        return this._timeouts;
    }
    putTimeouts(value) {
        this._timeouts.internalValue = value;
    }
    resetTimeouts() {
        this._timeouts.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get timeoutsInput() {
        return this._timeouts.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            assign_ipv6_address_on_creation: cdktf.booleanToTerraform(this._assignIpv6AddressOnCreation),
            availability_zone: cdktf.stringToTerraform(this._availabilityZone),
            availability_zone_id: cdktf.stringToTerraform(this._availabilityZoneId),
            cidr_block: cdktf.stringToTerraform(this._cidrBlock),
            customer_owned_ipv4_pool: cdktf.stringToTerraform(this._customerOwnedIpv4Pool),
            enable_dns64: cdktf.booleanToTerraform(this._enableDns64),
            enable_resource_name_dns_a_record_on_launch: cdktf.booleanToTerraform(this._enableResourceNameDnsARecordOnLaunch),
            enable_resource_name_dns_aaaa_record_on_launch: cdktf.booleanToTerraform(this._enableResourceNameDnsAaaaRecordOnLaunch),
            ipv6_cidr_block: cdktf.stringToTerraform(this._ipv6CidrBlock),
            ipv6_native: cdktf.booleanToTerraform(this._ipv6Native),
            map_customer_owned_ip_on_launch: cdktf.booleanToTerraform(this._mapCustomerOwnedIpOnLaunch),
            map_public_ip_on_launch: cdktf.booleanToTerraform(this._mapPublicIpOnLaunch),
            outpost_arn: cdktf.stringToTerraform(this._outpostArn),
            private_dns_hostname_type_on_launch: cdktf.stringToTerraform(this._privateDnsHostnameTypeOnLaunch),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            vpc_id: cdktf.stringToTerraform(this._vpcId),
            timeouts: subnetTimeoutsToTerraform(this._timeouts.internalValue),
        };
    }
}
//# sourceMappingURL=subnet.js.map