Skip to content

Commit

Permalink
Merge pull request #6 from geekcell/fix-kms
Browse files Browse the repository at this point in the history
fix: kms default and function
  • Loading branch information
Ic3w0lf committed Sep 22, 2023
2 parents 3d06889 + d4a99c8 commit b8eed9b
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ for most use cases.
| <a name="input_email_addresses"></a> [email\_addresses](#input\_email\_addresses) | List of email address for this subscription. | `list(string)` | n/a | yes |
| <a name="input_enable_sns_sse_encryption"></a> [enable\_sns\_sse\_encryption](#input\_enable\_sns\_sse\_encryption) | Enable Server-Side Encryption of the SNS Topic. | `bool` | `true` | no |
| <a name="input_name"></a> [name](#input\_name) | The name of the topic. | `string` | n/a | yes |
| <a name="input_sns_kms_master_key_id"></a> [sns\_kms\_master\_key\_id](#input\_sns\_kms\_master\_key\_id) | KMS Key ID for Server-Side Encryption of the SNS Topic. If no key is provided, a new one will be created. | `string` | `null` | no |
| <a name="input_sns_kms_master_key_id"></a> [sns\_kms\_master\_key\_id](#input\_sns\_kms\_master\_key\_id) | KMS Key ID for Server-Side Encryption of the SNS Topic. | `string` | `"alias/aws/sns"` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | Tags to add to the AWS Customer Managed Key. | `map(any)` | `{}` | no |

## Outputs
Expand Down
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/
resource "aws_sns_topic" "main" {
name = var.name
kms_master_key_id = var.enable_sns_sse_encryption ? coalesce(var.sns_kms_master_key_id, module.kms[0].key_id) : null
kms_master_key_id = var.enable_sns_sse_encryption ? try(var.sns_kms_master_key_id, module.kms[0].key_id) : null

tags = var.tags
}
Expand Down
4 changes: 2 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ variable "enable_sns_sse_encryption" {
}

variable "sns_kms_master_key_id" {
default = null
description = "KMS Key ID for Server-Side Encryption of the SNS Topic. If no key is provided, a new one will be created."
default = "alias/aws/sns"
description = "KMS Key ID for Server-Side Encryption of the SNS Topic."
type = string
}

0 comments on commit b8eed9b

Please sign in to comment.