Skip to content

Not able to set 0% for aws_sns_topic using sqs_success_feedback_sample_rate while creating SNS TopicΒ #11773

Open
@prabaharang

Description

While creating a new SNS Topic resource, the sqs_success_feedback_sample_rate is not set as 0%. The value of 0 is set as NaN.

If we set any other value other than zero, then the provided value is set correctly. This behavior is happening when creating the Topic. If we update sqs_success_feedback_sample_rate (from 5% to 0%) then 0 is set correctly.

Terraform Version

  • Terraform v0.12.16
    • provider.aws v2.41.0

Affected Resource(s)

  • aws_sns_topic

Terraform Configuration Files

resource "aws_sns_topic" "topic" {
  name                             = topic_name
  sqs_success_feedback_sample_rate = "0"
  sqs_success_feedback_role_arn    = sns_delivery_success_feedback_role.arn
  sqs_failure_feedback_role_arn    = sns_delivery_failure_feedback_role.arn
}

Expected Behavior

sqs_success_feedback_sample_rate should be set correctly.
Success sample rate should be set as 0 or whatever the value (between 0 and 100) being passed in the configuration.

Actual Behavior

It appears 0 success sample rate is not able to set.

image
In terraform plan it shows the correct value but after terraform apply it sets as NaN.

Steps to Reproduce

  1. Create an SNS Topic with SNS Delivery logging. Set sqs_success_feedback_sample_rate as 0
  2. terraform plan/apply
  3. View the created SNS Topic in the console and in the Delivery Status Logging section, the Success sample rate is showing as NaN.

References

Metadata

Assignees

No one assigned

    Labels

    bugAddresses a defect in current functionality.service/snsIssues and PRs that pertain to the sns service.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions