Multi Region KMS Key Replicas don't allow Replication Region to be configured #23964
Labels
enhancement
Requests to existing resources that expand the functionality or scope.
service/kms
Issues and PRs that pertain to the kms service.
Community Note
Description
The Multi Region KMS key resource (https://github.com/hashicorp/terraform-provider-aws/blob/main/internal/service/kms/replica_key.go#L33) doesn't allow a Replica Region to be passed into it, instead using the Region set in the provide https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kms_replica_key and https://github.com/hashicorp/terraform-provider-aws/blob/main/internal/service/kms/replica_key.go#L108.
This means that for each Replica you'd like to create, you need an extra provider that the replica resource can reference, where the difference is only the Region set in the provider. This can make the Terraform messy and overly complex.
I'd like to propose allowing a
replica_region
to be exposed in the module allowing this to be set without having to create additional provider blocks.I'd propose to read the value passed in and then fall back to the value from the client/provider block as is current behaviour making this new argument an optional one.
If this seems like an appropriate approach, I'm happy to do the work needed.
New or Affected Resource(s)
Potential Terraform Configuration
Example from https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/kms_replica_key
References
The text was updated successfully, but these errors were encountered: