// generated from terraform resource schema import { Construct } from 'constructs'; import * as cdktf from 'cdktf'; /** * AWS Secrets Manager */ export interface SecretsmanagerSecretConfig extends cdktf.TerraformMetaArguments { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/secretsmanager_secret.html#description SecretsmanagerSecret#description} */ readonly description?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/secretsmanager_secret.html#force_overwrite_replica_secret SecretsmanagerSecret#force_overwrite_replica_secret} */ readonly forceOverwriteReplicaSecret?: boolean | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/secretsmanager_secret.html#kms_key_id SecretsmanagerSecret#kms_key_id} */ readonly kmsKeyId?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/secretsmanager_secret.html#name SecretsmanagerSecret#name} */ readonly name?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/secretsmanager_secret.html#name_prefix SecretsmanagerSecret#name_prefix} */ readonly namePrefix?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/secretsmanager_secret.html#policy SecretsmanagerSecret#policy} */ readonly policy?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/secretsmanager_secret.html#recovery_window_in_days SecretsmanagerSecret#recovery_window_in_days} */ readonly recoveryWindowInDays?: number; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/secretsmanager_secret.html#rotation_lambda_arn SecretsmanagerSecret#rotation_lambda_arn} */ readonly rotationLambdaArn?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/secretsmanager_secret.html#tags SecretsmanagerSecret#tags} */ readonly tags?: { [key: string]: string } | cdktf.IResolvable; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/secretsmanager_secret.html#tags_all SecretsmanagerSecret#tags_all} */ readonly tagsAll?: { [key: string]: string } | cdktf.IResolvable; /** * replica block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/secretsmanager_secret.html#replica SecretsmanagerSecret#replica} */ readonly replica?: SecretsmanagerSecretReplica[]; /** * rotation_rules block * * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/secretsmanager_secret.html#rotation_rules SecretsmanagerSecret#rotation_rules} */ readonly rotationRules?: SecretsmanagerSecretRotationRules; } export interface SecretsmanagerSecretReplica { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/secretsmanager_secret.html#kms_key_id SecretsmanagerSecret#kms_key_id} */ readonly kmsKeyId?: string; /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/secretsmanager_secret.html#region SecretsmanagerSecret#region} */ readonly region: string; } export function secretsmanagerSecretReplicaToTerraform(struct?: SecretsmanagerSecretReplica): any { if (!cdktf.canInspect(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 interface SecretsmanagerSecretRotationRules { /** * Docs at Terraform Registry: {@link https://www.terraform.io/docs/providers/aws/r/secretsmanager_secret.html#automatically_after_days SecretsmanagerSecret#automatically_after_days} */ readonly automaticallyAfterDays: number; } export function secretsmanagerSecretRotationRulesToTerraform(struct?: SecretsmanagerSecretRotationRulesOutputReference | SecretsmanagerSecretRotationRules): any { if (!cdktf.canInspect(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 { private 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 */ public constructor(terraformResource: cdktf.ITerraformResource, terraformAttribute: string, isSingleItem: boolean) { super(terraformResource, terraformAttribute, isSingleItem); } public get internalValue(): SecretsmanagerSecretRotationRules | undefined { let hasAnyValues = this.isEmptyObject; const internalValueResult: any = {}; if (this._automaticallyAfterDays !== undefined) { hasAnyValues = true; internalValueResult.automaticallyAfterDays = this._automaticallyAfterDays; } return hasAnyValues ? internalValueResult : undefined; } public set internalValue(value: SecretsmanagerSecretRotationRules | undefined) { 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 private _automaticallyAfterDays?: number; public get automaticallyAfterDays() { return this.getNumberAttribute('automatically_after_days'); } public set automaticallyAfterDays(value: number) { this._automaticallyAfterDays = value; } // Temporarily expose input value. Use with caution. public get automaticallyAfterDaysInput() { return this._automaticallyAfterDays; } } /** * Represents a {@link https://www.terraform.io/docs/providers/aws/r/secretsmanager_secret.html aws_secretsmanager_secret} */ export class SecretsmanagerSecret extends cdktf.TerraformResource { // ================= // STATIC PROPERTIES // ================= public static readonly tfResourceType: string = "aws_secretsmanager_secret"; // =========== // INITIALIZER // =========== /** * Create a new {@link https://www.terraform.io/docs/providers/aws/r/secretsmanager_secret.html 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 = {} */ public constructor(scope: Construct, id: string, config: SecretsmanagerSecretConfig = {}) { 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 public get arn() { return this.getStringAttribute('arn'); } // description - computed: false, optional: true, required: false private _description?: string; public get description() { return this.getStringAttribute('description'); } public set description(value: string) { this._description = value; } public resetDescription() { this._description = undefined; } // Temporarily expose input value. Use with caution. public get descriptionInput() { return this._description; } // force_overwrite_replica_secret - computed: false, optional: true, required: false private _forceOverwriteReplicaSecret?: boolean | cdktf.IResolvable; public get forceOverwriteReplicaSecret() { return this.getBooleanAttribute('force_overwrite_replica_secret') as any; } public set forceOverwriteReplicaSecret(value: boolean | cdktf.IResolvable) { this._forceOverwriteReplicaSecret = value; } public resetForceOverwriteReplicaSecret() { this._forceOverwriteReplicaSecret = undefined; } // Temporarily expose input value. Use with caution. public get forceOverwriteReplicaSecretInput() { return this._forceOverwriteReplicaSecret; } // id - computed: true, optional: true, required: false public get id() { return this.getStringAttribute('id'); } // kms_key_id - computed: false, optional: true, required: false private _kmsKeyId?: string; public get kmsKeyId() { return this.getStringAttribute('kms_key_id'); } public set kmsKeyId(value: string) { this._kmsKeyId = value; } public resetKmsKeyId() { this._kmsKeyId = undefined; } // Temporarily expose input value. Use with caution. public get kmsKeyIdInput() { return this._kmsKeyId; } // name - computed: true, optional: true, required: false private _name?: string; public get name() { return this.getStringAttribute('name'); } public set name(value: string) { this._name = value; } public resetName() { this._name = undefined; } // Temporarily expose input value. Use with caution. public get nameInput() { return this._name; } // name_prefix - computed: true, optional: true, required: false private _namePrefix?: string; public get namePrefix() { return this.getStringAttribute('name_prefix'); } public set namePrefix(value: string) { this._namePrefix = value; } public resetNamePrefix() { this._namePrefix = undefined; } // Temporarily expose input value. Use with caution. public get namePrefixInput() { return this._namePrefix; } // policy - computed: true, optional: true, required: false private _policy?: string; public get policy() { return this.getStringAttribute('policy'); } public set policy(value: string) { this._policy = value; } public resetPolicy() { this._policy = undefined; } // Temporarily expose input value. Use with caution. public get policyInput() { return this._policy; } // recovery_window_in_days - computed: false, optional: true, required: false private _recoveryWindowInDays?: number; public get recoveryWindowInDays() { return this.getNumberAttribute('recovery_window_in_days'); } public set recoveryWindowInDays(value: number) { this._recoveryWindowInDays = value; } public resetRecoveryWindowInDays() { this._recoveryWindowInDays = undefined; } // Temporarily expose input value. Use with caution. public get recoveryWindowInDaysInput() { return this._recoveryWindowInDays; } // rotation_enabled - computed: true, optional: false, required: false public get rotationEnabled() { return this.getBooleanAttribute('rotation_enabled') as any; } // rotation_lambda_arn - computed: true, optional: true, required: false private _rotationLambdaArn?: string; public get rotationLambdaArn() { return this.getStringAttribute('rotation_lambda_arn'); } public set rotationLambdaArn(value: string) { this._rotationLambdaArn = value; } public resetRotationLambdaArn() { this._rotationLambdaArn = undefined; } // Temporarily expose input value. Use with caution. public get rotationLambdaArnInput() { return this._rotationLambdaArn; } // tags - computed: false, optional: true, required: false private _tags?: { [key: string]: string } | cdktf.IResolvable; public get tags() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('tags') as any; } public set tags(value: { [key: string]: string } | cdktf.IResolvable) { this._tags = value; } public resetTags() { this._tags = undefined; } // Temporarily expose input value. Use with caution. public get tagsInput() { return this._tags; } // tags_all - computed: true, optional: true, required: false private _tagsAll?: { [key: string]: string } | cdktf.IResolvable; public get tagsAll() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('tags_all') as any; } public set tagsAll(value: { [key: string]: string } | cdktf.IResolvable) { this._tagsAll = value; } public resetTagsAll() { this._tagsAll = undefined; } // Temporarily expose input value. Use with caution. public get tagsAllInput() { return this._tagsAll; } // replica - computed: false, optional: true, required: false private _replica?: SecretsmanagerSecretReplica[]; public get replica() { // Getting the computed value is not yet implemented return this.interpolationForAttribute('replica') as any; } public set replica(value: SecretsmanagerSecretReplica[]) { this._replica = value; } public resetReplica() { this._replica = undefined; } // Temporarily expose input value. Use with caution. public get replicaInput() { return this._replica; } // rotation_rules - computed: false, optional: true, required: false private _rotationRules = new SecretsmanagerSecretRotationRulesOutputReference(this as any, "rotation_rules", true); public get rotationRules() { return this._rotationRules; } public putRotationRules(value: SecretsmanagerSecretRotationRules) { this._rotationRules.internalValue = value; } public resetRotationRules() { this._rotationRules.internalValue = undefined; } // Temporarily expose input value. Use with caution. public get rotationRulesInput() { return this._rotationRules.internalValue; } // ========= // SYNTHESIS // ========= protected synthesizeAttributes(): { [name: string]: any } { 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.anyToTerraform)(this._tags), tags_all: cdktf.hashMapper(cdktf.anyToTerraform)(this._tagsAll), replica: cdktf.listMapper(secretsmanagerSecretReplicaToTerraform)(this._replica), rotation_rules: secretsmanagerSecretRotationRulesToTerraform(this._rotationRules.internalValue), }; } }