Files
floci/docs
Priamo Germosen 984886f697 feat(kms): implement UpdateAlias (#2324)
* feat(kms): implement UpdateAlias

Repoints an existing alias at a different KMS key, following the
existing createAlias/deleteAlias/resolveKey patterns. Required by the
Terraform AWS provider, which treats a target_key_id change on
aws_kms_alias as an in-place update.

* fix(kms): reject invalid replacement keys in UpdateAlias

UpdateAlias accepted any existing key as a replacement target,
including keys pending deletion or with a different key usage/spec
than the alias's current target. Real AWS KMS rejects both: the
replacement key must be in a compatible state and match the current
target's key usage and key spec.

* fix(kms): compare key type instead of exact key spec in UpdateAlias

The exact KeySpec comparison rejected valid updates between same-type
keys with different specs (e.g. RSA_2048 to RSA_3072), which AWS KMS
accepts as long as both keys share the same key type and usage.

* test(kms): add Terraform compatibility test for UpdateAlias

Verifies the exact scenario from #2291: the Terraform AWS provider
treats target_key_id on aws_kms_alias as an in-place update, so
re-applying with a different target must call UpdateAlias and update
the alias without a destroy/recreate. Self-contained config, mirroring
the eni-destroy-tf pattern, since it needs a second apply with a
different var rather than the shared single-apply main.tf.

* fix(kms): compare key family instead of KeyType in UpdateAlias

Comparing the fine-grained KeyType enum rejected valid cross-family
asymmetric updates (e.g. RSA_2048 to ECC_NIST_P256) that AWS KMS
accepts. AWS only requires the current and new key to be "the same
type (both symmetric or both asymmetric or both HMAC)" - a coarser
three-way split - so compare on that instead.
2026-08-15 12:54:39 -04:00
..
2026-03-15 17:43:56 -05:00