// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function albTargetGroupHealthCheckToTerraform(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 {
        enabled: cdktf.booleanToTerraform(struct.enabled),
        healthy_threshold: cdktf.numberToTerraform(struct.healthyThreshold),
        interval: cdktf.numberToTerraform(struct.interval),
        matcher: cdktf.stringToTerraform(struct.matcher),
        path: cdktf.stringToTerraform(struct.path),
        port: cdktf.stringToTerraform(struct.port),
        protocol: cdktf.stringToTerraform(struct.protocol),
        timeout: cdktf.numberToTerraform(struct.timeout),
        unhealthy_threshold: cdktf.numberToTerraform(struct.unhealthyThreshold),
    };
}
export class AlbTargetGroupHealthCheckOutputReference 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._enabled !== undefined) {
            hasAnyValues = true;
            internalValueResult.enabled = this._enabled;
        }
        if (this._healthyThreshold !== undefined) {
            hasAnyValues = true;
            internalValueResult.healthyThreshold = this._healthyThreshold;
        }
        if (this._interval !== undefined) {
            hasAnyValues = true;
            internalValueResult.interval = this._interval;
        }
        if (this._matcher !== undefined) {
            hasAnyValues = true;
            internalValueResult.matcher = this._matcher;
        }
        if (this._path !== undefined) {
            hasAnyValues = true;
            internalValueResult.path = this._path;
        }
        if (this._port !== undefined) {
            hasAnyValues = true;
            internalValueResult.port = this._port;
        }
        if (this._protocol !== undefined) {
            hasAnyValues = true;
            internalValueResult.protocol = this._protocol;
        }
        if (this._timeout !== undefined) {
            hasAnyValues = true;
            internalValueResult.timeout = this._timeout;
        }
        if (this._unhealthyThreshold !== undefined) {
            hasAnyValues = true;
            internalValueResult.unhealthyThreshold = this._unhealthyThreshold;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._enabled = undefined;
            this._healthyThreshold = undefined;
            this._interval = undefined;
            this._matcher = undefined;
            this._path = undefined;
            this._port = undefined;
            this._protocol = undefined;
            this._timeout = undefined;
            this._unhealthyThreshold = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._enabled = value.enabled;
            this._healthyThreshold = value.healthyThreshold;
            this._interval = value.interval;
            this._matcher = value.matcher;
            this._path = value.path;
            this._port = value.port;
            this._protocol = value.protocol;
            this._timeout = value.timeout;
            this._unhealthyThreshold = value.unhealthyThreshold;
        }
    }
    // 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;
    }
    // healthy_threshold - computed: false, optional: true, required: false
    _healthyThreshold;
    get healthyThreshold() {
        return this.getNumberAttribute('healthy_threshold');
    }
    set healthyThreshold(value) {
        this._healthyThreshold = value;
    }
    resetHealthyThreshold() {
        this._healthyThreshold = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get healthyThresholdInput() {
        return this._healthyThreshold;
    }
    // interval - computed: false, optional: true, required: false
    _interval;
    get interval() {
        return this.getNumberAttribute('interval');
    }
    set interval(value) {
        this._interval = value;
    }
    resetInterval() {
        this._interval = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get intervalInput() {
        return this._interval;
    }
    // matcher - computed: true, optional: true, required: false
    _matcher;
    get matcher() {
        return this.getStringAttribute('matcher');
    }
    set matcher(value) {
        this._matcher = value;
    }
    resetMatcher() {
        this._matcher = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get matcherInput() {
        return this._matcher;
    }
    // path - computed: true, optional: true, required: false
    _path;
    get path() {
        return this.getStringAttribute('path');
    }
    set path(value) {
        this._path = value;
    }
    resetPath() {
        this._path = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get pathInput() {
        return this._path;
    }
    // port - computed: false, optional: true, required: false
    _port;
    get port() {
        return this.getStringAttribute('port');
    }
    set port(value) {
        this._port = value;
    }
    resetPort() {
        this._port = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get portInput() {
        return this._port;
    }
    // protocol - computed: false, optional: true, required: false
    _protocol;
    get protocol() {
        return this.getStringAttribute('protocol');
    }
    set protocol(value) {
        this._protocol = value;
    }
    resetProtocol() {
        this._protocol = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get protocolInput() {
        return this._protocol;
    }
    // timeout - computed: true, optional: true, required: false
    _timeout;
    get timeout() {
        return this.getNumberAttribute('timeout');
    }
    set timeout(value) {
        this._timeout = value;
    }
    resetTimeout() {
        this._timeout = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get timeoutInput() {
        return this._timeout;
    }
    // unhealthy_threshold - computed: false, optional: true, required: false
    _unhealthyThreshold;
    get unhealthyThreshold() {
        return this.getNumberAttribute('unhealthy_threshold');
    }
    set unhealthyThreshold(value) {
        this._unhealthyThreshold = value;
    }
    resetUnhealthyThreshold() {
        this._unhealthyThreshold = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get unhealthyThresholdInput() {
        return this._unhealthyThreshold;
    }
}
export function albTargetGroupStickinessToTerraform(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 {
        cookie_duration: cdktf.numberToTerraform(struct.cookieDuration),
        cookie_name: cdktf.stringToTerraform(struct.cookieName),
        enabled: cdktf.booleanToTerraform(struct.enabled),
        type: cdktf.stringToTerraform(struct.type),
    };
}
export class AlbTargetGroupStickinessOutputReference 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._cookieDuration !== undefined) {
            hasAnyValues = true;
            internalValueResult.cookieDuration = this._cookieDuration;
        }
        if (this._cookieName !== undefined) {
            hasAnyValues = true;
            internalValueResult.cookieName = this._cookieName;
        }
        if (this._enabled !== undefined) {
            hasAnyValues = true;
            internalValueResult.enabled = this._enabled;
        }
        if (this._type !== undefined) {
            hasAnyValues = true;
            internalValueResult.type = this._type;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._cookieDuration = undefined;
            this._cookieName = undefined;
            this._enabled = undefined;
            this._type = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._cookieDuration = value.cookieDuration;
            this._cookieName = value.cookieName;
            this._enabled = value.enabled;
            this._type = value.type;
        }
    }
    // cookie_duration - computed: false, optional: true, required: false
    _cookieDuration;
    get cookieDuration() {
        return this.getNumberAttribute('cookie_duration');
    }
    set cookieDuration(value) {
        this._cookieDuration = value;
    }
    resetCookieDuration() {
        this._cookieDuration = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get cookieDurationInput() {
        return this._cookieDuration;
    }
    // cookie_name - computed: false, optional: true, required: false
    _cookieName;
    get cookieName() {
        return this.getStringAttribute('cookie_name');
    }
    set cookieName(value) {
        this._cookieName = value;
    }
    resetCookieName() {
        this._cookieName = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get cookieNameInput() {
        return this._cookieName;
    }
    // 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;
    }
    // type - computed: false, optional: false, required: true
    _type;
    get type() {
        return this.getStringAttribute('type');
    }
    set type(value) {
        this._type = value;
    }
    // Temporarily expose input value. Use with caution.
    get typeInput() {
        return this._type;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/alb_target_group aws_alb_target_group}
*/
export class AlbTargetGroup extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_alb_target_group";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/alb_target_group aws_alb_target_group} 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 AlbTargetGroupConfig = {}
    */
    constructor(scope, id, config = {}) {
        super(scope, id, {
            terraformResourceType: 'aws_alb_target_group',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._connectionTermination = config.connectionTermination;
        this._deregistrationDelay = config.deregistrationDelay;
        this._lambdaMultiValueHeadersEnabled = config.lambdaMultiValueHeadersEnabled;
        this._loadBalancingAlgorithmType = config.loadBalancingAlgorithmType;
        this._name = config.name;
        this._namePrefix = config.namePrefix;
        this._port = config.port;
        this._preserveClientIp = config.preserveClientIp;
        this._protocol = config.protocol;
        this._protocolVersion = config.protocolVersion;
        this._proxyProtocolV2 = config.proxyProtocolV2;
        this._slowStart = config.slowStart;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._targetType = config.targetType;
        this._vpcId = config.vpcId;
        this._healthCheck.internalValue = config.healthCheck;
        this._stickiness.internalValue = config.stickiness;
    }
    // ==========
    // 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');
    }
    // connection_termination - computed: false, optional: true, required: false
    _connectionTermination;
    get connectionTermination() {
        return this.getBooleanAttribute('connection_termination');
    }
    set connectionTermination(value) {
        this._connectionTermination = value;
    }
    resetConnectionTermination() {
        this._connectionTermination = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get connectionTerminationInput() {
        return this._connectionTermination;
    }
    // deregistration_delay - computed: false, optional: true, required: false
    _deregistrationDelay;
    get deregistrationDelay() {
        return this.getStringAttribute('deregistration_delay');
    }
    set deregistrationDelay(value) {
        this._deregistrationDelay = value;
    }
    resetDeregistrationDelay() {
        this._deregistrationDelay = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get deregistrationDelayInput() {
        return this._deregistrationDelay;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // lambda_multi_value_headers_enabled - computed: false, optional: true, required: false
    _lambdaMultiValueHeadersEnabled;
    get lambdaMultiValueHeadersEnabled() {
        return this.getBooleanAttribute('lambda_multi_value_headers_enabled');
    }
    set lambdaMultiValueHeadersEnabled(value) {
        this._lambdaMultiValueHeadersEnabled = value;
    }
    resetLambdaMultiValueHeadersEnabled() {
        this._lambdaMultiValueHeadersEnabled = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get lambdaMultiValueHeadersEnabledInput() {
        return this._lambdaMultiValueHeadersEnabled;
    }
    // load_balancing_algorithm_type - computed: true, optional: true, required: false
    _loadBalancingAlgorithmType;
    get loadBalancingAlgorithmType() {
        return this.getStringAttribute('load_balancing_algorithm_type');
    }
    set loadBalancingAlgorithmType(value) {
        this._loadBalancingAlgorithmType = value;
    }
    resetLoadBalancingAlgorithmType() {
        this._loadBalancingAlgorithmType = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get loadBalancingAlgorithmTypeInput() {
        return this._loadBalancingAlgorithmType;
    }
    // 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;
    }
    // port - computed: false, optional: true, required: false
    _port;
    get port() {
        return this.getNumberAttribute('port');
    }
    set port(value) {
        this._port = value;
    }
    resetPort() {
        this._port = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get portInput() {
        return this._port;
    }
    // preserve_client_ip - computed: true, optional: true, required: false
    _preserveClientIp;
    get preserveClientIp() {
        return this.getStringAttribute('preserve_client_ip');
    }
    set preserveClientIp(value) {
        this._preserveClientIp = value;
    }
    resetPreserveClientIp() {
        this._preserveClientIp = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get preserveClientIpInput() {
        return this._preserveClientIp;
    }
    // protocol - computed: false, optional: true, required: false
    _protocol;
    get protocol() {
        return this.getStringAttribute('protocol');
    }
    set protocol(value) {
        this._protocol = value;
    }
    resetProtocol() {
        this._protocol = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get protocolInput() {
        return this._protocol;
    }
    // protocol_version - computed: true, optional: true, required: false
    _protocolVersion;
    get protocolVersion() {
        return this.getStringAttribute('protocol_version');
    }
    set protocolVersion(value) {
        this._protocolVersion = value;
    }
    resetProtocolVersion() {
        this._protocolVersion = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get protocolVersionInput() {
        return this._protocolVersion;
    }
    // proxy_protocol_v2 - computed: false, optional: true, required: false
    _proxyProtocolV2;
    get proxyProtocolV2() {
        return this.getBooleanAttribute('proxy_protocol_v2');
    }
    set proxyProtocolV2(value) {
        this._proxyProtocolV2 = value;
    }
    resetProxyProtocolV2() {
        this._proxyProtocolV2 = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get proxyProtocolV2Input() {
        return this._proxyProtocolV2;
    }
    // slow_start - computed: false, optional: true, required: false
    _slowStart;
    get slowStart() {
        return this.getNumberAttribute('slow_start');
    }
    set slowStart(value) {
        this._slowStart = value;
    }
    resetSlowStart() {
        this._slowStart = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get slowStartInput() {
        return this._slowStart;
    }
    // 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;
    }
    // target_type - computed: false, optional: true, required: false
    _targetType;
    get targetType() {
        return this.getStringAttribute('target_type');
    }
    set targetType(value) {
        this._targetType = value;
    }
    resetTargetType() {
        this._targetType = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get targetTypeInput() {
        return this._targetType;
    }
    // vpc_id - computed: false, optional: true, required: false
    _vpcId;
    get vpcId() {
        return this.getStringAttribute('vpc_id');
    }
    set vpcId(value) {
        this._vpcId = value;
    }
    resetVpcId() {
        this._vpcId = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get vpcIdInput() {
        return this._vpcId;
    }
    // health_check - computed: false, optional: true, required: false
    _healthCheck = new AlbTargetGroupHealthCheckOutputReference(this, "health_check", true);
    get healthCheck() {
        return this._healthCheck;
    }
    putHealthCheck(value) {
        this._healthCheck.internalValue = value;
    }
    resetHealthCheck() {
        this._healthCheck.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get healthCheckInput() {
        return this._healthCheck.internalValue;
    }
    // stickiness - computed: false, optional: true, required: false
    _stickiness = new AlbTargetGroupStickinessOutputReference(this, "stickiness", true);
    get stickiness() {
        return this._stickiness;
    }
    putStickiness(value) {
        this._stickiness.internalValue = value;
    }
    resetStickiness() {
        this._stickiness.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get stickinessInput() {
        return this._stickiness.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            connection_termination: cdktf.booleanToTerraform(this._connectionTermination),
            deregistration_delay: cdktf.stringToTerraform(this._deregistrationDelay),
            lambda_multi_value_headers_enabled: cdktf.booleanToTerraform(this._lambdaMultiValueHeadersEnabled),
            load_balancing_algorithm_type: cdktf.stringToTerraform(this._loadBalancingAlgorithmType),
            name: cdktf.stringToTerraform(this._name),
            name_prefix: cdktf.stringToTerraform(this._namePrefix),
            port: cdktf.numberToTerraform(this._port),
            preserve_client_ip: cdktf.stringToTerraform(this._preserveClientIp),
            protocol: cdktf.stringToTerraform(this._protocol),
            protocol_version: cdktf.stringToTerraform(this._protocolVersion),
            proxy_protocol_v2: cdktf.booleanToTerraform(this._proxyProtocolV2),
            slow_start: cdktf.numberToTerraform(this._slowStart),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            target_type: cdktf.stringToTerraform(this._targetType),
            vpc_id: cdktf.stringToTerraform(this._vpcId),
            health_check: albTargetGroupHealthCheckToTerraform(this._healthCheck.internalValue),
            stickiness: albTargetGroupStickinessToTerraform(this._stickiness.internalValue),
        };
    }
}
//# sourceMappingURL=alb-target-group.js.map