// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function albAccessLogsToTerraform(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 {
        bucket: cdktf.stringToTerraform(struct.bucket),
        enabled: cdktf.booleanToTerraform(struct.enabled),
        prefix: cdktf.stringToTerraform(struct.prefix),
    };
}
export class AlbAccessLogsOutputReference 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._bucket !== undefined) {
            hasAnyValues = true;
            internalValueResult.bucket = this._bucket;
        }
        if (this._enabled !== undefined) {
            hasAnyValues = true;
            internalValueResult.enabled = this._enabled;
        }
        if (this._prefix !== undefined) {
            hasAnyValues = true;
            internalValueResult.prefix = this._prefix;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._bucket = undefined;
            this._enabled = undefined;
            this._prefix = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._bucket = value.bucket;
            this._enabled = value.enabled;
            this._prefix = value.prefix;
        }
    }
    // bucket - computed: false, optional: false, required: true
    _bucket;
    get bucket() {
        return this.getStringAttribute('bucket');
    }
    set bucket(value) {
        this._bucket = value;
    }
    // Temporarily expose input value. Use with caution.
    get bucketInput() {
        return this._bucket;
    }
    // enabled - computed: false, optional: true, required: false
    _enabled;
    get enabled() {
        return this.getBooleanAttribute('enabled');
    }
    set enabled(value) {
        this._enabled = value;
    }
    resetEnabled() {
        this._enabled = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get enabledInput() {
        return this._enabled;
    }
    // prefix - computed: false, optional: true, required: false
    _prefix;
    get prefix() {
        return this.getStringAttribute('prefix');
    }
    set prefix(value) {
        this._prefix = value;
    }
    resetPrefix() {
        this._prefix = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get prefixInput() {
        return this._prefix;
    }
}
export function albSubnetMappingToTerraform(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 {
        allocation_id: cdktf.stringToTerraform(struct.allocationId),
        ipv6_address: cdktf.stringToTerraform(struct.ipv6Address),
        private_ipv4_address: cdktf.stringToTerraform(struct.privateIpv4Address),
        subnet_id: cdktf.stringToTerraform(struct.subnetId),
    };
}
export function albTimeoutsToTerraform(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),
        update: cdktf.stringToTerraform(struct.update),
    };
}
export class AlbTimeoutsOutputReference 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;
        }
        if (this._update !== undefined) {
            hasAnyValues = true;
            internalValueResult.update = this._update;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        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
    _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;
    }
    // update - computed: false, optional: true, required: false
    _update;
    get update() {
        return this.getStringAttribute('update');
    }
    set update(value) {
        this._update = value;
    }
    resetUpdate() {
        this._update = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get updateInput() {
        return this._update;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/alb aws_alb}
*/
export class Alb extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_alb";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/alb aws_alb} 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 AlbConfig = {}
    */
    constructor(scope, id, config = {}) {
        super(scope, id, {
            terraformResourceType: 'aws_alb',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._customerOwnedIpv4Pool = config.customerOwnedIpv4Pool;
        this._desyncMitigationMode = config.desyncMitigationMode;
        this._dropInvalidHeaderFields = config.dropInvalidHeaderFields;
        this._enableCrossZoneLoadBalancing = config.enableCrossZoneLoadBalancing;
        this._enableDeletionProtection = config.enableDeletionProtection;
        this._enableHttp2 = config.enableHttp2;
        this._enableWafFailOpen = config.enableWafFailOpen;
        this._idleTimeout = config.idleTimeout;
        this._internal = config.internal;
        this._ipAddressType = config.ipAddressType;
        this._loadBalancerType = config.loadBalancerType;
        this._name = config.name;
        this._namePrefix = config.namePrefix;
        this._securityGroups = config.securityGroups;
        this._subnets = config.subnets;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._accessLogs.internalValue = config.accessLogs;
        this._subnetMapping = config.subnetMapping;
        this._timeouts.internalValue = config.timeouts;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // arn_suffix - computed: true, optional: false, required: false
    get arnSuffix() {
        return this.getStringAttribute('arn_suffix');
    }
    // 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;
    }
    // desync_mitigation_mode - computed: false, optional: true, required: false
    _desyncMitigationMode;
    get desyncMitigationMode() {
        return this.getStringAttribute('desync_mitigation_mode');
    }
    set desyncMitigationMode(value) {
        this._desyncMitigationMode = value;
    }
    resetDesyncMitigationMode() {
        this._desyncMitigationMode = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get desyncMitigationModeInput() {
        return this._desyncMitigationMode;
    }
    // dns_name - computed: true, optional: false, required: false
    get dnsName() {
        return this.getStringAttribute('dns_name');
    }
    // drop_invalid_header_fields - computed: false, optional: true, required: false
    _dropInvalidHeaderFields;
    get dropInvalidHeaderFields() {
        return this.getBooleanAttribute('drop_invalid_header_fields');
    }
    set dropInvalidHeaderFields(value) {
        this._dropInvalidHeaderFields = value;
    }
    resetDropInvalidHeaderFields() {
        this._dropInvalidHeaderFields = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get dropInvalidHeaderFieldsInput() {
        return this._dropInvalidHeaderFields;
    }
    // enable_cross_zone_load_balancing - computed: false, optional: true, required: false
    _enableCrossZoneLoadBalancing;
    get enableCrossZoneLoadBalancing() {
        return this.getBooleanAttribute('enable_cross_zone_load_balancing');
    }
    set enableCrossZoneLoadBalancing(value) {
        this._enableCrossZoneLoadBalancing = value;
    }
    resetEnableCrossZoneLoadBalancing() {
        this._enableCrossZoneLoadBalancing = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get enableCrossZoneLoadBalancingInput() {
        return this._enableCrossZoneLoadBalancing;
    }
    // enable_deletion_protection - computed: false, optional: true, required: false
    _enableDeletionProtection;
    get enableDeletionProtection() {
        return this.getBooleanAttribute('enable_deletion_protection');
    }
    set enableDeletionProtection(value) {
        this._enableDeletionProtection = value;
    }
    resetEnableDeletionProtection() {
        this._enableDeletionProtection = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get enableDeletionProtectionInput() {
        return this._enableDeletionProtection;
    }
    // enable_http2 - computed: false, optional: true, required: false
    _enableHttp2;
    get enableHttp2() {
        return this.getBooleanAttribute('enable_http2');
    }
    set enableHttp2(value) {
        this._enableHttp2 = value;
    }
    resetEnableHttp2() {
        this._enableHttp2 = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get enableHttp2Input() {
        return this._enableHttp2;
    }
    // enable_waf_fail_open - computed: false, optional: true, required: false
    _enableWafFailOpen;
    get enableWafFailOpen() {
        return this.getBooleanAttribute('enable_waf_fail_open');
    }
    set enableWafFailOpen(value) {
        this._enableWafFailOpen = value;
    }
    resetEnableWafFailOpen() {
        this._enableWafFailOpen = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get enableWafFailOpenInput() {
        return this._enableWafFailOpen;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // idle_timeout - computed: false, optional: true, required: false
    _idleTimeout;
    get idleTimeout() {
        return this.getNumberAttribute('idle_timeout');
    }
    set idleTimeout(value) {
        this._idleTimeout = value;
    }
    resetIdleTimeout() {
        this._idleTimeout = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get idleTimeoutInput() {
        return this._idleTimeout;
    }
    // internal - computed: true, optional: true, required: false
    _internal;
    get internal() {
        return this.getBooleanAttribute('internal');
    }
    set internal(value) {
        this._internal = value;
    }
    resetInternal() {
        this._internal = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get internalInput() {
        return this._internal;
    }
    // ip_address_type - computed: true, optional: true, required: false
    _ipAddressType;
    get ipAddressType() {
        return this.getStringAttribute('ip_address_type');
    }
    set ipAddressType(value) {
        this._ipAddressType = value;
    }
    resetIpAddressType() {
        this._ipAddressType = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get ipAddressTypeInput() {
        return this._ipAddressType;
    }
    // load_balancer_type - computed: false, optional: true, required: false
    _loadBalancerType;
    get loadBalancerType() {
        return this.getStringAttribute('load_balancer_type');
    }
    set loadBalancerType(value) {
        this._loadBalancerType = value;
    }
    resetLoadBalancerType() {
        this._loadBalancerType = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get loadBalancerTypeInput() {
        return this._loadBalancerType;
    }
    // name - computed: true, optional: true, required: false
    _name;
    get name() {
        return this.getStringAttribute('name');
    }
    set name(value) {
        this._name = value;
    }
    resetName() {
        this._name = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get nameInput() {
        return this._name;
    }
    // name_prefix - computed: false, optional: true, required: false
    _namePrefix;
    get namePrefix() {
        return this.getStringAttribute('name_prefix');
    }
    set namePrefix(value) {
        this._namePrefix = value;
    }
    resetNamePrefix() {
        this._namePrefix = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get namePrefixInput() {
        return this._namePrefix;
    }
    // security_groups - computed: true, optional: true, required: false
    _securityGroups;
    get securityGroups() {
        return cdktf.Fn.tolist(this.getListAttribute('security_groups'));
    }
    set securityGroups(value) {
        this._securityGroups = value;
    }
    resetSecurityGroups() {
        this._securityGroups = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get securityGroupsInput() {
        return this._securityGroups;
    }
    // subnets - computed: true, optional: true, required: false
    _subnets;
    get subnets() {
        return cdktf.Fn.tolist(this.getListAttribute('subnets'));
    }
    set subnets(value) {
        this._subnets = value;
    }
    resetSubnets() {
        this._subnets = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get subnetsInput() {
        return this._subnets;
    }
    // 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: true, optional: false, required: false
    get vpcId() {
        return this.getStringAttribute('vpc_id');
    }
    // zone_id - computed: true, optional: false, required: false
    get zoneId() {
        return this.getStringAttribute('zone_id');
    }
    // access_logs - computed: false, optional: true, required: false
    _accessLogs = new AlbAccessLogsOutputReference(this, "access_logs", true);
    get accessLogs() {
        return this._accessLogs;
    }
    putAccessLogs(value) {
        this._accessLogs.internalValue = value;
    }
    resetAccessLogs() {
        this._accessLogs.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get accessLogsInput() {
        return this._accessLogs.internalValue;
    }
    // subnet_mapping - computed: false, optional: true, required: false
    _subnetMapping;
    get subnetMapping() {
        // Getting the computed value is not yet implemented
        return cdktf.Token.asAny(cdktf.Fn.tolist(this.interpolationForAttribute('subnet_mapping')));
    }
    set subnetMapping(value) {
        this._subnetMapping = value;
    }
    resetSubnetMapping() {
        this._subnetMapping = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get subnetMappingInput() {
        return this._subnetMapping;
    }
    // timeouts - computed: false, optional: true, required: false
    _timeouts = new AlbTimeoutsOutputReference(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 {
            customer_owned_ipv4_pool: cdktf.stringToTerraform(this._customerOwnedIpv4Pool),
            desync_mitigation_mode: cdktf.stringToTerraform(this._desyncMitigationMode),
            drop_invalid_header_fields: cdktf.booleanToTerraform(this._dropInvalidHeaderFields),
            enable_cross_zone_load_balancing: cdktf.booleanToTerraform(this._enableCrossZoneLoadBalancing),
            enable_deletion_protection: cdktf.booleanToTerraform(this._enableDeletionProtection),
            enable_http2: cdktf.booleanToTerraform(this._enableHttp2),
            enable_waf_fail_open: cdktf.booleanToTerraform(this._enableWafFailOpen),
            idle_timeout: cdktf.numberToTerraform(this._idleTimeout),
            internal: cdktf.booleanToTerraform(this._internal),
            ip_address_type: cdktf.stringToTerraform(this._ipAddressType),
            load_balancer_type: cdktf.stringToTerraform(this._loadBalancerType),
            name: cdktf.stringToTerraform(this._name),
            name_prefix: cdktf.stringToTerraform(this._namePrefix),
            security_groups: cdktf.listMapper(cdktf.stringToTerraform)(this._securityGroups),
            subnets: cdktf.listMapper(cdktf.stringToTerraform)(this._subnets),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            access_logs: albAccessLogsToTerraform(this._accessLogs.internalValue),
            subnet_mapping: cdktf.listMapper(albSubnetMappingToTerraform)(this._subnetMapping),
            timeouts: albTimeoutsToTerraform(this._timeouts.internalValue),
        };
    }
}
//# sourceMappingURL=alb.js.map