// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function ecsTaskSetCapacityProviderStrategyToTerraform(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 {
        base: cdktf.numberToTerraform(struct.base),
        capacity_provider: cdktf.stringToTerraform(struct.capacityProvider),
        weight: cdktf.numberToTerraform(struct.weight),
    };
}
export function ecsTaskSetLoadBalancerToTerraform(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 {
        container_name: cdktf.stringToTerraform(struct.containerName),
        container_port: cdktf.numberToTerraform(struct.containerPort),
        load_balancer_name: cdktf.stringToTerraform(struct.loadBalancerName),
        target_group_arn: cdktf.stringToTerraform(struct.targetGroupArn),
    };
}
export function ecsTaskSetNetworkConfigurationToTerraform(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 {
        assign_public_ip: cdktf.booleanToTerraform(struct.assignPublicIp),
        security_groups: cdktf.listMapper(cdktf.stringToTerraform)(struct.securityGroups),
        subnets: cdktf.listMapper(cdktf.stringToTerraform)(struct.subnets),
    };
}
export class EcsTaskSetNetworkConfigurationOutputReference 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._assignPublicIp !== undefined) {
            hasAnyValues = true;
            internalValueResult.assignPublicIp = this._assignPublicIp;
        }
        if (this._securityGroups !== undefined) {
            hasAnyValues = true;
            internalValueResult.securityGroups = this._securityGroups;
        }
        if (this._subnets !== undefined) {
            hasAnyValues = true;
            internalValueResult.subnets = this._subnets;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._assignPublicIp = undefined;
            this._securityGroups = undefined;
            this._subnets = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._assignPublicIp = value.assignPublicIp;
            this._securityGroups = value.securityGroups;
            this._subnets = value.subnets;
        }
    }
    // assign_public_ip - computed: false, optional: true, required: false
    _assignPublicIp;
    get assignPublicIp() {
        return this.getBooleanAttribute('assign_public_ip');
    }
    set assignPublicIp(value) {
        this._assignPublicIp = value;
    }
    resetAssignPublicIp() {
        this._assignPublicIp = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get assignPublicIpInput() {
        return this._assignPublicIp;
    }
    // security_groups - computed: false, 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: false, optional: false, required: true
    _subnets;
    get subnets() {
        return cdktf.Fn.tolist(this.getListAttribute('subnets'));
    }
    set subnets(value) {
        this._subnets = value;
    }
    // Temporarily expose input value. Use with caution.
    get subnetsInput() {
        return this._subnets;
    }
}
export function ecsTaskSetScaleToTerraform(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 {
        unit: cdktf.stringToTerraform(struct.unit),
        value: cdktf.numberToTerraform(struct.value),
    };
}
export class EcsTaskSetScaleOutputReference 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._unit !== undefined) {
            hasAnyValues = true;
            internalValueResult.unit = this._unit;
        }
        if (this._value !== undefined) {
            hasAnyValues = true;
            internalValueResult.value = this._value;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._unit = undefined;
            this._value = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._unit = value.unit;
            this._value = value.value;
        }
    }
    // unit - computed: false, optional: true, required: false
    _unit;
    get unit() {
        return this.getStringAttribute('unit');
    }
    set unit(value) {
        this._unit = value;
    }
    resetUnit() {
        this._unit = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get unitInput() {
        return this._unit;
    }
    // value - computed: false, optional: true, required: false
    _value;
    get value() {
        return this.getNumberAttribute('value');
    }
    set value(value) {
        this._value = value;
    }
    resetValue() {
        this._value = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get valueInput() {
        return this._value;
    }
}
export function ecsTaskSetServiceRegistriesToTerraform(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 {
        container_name: cdktf.stringToTerraform(struct.containerName),
        container_port: cdktf.numberToTerraform(struct.containerPort),
        port: cdktf.numberToTerraform(struct.port),
        registry_arn: cdktf.stringToTerraform(struct.registryArn),
    };
}
export class EcsTaskSetServiceRegistriesOutputReference 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._containerName !== undefined) {
            hasAnyValues = true;
            internalValueResult.containerName = this._containerName;
        }
        if (this._containerPort !== undefined) {
            hasAnyValues = true;
            internalValueResult.containerPort = this._containerPort;
        }
        if (this._port !== undefined) {
            hasAnyValues = true;
            internalValueResult.port = this._port;
        }
        if (this._registryArn !== undefined) {
            hasAnyValues = true;
            internalValueResult.registryArn = this._registryArn;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._containerName = undefined;
            this._containerPort = undefined;
            this._port = undefined;
            this._registryArn = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._containerName = value.containerName;
            this._containerPort = value.containerPort;
            this._port = value.port;
            this._registryArn = value.registryArn;
        }
    }
    // container_name - computed: false, optional: true, required: false
    _containerName;
    get containerName() {
        return this.getStringAttribute('container_name');
    }
    set containerName(value) {
        this._containerName = value;
    }
    resetContainerName() {
        this._containerName = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get containerNameInput() {
        return this._containerName;
    }
    // container_port - computed: false, optional: true, required: false
    _containerPort;
    get containerPort() {
        return this.getNumberAttribute('container_port');
    }
    set containerPort(value) {
        this._containerPort = value;
    }
    resetContainerPort() {
        this._containerPort = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get containerPortInput() {
        return this._containerPort;
    }
    // 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;
    }
    // registry_arn - computed: false, optional: false, required: true
    _registryArn;
    get registryArn() {
        return this.getStringAttribute('registry_arn');
    }
    set registryArn(value) {
        this._registryArn = value;
    }
    // Temporarily expose input value. Use with caution.
    get registryArnInput() {
        return this._registryArn;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/ecs_task_set aws_ecs_task_set}
*/
export class EcsTaskSet extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_ecs_task_set";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/ecs_task_set aws_ecs_task_set} 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 EcsTaskSetConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_ecs_task_set',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._cluster = config.cluster;
        this._externalId = config.externalId;
        this._forceDelete = config.forceDelete;
        this._launchType = config.launchType;
        this._platformVersion = config.platformVersion;
        this._service = config.service;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._taskDefinition = config.taskDefinition;
        this._waitUntilStable = config.waitUntilStable;
        this._waitUntilStableTimeout = config.waitUntilStableTimeout;
        this._capacityProviderStrategy = config.capacityProviderStrategy;
        this._loadBalancer = config.loadBalancer;
        this._networkConfiguration.internalValue = config.networkConfiguration;
        this._scale.internalValue = config.scale;
        this._serviceRegistries.internalValue = config.serviceRegistries;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // cluster - computed: false, optional: false, required: true
    _cluster;
    get cluster() {
        return this.getStringAttribute('cluster');
    }
    set cluster(value) {
        this._cluster = value;
    }
    // Temporarily expose input value. Use with caution.
    get clusterInput() {
        return this._cluster;
    }
    // external_id - computed: true, optional: true, required: false
    _externalId;
    get externalId() {
        return this.getStringAttribute('external_id');
    }
    set externalId(value) {
        this._externalId = value;
    }
    resetExternalId() {
        this._externalId = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get externalIdInput() {
        return this._externalId;
    }
    // force_delete - computed: false, optional: true, required: false
    _forceDelete;
    get forceDelete() {
        return this.getBooleanAttribute('force_delete');
    }
    set forceDelete(value) {
        this._forceDelete = value;
    }
    resetForceDelete() {
        this._forceDelete = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get forceDeleteInput() {
        return this._forceDelete;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // launch_type - computed: true, optional: true, required: false
    _launchType;
    get launchType() {
        return this.getStringAttribute('launch_type');
    }
    set launchType(value) {
        this._launchType = value;
    }
    resetLaunchType() {
        this._launchType = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get launchTypeInput() {
        return this._launchType;
    }
    // platform_version - computed: true, optional: true, required: false
    _platformVersion;
    get platformVersion() {
        return this.getStringAttribute('platform_version');
    }
    set platformVersion(value) {
        this._platformVersion = value;
    }
    resetPlatformVersion() {
        this._platformVersion = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get platformVersionInput() {
        return this._platformVersion;
    }
    // service - computed: false, optional: false, required: true
    _service;
    get service() {
        return this.getStringAttribute('service');
    }
    set service(value) {
        this._service = value;
    }
    // Temporarily expose input value. Use with caution.
    get serviceInput() {
        return this._service;
    }
    // stability_status - computed: true, optional: false, required: false
    get stabilityStatus() {
        return this.getStringAttribute('stability_status');
    }
    // status - computed: true, optional: false, required: false
    get status() {
        return this.getStringAttribute('status');
    }
    // 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;
    }
    // task_definition - computed: false, optional: false, required: true
    _taskDefinition;
    get taskDefinition() {
        return this.getStringAttribute('task_definition');
    }
    set taskDefinition(value) {
        this._taskDefinition = value;
    }
    // Temporarily expose input value. Use with caution.
    get taskDefinitionInput() {
        return this._taskDefinition;
    }
    // task_set_id - computed: true, optional: false, required: false
    get taskSetId() {
        return this.getStringAttribute('task_set_id');
    }
    // wait_until_stable - computed: false, optional: true, required: false
    _waitUntilStable;
    get waitUntilStable() {
        return this.getBooleanAttribute('wait_until_stable');
    }
    set waitUntilStable(value) {
        this._waitUntilStable = value;
    }
    resetWaitUntilStable() {
        this._waitUntilStable = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get waitUntilStableInput() {
        return this._waitUntilStable;
    }
    // wait_until_stable_timeout - computed: false, optional: true, required: false
    _waitUntilStableTimeout;
    get waitUntilStableTimeout() {
        return this.getStringAttribute('wait_until_stable_timeout');
    }
    set waitUntilStableTimeout(value) {
        this._waitUntilStableTimeout = value;
    }
    resetWaitUntilStableTimeout() {
        this._waitUntilStableTimeout = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get waitUntilStableTimeoutInput() {
        return this._waitUntilStableTimeout;
    }
    // capacity_provider_strategy - computed: false, optional: true, required: false
    _capacityProviderStrategy;
    get capacityProviderStrategy() {
        // Getting the computed value is not yet implemented
        return cdktf.Token.asAny(cdktf.Fn.tolist(this.interpolationForAttribute('capacity_provider_strategy')));
    }
    set capacityProviderStrategy(value) {
        this._capacityProviderStrategy = value;
    }
    resetCapacityProviderStrategy() {
        this._capacityProviderStrategy = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get capacityProviderStrategyInput() {
        return this._capacityProviderStrategy;
    }
    // load_balancer - computed: false, optional: true, required: false
    _loadBalancer;
    get loadBalancer() {
        // Getting the computed value is not yet implemented
        return cdktf.Token.asAny(cdktf.Fn.tolist(this.interpolationForAttribute('load_balancer')));
    }
    set loadBalancer(value) {
        this._loadBalancer = value;
    }
    resetLoadBalancer() {
        this._loadBalancer = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get loadBalancerInput() {
        return this._loadBalancer;
    }
    // network_configuration - computed: false, optional: true, required: false
    _networkConfiguration = new EcsTaskSetNetworkConfigurationOutputReference(this, "network_configuration", true);
    get networkConfiguration() {
        return this._networkConfiguration;
    }
    putNetworkConfiguration(value) {
        this._networkConfiguration.internalValue = value;
    }
    resetNetworkConfiguration() {
        this._networkConfiguration.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get networkConfigurationInput() {
        return this._networkConfiguration.internalValue;
    }
    // scale - computed: false, optional: true, required: false
    _scale = new EcsTaskSetScaleOutputReference(this, "scale", true);
    get scale() {
        return this._scale;
    }
    putScale(value) {
        this._scale.internalValue = value;
    }
    resetScale() {
        this._scale.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get scaleInput() {
        return this._scale.internalValue;
    }
    // service_registries - computed: false, optional: true, required: false
    _serviceRegistries = new EcsTaskSetServiceRegistriesOutputReference(this, "service_registries", true);
    get serviceRegistries() {
        return this._serviceRegistries;
    }
    putServiceRegistries(value) {
        this._serviceRegistries.internalValue = value;
    }
    resetServiceRegistries() {
        this._serviceRegistries.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get serviceRegistriesInput() {
        return this._serviceRegistries.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            cluster: cdktf.stringToTerraform(this._cluster),
            external_id: cdktf.stringToTerraform(this._externalId),
            force_delete: cdktf.booleanToTerraform(this._forceDelete),
            launch_type: cdktf.stringToTerraform(this._launchType),
            platform_version: cdktf.stringToTerraform(this._platformVersion),
            service: cdktf.stringToTerraform(this._service),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            task_definition: cdktf.stringToTerraform(this._taskDefinition),
            wait_until_stable: cdktf.booleanToTerraform(this._waitUntilStable),
            wait_until_stable_timeout: cdktf.stringToTerraform(this._waitUntilStableTimeout),
            capacity_provider_strategy: cdktf.listMapper(ecsTaskSetCapacityProviderStrategyToTerraform)(this._capacityProviderStrategy),
            load_balancer: cdktf.listMapper(ecsTaskSetLoadBalancerToTerraform)(this._loadBalancer),
            network_configuration: ecsTaskSetNetworkConfigurationToTerraform(this._networkConfiguration.internalValue),
            scale: ecsTaskSetScaleToTerraform(this._scale.internalValue),
            service_registries: ecsTaskSetServiceRegistriesToTerraform(this._serviceRegistries.internalValue),
        };
    }
}
//# sourceMappingURL=ecs-task-set.js.map