// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function amiEbsBlockDeviceToTerraform(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 {
        delete_on_termination: cdktf.booleanToTerraform(struct.deleteOnTermination),
        device_name: cdktf.stringToTerraform(struct.deviceName),
        encrypted: cdktf.booleanToTerraform(struct.encrypted),
        iops: cdktf.numberToTerraform(struct.iops),
        outpost_arn: cdktf.stringToTerraform(struct.outpostArn),
        snapshot_id: cdktf.stringToTerraform(struct.snapshotId),
        throughput: cdktf.numberToTerraform(struct.throughput),
        volume_size: cdktf.numberToTerraform(struct.volumeSize),
        volume_type: cdktf.stringToTerraform(struct.volumeType),
    };
}
export function amiEphemeralBlockDeviceToTerraform(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 {
        device_name: cdktf.stringToTerraform(struct.deviceName),
        virtual_name: cdktf.stringToTerraform(struct.virtualName),
    };
}
export function amiTimeoutsToTerraform(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 AmiTimeoutsOutputReference 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/ami aws_ami}
*/
export class Ami extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_ami";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/ami aws_ami} 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 AmiConfig
    */
    constructor(scope, id, config) {
        super(scope, id, {
            terraformResourceType: 'aws_ami',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._architecture = config.architecture;
        this._bootMode = config.bootMode;
        this._description = config.description;
        this._enaSupport = config.enaSupport;
        this._imageLocation = config.imageLocation;
        this._kernelId = config.kernelId;
        this._name = config.name;
        this._ramdiskId = config.ramdiskId;
        this._rootDeviceName = config.rootDeviceName;
        this._sriovNetSupport = config.sriovNetSupport;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._virtualizationType = config.virtualizationType;
        this._ebsBlockDevice = config.ebsBlockDevice;
        this._ephemeralBlockDevice = config.ephemeralBlockDevice;
        this._timeouts.internalValue = config.timeouts;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // architecture - computed: false, optional: true, required: false
    _architecture;
    get architecture() {
        return this.getStringAttribute('architecture');
    }
    set architecture(value) {
        this._architecture = value;
    }
    resetArchitecture() {
        this._architecture = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get architectureInput() {
        return this._architecture;
    }
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // boot_mode - computed: false, optional: true, required: false
    _bootMode;
    get bootMode() {
        return this.getStringAttribute('boot_mode');
    }
    set bootMode(value) {
        this._bootMode = value;
    }
    resetBootMode() {
        this._bootMode = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get bootModeInput() {
        return this._bootMode;
    }
    // description - computed: false, optional: true, required: false
    _description;
    get description() {
        return this.getStringAttribute('description');
    }
    set description(value) {
        this._description = value;
    }
    resetDescription() {
        this._description = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get descriptionInput() {
        return this._description;
    }
    // ena_support - computed: false, optional: true, required: false
    _enaSupport;
    get enaSupport() {
        return this.getBooleanAttribute('ena_support');
    }
    set enaSupport(value) {
        this._enaSupport = value;
    }
    resetEnaSupport() {
        this._enaSupport = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get enaSupportInput() {
        return this._enaSupport;
    }
    // hypervisor - computed: true, optional: false, required: false
    get hypervisor() {
        return this.getStringAttribute('hypervisor');
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // image_location - computed: true, optional: true, required: false
    _imageLocation;
    get imageLocation() {
        return this.getStringAttribute('image_location');
    }
    set imageLocation(value) {
        this._imageLocation = value;
    }
    resetImageLocation() {
        this._imageLocation = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get imageLocationInput() {
        return this._imageLocation;
    }
    // image_owner_alias - computed: true, optional: false, required: false
    get imageOwnerAlias() {
        return this.getStringAttribute('image_owner_alias');
    }
    // image_type - computed: true, optional: false, required: false
    get imageType() {
        return this.getStringAttribute('image_type');
    }
    // kernel_id - computed: false, optional: true, required: false
    _kernelId;
    get kernelId() {
        return this.getStringAttribute('kernel_id');
    }
    set kernelId(value) {
        this._kernelId = value;
    }
    resetKernelId() {
        this._kernelId = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get kernelIdInput() {
        return this._kernelId;
    }
    // manage_ebs_snapshots - computed: true, optional: false, required: false
    get manageEbsSnapshots() {
        return this.getBooleanAttribute('manage_ebs_snapshots');
    }
    // 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;
    }
    // owner_id - computed: true, optional: false, required: false
    get ownerId() {
        return this.getStringAttribute('owner_id');
    }
    // platform - computed: true, optional: false, required: false
    get platform() {
        return this.getStringAttribute('platform');
    }
    // platform_details - computed: true, optional: false, required: false
    get platformDetails() {
        return this.getStringAttribute('platform_details');
    }
    // public - computed: true, optional: false, required: false
    get public() {
        return this.getBooleanAttribute('public');
    }
    // ramdisk_id - computed: false, optional: true, required: false
    _ramdiskId;
    get ramdiskId() {
        return this.getStringAttribute('ramdisk_id');
    }
    set ramdiskId(value) {
        this._ramdiskId = value;
    }
    resetRamdiskId() {
        this._ramdiskId = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get ramdiskIdInput() {
        return this._ramdiskId;
    }
    // root_device_name - computed: false, optional: true, required: false
    _rootDeviceName;
    get rootDeviceName() {
        return this.getStringAttribute('root_device_name');
    }
    set rootDeviceName(value) {
        this._rootDeviceName = value;
    }
    resetRootDeviceName() {
        this._rootDeviceName = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get rootDeviceNameInput() {
        return this._rootDeviceName;
    }
    // root_snapshot_id - computed: true, optional: false, required: false
    get rootSnapshotId() {
        return this.getStringAttribute('root_snapshot_id');
    }
    // sriov_net_support - computed: false, optional: true, required: false
    _sriovNetSupport;
    get sriovNetSupport() {
        return this.getStringAttribute('sriov_net_support');
    }
    set sriovNetSupport(value) {
        this._sriovNetSupport = value;
    }
    resetSriovNetSupport() {
        this._sriovNetSupport = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get sriovNetSupportInput() {
        return this._sriovNetSupport;
    }
    // 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;
    }
    // usage_operation - computed: true, optional: false, required: false
    get usageOperation() {
        return this.getStringAttribute('usage_operation');
    }
    // virtualization_type - computed: false, optional: true, required: false
    _virtualizationType;
    get virtualizationType() {
        return this.getStringAttribute('virtualization_type');
    }
    set virtualizationType(value) {
        this._virtualizationType = value;
    }
    resetVirtualizationType() {
        this._virtualizationType = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get virtualizationTypeInput() {
        return this._virtualizationType;
    }
    // ebs_block_device - computed: false, optional: true, required: false
    _ebsBlockDevice;
    get ebsBlockDevice() {
        // Getting the computed value is not yet implemented
        return cdktf.Token.asAny(cdktf.Fn.tolist(this.interpolationForAttribute('ebs_block_device')));
    }
    set ebsBlockDevice(value) {
        this._ebsBlockDevice = value;
    }
    resetEbsBlockDevice() {
        this._ebsBlockDevice = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get ebsBlockDeviceInput() {
        return this._ebsBlockDevice;
    }
    // ephemeral_block_device - computed: false, optional: true, required: false
    _ephemeralBlockDevice;
    get ephemeralBlockDevice() {
        // Getting the computed value is not yet implemented
        return cdktf.Token.asAny(cdktf.Fn.tolist(this.interpolationForAttribute('ephemeral_block_device')));
    }
    set ephemeralBlockDevice(value) {
        this._ephemeralBlockDevice = value;
    }
    resetEphemeralBlockDevice() {
        this._ephemeralBlockDevice = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get ephemeralBlockDeviceInput() {
        return this._ephemeralBlockDevice;
    }
    // timeouts - computed: false, optional: true, required: false
    _timeouts = new AmiTimeoutsOutputReference(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 {
            architecture: cdktf.stringToTerraform(this._architecture),
            boot_mode: cdktf.stringToTerraform(this._bootMode),
            description: cdktf.stringToTerraform(this._description),
            ena_support: cdktf.booleanToTerraform(this._enaSupport),
            image_location: cdktf.stringToTerraform(this._imageLocation),
            kernel_id: cdktf.stringToTerraform(this._kernelId),
            name: cdktf.stringToTerraform(this._name),
            ramdisk_id: cdktf.stringToTerraform(this._ramdiskId),
            root_device_name: cdktf.stringToTerraform(this._rootDeviceName),
            sriov_net_support: cdktf.stringToTerraform(this._sriovNetSupport),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            virtualization_type: cdktf.stringToTerraform(this._virtualizationType),
            ebs_block_device: cdktf.listMapper(amiEbsBlockDeviceToTerraform)(this._ebsBlockDevice),
            ephemeral_block_device: cdktf.listMapper(amiEphemeralBlockDeviceToTerraform)(this._ephemeralBlockDevice),
            timeouts: amiTimeoutsToTerraform(this._timeouts.internalValue),
        };
    }
}
//# sourceMappingURL=ami.js.map