Skip to content

Commit

Permalink
feat: Add support for tracing_config (#44)
Browse files Browse the repository at this point in the history
Co-authored-by: Anton Babenko <[email protected]>
  • Loading branch information
tonyhhyip and antonbabenko authored Apr 10, 2023
1 parent 58579fb commit 76a3b48
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ No modules.
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to add to all resources | `map(string)` | `{}` | no |
| <a name="input_topic_policy"></a> [topic\_policy](#input\_topic\_policy) | An externally created fully-formed AWS policy as JSON | `string` | `null` | no |
| <a name="input_topic_policy_statements"></a> [topic\_policy\_statements](#input\_topic\_policy\_statements) | A map of IAM policy [statements](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document#statement) for custom permission usage | `any` | `{}` | no |
| <a name="input_tracing_config"></a> [tracing\_config](#input\_tracing\_config) | Tracing mode of an Amazon SNS topic. Valid values: PassThrough, Active. | `string` | `null` | no |
| <a name="input_use_name_prefix"></a> [use\_name\_prefix](#input\_use\_name\_prefix) | Determines whether `name` is used as a prefix | `bool` | `false` | no |

## Outputs
Expand Down
1 change: 1 addition & 0 deletions examples/complete/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ module "complete_sns" {
use_name_prefix = true
display_name = "complete"
kms_master_key_id = module.kms.key_id
tracing_config = "Active"

# SQS queue must be FIFO as well
fifo_topic = true
Expand Down
1 change: 1 addition & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ resource "aws_sns_topic" "this" {
display_name = var.display_name
fifo_topic = var.fifo_topic
signature_version = var.fifo_topic ? null : var.signature_version
tracing_config = var.tracing_config

firehose_failure_feedback_role_arn = try(var.firehose_feedback.failure_role_arn, null)
firehose_success_feedback_role_arn = try(var.firehose_feedback.success_role_arn, null)
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,12 @@ variable "signature_version" {
default = null
}

variable "tracing_config" {
description = "Tracing mode of an Amazon SNS topic. Valid values: PassThrough, Active."
type = string
default = null
}

################################################################################
# Topic Policy
################################################################################
Expand Down
1 change: 1 addition & 0 deletions wrappers/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ module "wrapper" {
topic_policy = try(each.value.topic_policy, var.defaults.topic_policy, null)
sqs_feedback = try(each.value.sqs_feedback, var.defaults.sqs_feedback, {})
signature_version = try(each.value.signature_version, var.defaults.signature_version, null)
tracing_config = try(each.value.tracing_config, var.defaults.tracing_config, null)
create_topic_policy = try(each.value.create_topic_policy, var.defaults.create_topic_policy, true)
source_topic_policy_documents = try(each.value.source_topic_policy_documents, var.defaults.source_topic_policy_documents, [])
override_topic_policy_documents = try(each.value.override_topic_policy_documents, var.defaults.override_topic_policy_documents, [])
Expand Down

0 comments on commit 76a3b48

Please sign in to comment.