// generated from terraform resource schema
import * as cdktf from 'cdktf';
export function secretsmanagerSecretReplicaToTerraform(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),
        region: cdktf.stringToTerraform(struct.region),
    };
}
export function secretsmanagerSecretRotationRulesToTerraform(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 {
        automatically_after_days: cdktf.numberToTerraform(struct.automaticallyAfterDays),
    };
}
export class SecretsmanagerSecretRotationRulesOutputReference 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._automaticallyAfterDays !== undefined) {
            hasAnyValues = true;
            internalValueResult.automaticallyAfterDays = this._automaticallyAfterDays;
        }
        return hasAnyValues ? internalValueResult : undefined;
    }
    set internalValue(value) {
        if (value === undefined) {
            this.isEmptyObject = false;
            this._automaticallyAfterDays = undefined;
        }
        else {
            this.isEmptyObject = Object.keys(value).length === 0;
            this._automaticallyAfterDays = value.automaticallyAfterDays;
        }
    }
    // automatically_after_days - computed: false, optional: false, required: true
    _automaticallyAfterDays;
    get automaticallyAfterDays() {
        return this.getNumberAttribute('automatically_after_days');
    }
    set automaticallyAfterDays(value) {
        this._automaticallyAfterDays = value;
    }
    // Temporarily expose input value. Use with caution.
    get automaticallyAfterDaysInput() {
        return this._automaticallyAfterDays;
    }
}
/**
* Represents a {@link https://www.terraform.io/docs/providers/aws/r/secretsmanager_secret aws_secretsmanager_secret}
*/
export class SecretsmanagerSecret extends cdktf.TerraformResource {
    // =================
    // STATIC PROPERTIES
    // =================
    static tfResourceType = "aws_secretsmanager_secret";
    // ===========
    // INITIALIZER
    // ===========
    /**
    * Create a new {@link https://www.terraform.io/docs/providers/aws/r/secretsmanager_secret aws_secretsmanager_secret} 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 SecretsmanagerSecretConfig = {}
    */
    constructor(scope, id, config = {}) {
        super(scope, id, {
            terraformResourceType: 'aws_secretsmanager_secret',
            terraformGeneratorMetadata: {
                providerName: 'aws'
            },
            provider: config.provider,
            dependsOn: config.dependsOn,
            count: config.count,
            lifecycle: config.lifecycle
        });
        this._description = config.description;
        this._forceOverwriteReplicaSecret = config.forceOverwriteReplicaSecret;
        this._kmsKeyId = config.kmsKeyId;
        this._name = config.name;
        this._namePrefix = config.namePrefix;
        this._policy = config.policy;
        this._recoveryWindowInDays = config.recoveryWindowInDays;
        this._rotationLambdaArn = config.rotationLambdaArn;
        this._tags = config.tags;
        this._tagsAll = config.tagsAll;
        this._replica = config.replica;
        this._rotationRules.internalValue = config.rotationRules;
    }
    // ==========
    // ATTRIBUTES
    // ==========
    // arn - computed: true, optional: false, required: false
    get arn() {
        return this.getStringAttribute('arn');
    }
    // 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;
    }
    // force_overwrite_replica_secret - computed: false, optional: true, required: false
    _forceOverwriteReplicaSecret;
    get forceOverwriteReplicaSecret() {
        return this.getBooleanAttribute('force_overwrite_replica_secret');
    }
    set forceOverwriteReplicaSecret(value) {
        this._forceOverwriteReplicaSecret = value;
    }
    resetForceOverwriteReplicaSecret() {
        this._forceOverwriteReplicaSecret = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get forceOverwriteReplicaSecretInput() {
        return this._forceOverwriteReplicaSecret;
    }
    // id - computed: true, optional: true, required: false
    get id() {
        return this.getStringAttribute('id');
    }
    // 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;
    }
    // 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: true, 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;
    }
    // policy - computed: true, optional: true, required: false
    _policy;
    get policy() {
        return this.getStringAttribute('policy');
    }
    set policy(value) {
        this._policy = value;
    }
    resetPolicy() {
        this._policy = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get policyInput() {
        return this._policy;
    }
    // recovery_window_in_days - computed: false, optional: true, required: false
    _recoveryWindowInDays;
    get recoveryWindowInDays() {
        return this.getNumberAttribute('recovery_window_in_days');
    }
    set recoveryWindowInDays(value) {
        this._recoveryWindowInDays = value;
    }
    resetRecoveryWindowInDays() {
        this._recoveryWindowInDays = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get recoveryWindowInDaysInput() {
        return this._recoveryWindowInDays;
    }
    // rotation_enabled - computed: true, optional: false, required: false
    get rotationEnabled() {
        return this.getBooleanAttribute('rotation_enabled');
    }
    // rotation_lambda_arn - computed: true, optional: true, required: false
    _rotationLambdaArn;
    get rotationLambdaArn() {
        return this.getStringAttribute('rotation_lambda_arn');
    }
    set rotationLambdaArn(value) {
        this._rotationLambdaArn = value;
    }
    resetRotationLambdaArn() {
        this._rotationLambdaArn = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get rotationLambdaArnInput() {
        return this._rotationLambdaArn;
    }
    // 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;
    }
    // replica - computed: false, optional: true, required: false
    _replica;
    get replica() {
        // Getting the computed value is not yet implemented
        return cdktf.Token.asAny(cdktf.Fn.tolist(this.interpolationForAttribute('replica')));
    }
    set replica(value) {
        this._replica = value;
    }
    resetReplica() {
        this._replica = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get replicaInput() {
        return this._replica;
    }
    // rotation_rules - computed: false, optional: true, required: false
    _rotationRules = new SecretsmanagerSecretRotationRulesOutputReference(this, "rotation_rules", true);
    get rotationRules() {
        return this._rotationRules;
    }
    putRotationRules(value) {
        this._rotationRules.internalValue = value;
    }
    resetRotationRules() {
        this._rotationRules.internalValue = undefined;
    }
    // Temporarily expose input value. Use with caution.
    get rotationRulesInput() {
        return this._rotationRules.internalValue;
    }
    // =========
    // SYNTHESIS
    // =========
    synthesizeAttributes() {
        return {
            description: cdktf.stringToTerraform(this._description),
            force_overwrite_replica_secret: cdktf.booleanToTerraform(this._forceOverwriteReplicaSecret),
            kms_key_id: cdktf.stringToTerraform(this._kmsKeyId),
            name: cdktf.stringToTerraform(this._name),
            name_prefix: cdktf.stringToTerraform(this._namePrefix),
            policy: cdktf.stringToTerraform(this._policy),
            recovery_window_in_days: cdktf.numberToTerraform(this._recoveryWindowInDays),
            rotation_lambda_arn: cdktf.stringToTerraform(this._rotationLambdaArn),
            tags: cdktf.hashMapper(cdktf.stringToTerraform)(this._tags),
            tags_all: cdktf.hashMapper(cdktf.stringToTerraform)(this._tagsAll),
            replica: cdktf.listMapper(secretsmanagerSecretReplicaToTerraform)(this._replica),
            rotation_rules: secretsmanagerSecretRotationRulesToTerraform(this._rotationRules.internalValue),
        };
    }
}
//# sourceMappingURL=secretsmanager-secret.js.map