Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow list of regions for aws_kms_replica_key #24991

Closed
frugecn opened this issue May 24, 2022 · 2 comments
Closed

Allow list of regions for aws_kms_replica_key #24991

frugecn opened this issue May 24, 2022 · 2 comments
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/kms Issues and PRs that pertain to the kms service.

Comments

@frugecn
Copy link

frugecn commented May 24, 2022

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

When creating a DynamoDB Global Table, a list is provided to define which regions the global table should reside in. If the Table has a Customer Managed Key defined as well, there doesn't appear to be a way to pass the same list to the aws_kms_replica key for creating those resources as well to keep the two resources consistent.

New or Affected Resource(s)

  • aws_kms_replica_key

Potential Terraform Configuration

variable "regions" {
    type = list(string)
    
}

resource "aws_dynamodb_table" "example" {
  name             = "example"
  hash_key         = "TestTableHashKey"
  billing_mode     = "PAY_PER_REQUEST"
  stream_enabled   = true
  stream_view_type = "NEW_AND_OLD_IMAGES"

  attribute {
    name = "TestTableHashKey"
    type = "S"
  }

  dynamic "replica" {
    for_each = var.regions
    content {
      region_name = replica.value
      kms_key_arn = aws_kms_replica_key.replica[each.value].arn
    }
  }
}

resource "aws_kms_key" "primary" {
  provider = aws.primary

  description             = "Multi-Region primary key"
  deletion_window_in_days = 30
  multi_region            = true
}

resource "aws_kms_replica_key" "replica" {
  for_each = toset(var.regions)
  description             = "Multi-Region replica key"
  deletion_window_in_days = 30
  primary_key_arn         = aws_kms_key.primary.arn
  replica_regions =  each.value
}

References

  • #0000
@frugecn frugecn added the enhancement Requests to existing resources that expand the functionality or scope. label May 24, 2022
@github-actions github-actions bot added needs-triage Waiting for first response or review from a maintainer. service/dynamodb Issues and PRs that pertain to the dynamodb service. service/kms Issues and PRs that pertain to the kms service. labels May 24, 2022
@ewbankkit ewbankkit removed service/dynamodb Issues and PRs that pertain to the dynamodb service. needs-triage Waiting for first response or review from a maintainer. labels May 24, 2022
@ewbankkit
Copy link
Contributor

@frugecn Thanks for raising this issue.
It has already been noticed in #22243. I'm going to close this one as a duplicate so that we can concentrate discussion in the linked issue.
Please add any additional comments there.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/kms Issues and PRs that pertain to the kms service.
Projects
None yet
Development

No branches or pull requests

2 participants