// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function ecsClusterConfigurationExecuteCommandConfigurationLogConfigurationToTerraform(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 {
        cloud_watch_encryption_enabled: cdktf.booleanToTerraform(struct.cloudWatchEncryptionEnabled),
        cloud_watch_log_group_name: cdktf.stringToTerraform(struct.cloudWatchLogGroupName),
        s3_bucket_encryption_enabled: cdktf.booleanToTerraform(struct.s3BucketEncryptionEnabled),
        s3_bucket_name: cdktf.stringToTerraform(struct.s3BucketName),
        s3_key_prefix: cdktf.stringToTerraform(struct.s3KeyPrefix),
    };
}
export class EcsClusterConfigurationExecuteCommandConfigurationLogConfigurationOutputReference 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._cloudWatchEncryptionEnabled !== undefined) {
            hasAnyValues = true;
            internalValueResult.cloudWatchEncryptionEnabled = this._cloudWatchEncryptionEnabled;
        }
        if (this._cloudWatchLogGroupName !== undefined) {
            hasAnyValues = true;
            internalValueResult.cloudWatchLogGroupName = this._cloudWatchLogGroupName;
        }
        if (this._s3BucketEncryptionEnabled !== undefined) {
            hasAnyValues = true;
            internalValueResult.s3BucketEncryptionEnabled = this._s3BucketEncryptionEnabled;
        }
        if (this._s3BucketName !== undefined) {
            hasAnyValues = true;
            internalValueResult.s3BucketName = this._s3BucketName;
        }
        if (this._s3KeyPrefix !== undefined) {
            hasAnyValues = true;
            internalValueResult.s3KeyPrefix = this._s3KeyPrefix;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._cloudWatchEncryptionEnabled = undefined;
            this._cloudWatchLogGroupName = undefined;
            this._s3BucketEncryptionEnabled = undefined;
            this._s3BucketName = undefined;
            this._s3KeyPrefix = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._cloudWatchEncryptionEnabled = value.cloudWatchEncryptionEnabled;
            this._cloudWatchLogGroupName = value.cloudWatchLogGroupName;
            this._s3BucketEncryptionEnabled = value.s3BucketEncryptionEnabled;
            this._s3BucketName = value.s3BucketName;
            this._s3KeyPrefix = value.s3KeyPrefix;
        }
    }
    // cloud_watch_encryption_enabled - computed: false, optional: true, required: false
    _cloudWatchEncryptionEnabled;
    get cloudWatchEncryptionEnabled() {
        return this.getBooleanAttribute('cloud_watch_encryption_enabled');
    }
    set cloudWatchEncryptionEnabled(value) {
        this._cloudWatchEncryptionEnabled = value;
    }
    resetCloudWatchEncryptionEnabled() {
        this._cloudWatchEncryptionEnabled = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get cloudWatchEncryptionEnabledInput() {
        return this._cloudWatchEncryptionEnabled;
    }
    // cloud_watch_log_group_name - computed: false, optional: true, required: false
    _cloudWatchLogGroupName;
    get cloudWatchLogGroupName() {
        return this.getStringAttribute('cloud_watch_log_group_name');
    }
    set cloudWatchLogGroupName(value) {
        this._cloudWatchLogGroupName = value;
    }
    resetCloudWatchLogGroupName() {
        this._cloudWatchLogGroupName = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get cloudWatchLogGroupNameInput() {
        return this._cloudWatchLogGroupName;
    }
    // s3_bucket_encryption_enabled - computed: false, optional: true, required: false
    _s3BucketEncryptionEnabled;
    get s3BucketEncryptionEnabled() {
        return this.getBooleanAttribute('s3_bucket_encryption_enabled');
    }
    set s3BucketEncryptionEnabled(value) {
        this._s3BucketEncryptionEnabled = value;
    }
    resetS3BucketEncryptionEnabled() {
        this._s3BucketEncryptionEnabled = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get s3BucketEncryptionEnabledInput() {
        return this._s3BucketEncryptionEnabled;
    }
    // s3_bucket_name - computed: false, optional: true, required: false
    _s3BucketName;
    get s3BucketName() {
        return this.getStringAttribute('s3_bucket_name');
    }
    set s3BucketName(value) {
        this._s3BucketName = value;
    }
    resetS3BucketName() {
        this._s3BucketName = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get s3BucketNameInput() {
        return this._s3BucketName;
    }
    // s3_key_prefix - computed: false, optional: true, required: false
    _s3KeyPrefix;
    get s3KeyPrefix() {
        return this.getStringAttribute('s3_key_prefix');
    }
    set s3KeyPrefix(value) {
        this._s3KeyPrefix = value;
    }
    resetS3KeyPrefix() {
        this._s3KeyPrefix = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get s3KeyPrefixInput() {
        return this._s3KeyPrefix;
    }
}
export function ecsClusterConfigurationExecuteCommandConfigurationToTerraform(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 {
        kms_key_id: cdktf.stringToTerraform(struct.kmsKeyId),
        logging: cdktf.stringToTerraform(struct.logging),
        log_configuration: ecsClusterConfigurationExecuteCommandConfigurationLogConfigurationToTerraform(struct.logConfiguration),
    };
}
export class EcsClusterConfigurationExecuteCommandConfigurationOutputReference 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._kmsKeyId !== undefined) {
            hasAnyValues = true;
            internalValueResult.kmsKeyId = this._kmsKeyId;
        }
        if (this._logging !== undefined) {
            hasAnyValues = true;
            internalValueResult.logging = this._logging;
        }
        if (this._logConfiguration?.internalValue !== undefined) {
            hasAnyValues = true;
            internalValueResult.logConfiguration = this._logConfiguration?.internalValue;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._kmsKeyId = undefined;
            this._logging = undefined;
            this._logConfiguration.internalValue = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._kmsKeyId = value.kmsKeyId;
            this._logging = value.logging;
            this._logConfiguration.internalValue = value.logConfiguration;
        }
    }
    // kms_key_id - computed: false, optional: true, required: false
    _kmsKeyId;
    get kmsKeyId() {
        return this.getStringAttribute('kms_key_id');
    }
    set kmsKeyId(value) {
        this._kmsKeyId = value;
    }
    resetKmsKeyId() {
        this._kmsKeyId = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get kmsKeyIdInput() {
        return this._kmsKeyId;
    }
    // logging - computed: false, optional: true, required: false
    _logging;
    get logging() {
        return this.getStringAttribute('logging');
    }
    set logging(value) {
        this._logging = value;
    }
    resetLogging() {
        this._logging = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get loggingInput() {
        return this._logging;
    }
    // log_configuration - computed: false, optional: true, required: false
    _logConfiguration = new EcsClusterConfigurationExecuteCommandConfigurationLogConfigurationOutputReference(this, "log_configuration", true);
    get logConfiguration() {
        return this._logConfiguration;
    }
    putLogConfiguration(value) {
        this._logConfiguration.internalValue = value;
    }
    resetLogConfiguration() {
        this._logConfiguration.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get logConfigurationInput() {
        return this._logConfiguration.internalValue;
    }
}
export function ecsClusterConfigurationToTerraform(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 {
        execute_command_configuration: ecsClusterConfigurationExecuteCommandConfigurationToTerraform(struct.executeCommandConfiguration),
    };
}
export class EcsClusterConfigurationOutputReference 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._executeCommandConfiguration?.internalValue !== undefined) {
            hasAnyValues = true;
            internalValueResult.executeCommandConfiguration = this._executeCommandConfiguration?.internalValue;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._executeCommandConfiguration.internalValue = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._executeCommandConfiguration.internalValue = value.executeCommandConfiguration;
        }
    }
    // execute_command_configuration - computed: false, optional: true, required: false
    _executeCommandConfiguration = new EcsClusterConfigurationExecuteCommandConfigurationOutputReference(this, "execute_command_configuration", true);
    get executeCommandConfiguration() {
        return this._executeCommandConfiguration;
    }
    putExecuteCommandConfiguration(value) {
        this._executeCommandConfiguration.internalValue = value;
    }
    resetExecuteCommandConfiguration() {
        this._executeCommandConfiguration.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get executeCommandConfigurationInput() {
        return this._executeCommandConfiguration.internalValue;
    }
}
export function ecsClusterDefaultCapacityProviderStrategyToTerraform(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 ecsClusterSettingToTerraform(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 {
        name: cdktf.stringToTerraform(struct.name),
        value: cdktf.stringToTerraform(struct.value),
    };
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/ecs_cluster aws_ecs_cluster}
*/
export class EcsCluster extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_ecs_cluster";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/ecs_cluster aws_ecs_cluster} 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 EcsClusterConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_ecs_cluster',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._capacityProviders = config.capacityProviders;
        this._name = config.name;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._configuration.internalValue = config.configuration;
        this._defaultCapacityProviderStrategy = config.defaultCapacityProviderStrategy;
        this._setting = config.setting;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // capacity_providers - computed: true, optional: true, required: false
    _capacityProviders;
    get capacityProviders() {
        return cdktf.Fn.tolist(this.getListAttribute('capacity_providers'));
    }
    set capacityProviders(value) {
        this._capacityProviders = value;
    }
    resetCapacityProviders() {
        this._capacityProviders = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get capacityProvidersInput() {
        return this._capacityProviders;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // name - computed: false, optional: false, required: true
    _name;
    get name() {
        return this.getStringAttribute('name');
    }
    set name(value) {
        this._name = value;
    }
    // Temporarily expose input value. Use with caution.
    get nameInput() {
        return this._name;
    }
    // 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;
    }
    // configuration - computed: false, optional: true, required: false
    _configuration = new EcsClusterConfigurationOutputReference(this, "configuration", true);
    get configuration() {
        return this._configuration;
    }
    putConfiguration(value) {
        this._configuration.internalValue = value;
    }
    resetConfiguration() {
        this._configuration.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get configurationInput() {
        return this._configuration.internalValue;
    }
    // default_capacity_provider_strategy - computed: false, optional: true, required: false
    _defaultCapacityProviderStrategy;
    get defaultCapacityProviderStrategy() {
        // Getting the computed value is not yet implemented
        return cdktf.Token.asAny(cdktf.Fn.tolist(this.interpolationForAttribute('default_capacity_provider_strategy')));
    }
    set defaultCapacityProviderStrategy(value) {
        this._defaultCapacityProviderStrategy = value;
    }
    resetDefaultCapacityProviderStrategy() {
        this._defaultCapacityProviderStrategy = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get defaultCapacityProviderStrategyInput() {
        return this._defaultCapacityProviderStrategy;
    }
    // setting - computed: false, optional: true, required: false
    _setting;
    get setting() {
        // Getting the computed value is not yet implemented
        return cdktf.Token.asAny(cdktf.Fn.tolist(this.interpolationForAttribute('setting')));
    }
    set setting(value) {
        this._setting = value;
    }
    resetSetting() {
        this._setting = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get settingInput() {
        return this._setting;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            capacity_providers: cdktf.listMapper(cdktf.stringToTerraform)(this._capacityProviders),
            name: cdktf.stringToTerraform(this._name),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            configuration: ecsClusterConfigurationToTerraform(this._configuration.internalValue),
            default_capacity_provider_strategy: cdktf.listMapper(ecsClusterDefaultCapacityProviderStrategyToTerraform)(this._defaultCapacityProviderStrategy),
            setting: cdktf.listMapper(ecsClusterSettingToTerraform)(this._setting),
        };
    }
}
//# sourceMappingURL=ecs-cluster.js.map