// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function datasyncLocationEfsEc2ConfigToTerraform(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 {
        security_group_arns: cdktf.listMapper(cdktf.stringToTerraform)(struct.securityGroupArns),
        subnet_arn: cdktf.stringToTerraform(struct.subnetArn),
    };
}
export class DatasyncLocationEfsEc2ConfigOutputReference 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._securityGroupArns !== undefined) {
            hasAnyValues = true;
            internalValueResult.securityGroupArns = this._securityGroupArns;
        }
        if (this._subnetArn !== undefined) {
            hasAnyValues = true;
            internalValueResult.subnetArn = this._subnetArn;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._securityGroupArns = undefined;
            this._subnetArn = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._securityGroupArns = value.securityGroupArns;
            this._subnetArn = value.subnetArn;
        }
    }
    // security_group_arns - computed: false, optional: false, required: true
    _securityGroupArns;
    get securityGroupArns() {
        return cdktf.Fn.tolist(this.getListAttribute('security_group_arns'));
    }
    set securityGroupArns(value) {
        this._securityGroupArns = value;
    }
    // Temporarily expose input value. Use with caution.
    get securityGroupArnsInput() {
        return this._securityGroupArns;
    }
    // subnet_arn - computed: false, optional: false, required: true
    _subnetArn;
    get subnetArn() {
        return this.getStringAttribute('subnet_arn');
    }
    set subnetArn(value) {
        this._subnetArn = value;
    }
    // Temporarily expose input value. Use with caution.
    get subnetArnInput() {
        return this._subnetArn;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/datasync_location_efs aws_datasync_location_efs}
*/
export class DatasyncLocationEfs extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_datasync_location_efs";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/datasync_location_efs aws_datasync_location_efs} 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 DatasyncLocationEfsConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_datasync_location_efs',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._efsFileSystemArn = config.efsFileSystemArn;
        this._subdirectory = config.subdirectory;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._ec2Config.internalValue = config.ec2Config;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // efs_file_system_arn - computed: false, optional: false, required: true
    _efsFileSystemArn;
    get efsFileSystemArn() {
        return this.getStringAttribute('efs_file_system_arn');
    }
    set efsFileSystemArn(value) {
        this._efsFileSystemArn = value;
    }
    // Temporarily expose input value. Use with caution.
    get efsFileSystemArnInput() {
        return this._efsFileSystemArn;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // subdirectory - computed: false, optional: true, required: false
    _subdirectory;
    get subdirectory() {
        return this.getStringAttribute('subdirectory');
    }
    set subdirectory(value) {
        this._subdirectory = value;
    }
    resetSubdirectory() {
        this._subdirectory = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get subdirectoryInput() {
        return this._subdirectory;
    }
    // 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;
    }
    // uri - computed: true, optional: false, required: false
    get uri() {
        return this.getStringAttribute('uri');
    }
    // ec2_config - computed: false, optional: false, required: true
    _ec2Config = new DatasyncLocationEfsEc2ConfigOutputReference(this, "ec2_config", true);
    get ec2Config() {
        return this._ec2Config;
    }
    putEc2Config(value) {
        this._ec2Config.internalValue = value;
    }
    // Temporarily expose input value. Use with caution.
    get ec2ConfigInput() {
        return this._ec2Config.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            efs_file_system_arn: cdktf.stringToTerraform(this._efsFileSystemArn),
            subdirectory: cdktf.stringToTerraform(this._subdirectory),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            ec2_config: datasyncLocationEfsEc2ConfigToTerraform(this._ec2Config.internalValue),
        };
    }
}
//# sourceMappingURL=datasync-location-efs.js.map