Hi,
I have a resource that is a DB Snapshot, and I am trying to create a copy of that DB Snapshot but have it that copy be encrypted, but I am running into this error:
terraform validate
╷
│ Error: Value for unconfigurable attribute
│
│ with aws_db_snapshot_copy.postgres_unencrypted_db_encrypted_snapshot,
│ on initial_unencrypted_aws_rds_db.tf line 48, in resource “aws_db_snapshot_copy” “postgres_unencrypted_db_encrypted_snapshot”:
│ 48: encrypted = true
│
│ Can’t configure a value for “encrypted”: its value will be decided automatically based on the result of applying this configuration.
╵
My Snapshot, which was created fine by Terraform:
resource "aws_db_snapshot" "postgres_unencrypted_db_snapshot" {
db_instance_identifier = aws_db_instance.postgres_unencrypted_db.id
db_snapshot_identifier = "tf-resource-snapshot"
}
Snapshot copy that I want encrypted, but is giving me the error upon terraform validate
:
# Snapshot Copy that is Encrypted
resource "aws_db_snapshot_copy" "postgres_unencrypted_db_encrypted_snapshot" {
source_db_snapshot_identifier = aws_db_snapshot.postgres_unencrypted_db_snapshot.db_snapshot_arn
target_db_snapshot_identifier = "tf-resource-encrypted-snapshot" # (Required) The Identifier for the snapshot.
encrypted = true
}
Am I doing something wrong?