-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Add support for Amazon SNS FIFO Topics #15828
Conversation
Thank you for your contribution! 🚀 Please note that typically Go dependency changes are handled in this repository by Renovate Bot or the maintainers. This is to prevent pull request merge conflicts and further delay reviews of contributions. Remove any changes to the Additional details:
|
Looks like the acceptance tests pass even without the https://github.com/aws/aws-sdk-go/blob/v1.35.9/service/sns/api.go#L4004 So it may be possible this doesn't require an upgrade to |
5bd56b6
to
cc72b21
Compare
In addition to the FifoTopic property, there's also the ContentBasedDuplication one. |
Any updates here? |
633 active Pull Requests. I hope they see this one as a priority. 🤞 |
Please add, FIFO is going to be very useful (SQS FIFO queues subscribed to SNS FIFO topics)! |
Hey, |
Help us Mitchell Hashimoto, you're our only hope. |
We need it too. |
I believe most of the focus is on https://github.com/hashicorp/terraform-provider-aws/blob/master/ROADMAP.md unfortunately |
Any chance to merge it soon? |
aws/resource_aws_sns_topic_test.go
Outdated
Steps: []resource.TestStep{ | ||
{ | ||
Config: testAccAWSSNSTopicExpectContentBasedDeduplicationError(rName), | ||
ExpectError: regexp.MustCompile(`Content based deduplication can only be set with FIFO topics`), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I looked over the docs and this test is correct, you can only use this attribute for FIFO topics.
See https://docs.aws.amazon.com/sns/latest/api/API_CreateTopic.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left a comment regarding trying to change a topic to fifo after creation, which isn't possible. Other than that things look good.
aws/validators_test.go
Outdated
"A.fifo", | ||
"9.fifo", | ||
"-.fifo", | ||
fmt.Sprintf("%s.fifo", strings.Repeat("W", 250)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed, according to the API docs, all FIFO topics must end with the suffix of .fifo
in the name.
https://docs.aws.amazon.com/sns/latest/api/API_CreateTopic.html
aws/resource_aws_sns_topic.go
Outdated
@@ -415,6 +464,16 @@ func resourceAwsSnsTopicRead(d *schema.ResourceData, meta interface{}) error { | |||
d.Set("sqs_failure_feedback_role_arn", aws.StringValue(attributeOutput.Attributes["SQSFailureFeedbackRoleArn"])) | |||
d.Set("sqs_success_feedback_role_arn", aws.StringValue(attributeOutput.Attributes["SQSSuccessFeedbackRoleArn"])) | |||
|
|||
// set the boolean values | |||
d.Set("fifo_topic", false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docs say that once you set a topic type it can't be changed. Is there a way to ensure the topic type's not being changed during an update, during validation stage?
fifo_topic isn't an attribute available for SetTopicAttributes
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The better way to do that is to change the schema in the resource to have ForceNew: true
on it.
So in here:
"fifo_topic": {
Type: schema.TypeBool,
Optional: true,
Default: false,
},
Do this:
"fifo_topic": {
Type: schema.TypeBool,
Optional: true,
Default: false,
ForceNew: true
},
That way if that field is changed, terraform knows it needs to create a brand new topic to replace it, and you'll get a corresponding diff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, added the schema change in 5019aad
Looks like the goreleaser build failed (possible due to a timeout, see #16955). I don't have the ability to re-run the job on my end. |
Verified acceptance tests: $ make testacc TEST=./aws TESTARGS='-run=TestAccAWSSNSTopic_' ACCTEST_PARALLELISM=4
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws -v -count 1 -parallel 4 -run=TestAccAWSSNSTopic_ -timeout 120m
=== RUN TestAccAWSSNSTopic_basic
=== PAUSE TestAccAWSSNSTopic_basic
=== RUN TestAccAWSSNSTopic_name
=== PAUSE TestAccAWSSNSTopic_name
=== RUN TestAccAWSSNSTopic_namePrefix
=== PAUSE TestAccAWSSNSTopic_namePrefix
=== RUN TestAccAWSSNSTopic_policy
=== PAUSE TestAccAWSSNSTopic_policy
=== RUN TestAccAWSSNSTopic_withIAMRole
=== PAUSE TestAccAWSSNSTopic_withIAMRole
=== RUN TestAccAWSSNSTopic_withFakeIAMRole
=== PAUSE TestAccAWSSNSTopic_withFakeIAMRole
=== RUN TestAccAWSSNSTopic_withDeliveryPolicy
=== PAUSE TestAccAWSSNSTopic_withDeliveryPolicy
=== RUN TestAccAWSSNSTopic_deliveryStatus
=== PAUSE TestAccAWSSNSTopic_deliveryStatus
=== RUN TestAccAWSSNSTopic_FIFO
=== PAUSE TestAccAWSSNSTopic_FIFO
=== RUN TestAccAWSSNSTopic_FIFOWithContentBasedDeduplication
=== PAUSE TestAccAWSSNSTopic_FIFOWithContentBasedDeduplication
=== RUN TestAccAWSSNSTopic_FIFOExpectContentBasedDeduplicationError
=== PAUSE TestAccAWSSNSTopic_FIFOExpectContentBasedDeduplicationError
=== RUN TestAccAWSSNSTopic_encryption
=== PAUSE TestAccAWSSNSTopic_encryption
=== RUN TestAccAWSSNSTopic_tags
=== PAUSE TestAccAWSSNSTopic_tags
=== CONT TestAccAWSSNSTopic_basic
=== CONT TestAccAWSSNSTopic_deliveryStatus
=== CONT TestAccAWSSNSTopic_tags
=== CONT TestAccAWSSNSTopic_encryption
--- PASS: TestAccAWSSNSTopic_basic (27.79s)
=== CONT TestAccAWSSNSTopic_FIFOExpectContentBasedDeduplicationError
--- PASS: TestAccAWSSNSTopic_FIFOExpectContentBasedDeduplicationError (5.63s)
=== CONT TestAccAWSSNSTopic_FIFOWithContentBasedDeduplication
--- PASS: TestAccAWSSNSTopic_deliveryStatus (41.09s)
=== CONT TestAccAWSSNSTopic_FIFO
--- PASS: TestAccAWSSNSTopic_encryption (50.07s)
=== CONT TestAccAWSSNSTopic_withIAMRole
--- PASS: TestAccAWSSNSTopic_FIFO (27.11s)
=== CONT TestAccAWSSNSTopic_withDeliveryPolicy
--- PASS: TestAccAWSSNSTopic_tags (69.72s)
=== CONT TestAccAWSSNSTopic_withFakeIAMRole
--- PASS: TestAccAWSSNSTopic_FIFOWithContentBasedDeduplication (48.66s)
=== CONT TestAccAWSSNSTopic_namePrefix
--- PASS: TestAccAWSSNSTopic_withIAMRole (34.98s)
=== CONT TestAccAWSSNSTopic_policy
--- PASS: TestAccAWSSNSTopic_withDeliveryPolicy (24.48s)
=== CONT TestAccAWSSNSTopic_name
--- PASS: TestAccAWSSNSTopic_namePrefix (23.34s)
--- PASS: TestAccAWSSNSTopic_policy (25.03s)
--- PASS: TestAccAWSSNSTopic_name (22.63s)
--- PASS: TestAccAWSSNSTopic_withFakeIAMRole (130.59s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 200.355s |
* `sqs_success_feedback_sample_rate` - (Optional) Percentage of success to sample | ||
* `sqs_failure_feedback_role_arn` - (Optional) IAM role for failure feedback | ||
* `tags` - (Optional) Key-value map of resource tags | ||
- `name` - (Optional) The friendly name for the SNS topic. By default generated by Terraform. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please revert to *
for list indicator so as to minimize the diffs? Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aws/resource_aws_sns_topic.go
Outdated
if fifoTopic { | ||
if errors := validateSNSFifoTopicName(name); len(errors) > 0 { | ||
return fmt.Errorf("Error validating the SNS FIFO topic name: %v", errors) | ||
} | ||
} else { | ||
if errors := validateSNSNonFifoTopicName(name); len(errors) > 0 { | ||
return fmt.Errorf("Error validating SNS topic name: %v", errors) | ||
} | ||
} | ||
|
||
if !fifoTopic && cbd { | ||
return fmt.Errorf("Content based deduplication can only be set with FIFO topics") | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can replace the validations during create (i.e. terraform apply
) with validations during plan (terraform plan
) by adding a CustomizeDiff
function to the resource:
func resourceAwsSnsTopic() *schema.Resource {
return &schema.Resource{
Create: resourceAwsSnsTopicCreate,
Read: resourceAwsSnsTopicRead,
Update: resourceAwsSnsTopicUpdate,
Delete: resourceAwsSnsTopicDelete,
Importer: &schema.ResourceImporter{
State: schema.ImportStatePassthrough,
},
CustomizeDiff: resourceAwsSnsTopicCustomizeDiff,
Schema: map[string]*schema.Schema{
...
}
func resourceAwsSnsTopicCustomizeDiff(_ context.Context, diff *schema.ResourceDiff, meta interface{}) error {
fifoTopic := diff.Get("fifo_topic").(bool)
contentBasedDeduplication := diff.Get("content_based_deduplication").(bool)
if diff.Id() == "" {
// Create.
name := naming.Generate(diff.Get("name").(string), diff.Get("name_prefix").(string))
if fifoTopic {
if errors := validateSNSFifoTopicName(name); len(errors) > 0 {
return fmt.Errorf("Error validating the SNS FIFO topic name: %v", errors)
}
} else {
if errors := validateSNSNonFifoTopicName(name); len(errors) > 0 {
return fmt.Errorf("Error validating SNS topic name: %v", errors)
}
}
}
if !fifoTopic && contentBasedDeduplication {
return fmt.Errorf("Content based deduplication can only be set with FIFO topics")
}
return nil
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See also this comment around using the naming
internal package and adding a GenerateWithSuffix
function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tomekr You can add. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ewbankkit My apologies, I'm not quite following where I should add naming.GenerateWithSuffix
. https://github.com/hashicorp/terraform-provider-aws/blob/master/docs/contributing/contribution-checklists.md#resource-name-generation-code-implementation doesn't appear to mention adding a new function to naming
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ewbankkit just following back up on this thread
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ewbankkit trying one more time here
|
Co-authored-by: Janelle Tavares <janelletavares@users.noreply.github.com>
93e3a7f
to
141b250
Compare
Acceptance test output: % make testacc TEST=./aws TESTARGS='-run=TestAccAWSSNSTopic_' ACCTEST_PARALLELISM=4 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 4 -run=TestAccAWSSNSTopic_ -timeout 180m === RUN TestAccAWSSNSTopic_basic === PAUSE TestAccAWSSNSTopic_basic === RUN TestAccAWSSNSTopic_name === PAUSE TestAccAWSSNSTopic_name === RUN TestAccAWSSNSTopic_namePrefix === PAUSE TestAccAWSSNSTopic_namePrefix === RUN TestAccAWSSNSTopic_policy === PAUSE TestAccAWSSNSTopic_policy === RUN TestAccAWSSNSTopic_withIAMRole === PAUSE TestAccAWSSNSTopic_withIAMRole === RUN TestAccAWSSNSTopic_withFakeIAMRole === PAUSE TestAccAWSSNSTopic_withFakeIAMRole === RUN TestAccAWSSNSTopic_withDeliveryPolicy === PAUSE TestAccAWSSNSTopic_withDeliveryPolicy === RUN TestAccAWSSNSTopic_deliveryStatus === PAUSE TestAccAWSSNSTopic_deliveryStatus === RUN TestAccAWSSNSTopic_FIFO === PAUSE TestAccAWSSNSTopic_FIFO === RUN TestAccAWSSNSTopic_FIFOWithContentBasedDeduplication === PAUSE TestAccAWSSNSTopic_FIFOWithContentBasedDeduplication === RUN TestAccAWSSNSTopic_FIFOExpectContentBasedDeduplicationError === PAUSE TestAccAWSSNSTopic_FIFOExpectContentBasedDeduplicationError === RUN TestAccAWSSNSTopic_encryption === PAUSE TestAccAWSSNSTopic_encryption === RUN TestAccAWSSNSTopic_tags === PAUSE TestAccAWSSNSTopic_tags === CONT TestAccAWSSNSTopic_basic === CONT TestAccAWSSNSTopic_deliveryStatus === CONT TestAccAWSSNSTopic_withIAMRole === CONT TestAccAWSSNSTopic_encryption === CONT TestAccAWSSNSTopic_namePrefix --- PASS: TestAccAWSSNSTopic_basic (20.75s) --- PASS: TestAccAWSSNSTopic_withIAMRole (30.05s) === CONT TestAccAWSSNSTopic_policy --- PASS: TestAccAWSSNSTopic_encryption (34.64s) === CONT TestAccAWSSNSTopic_tags --- PASS: TestAccAWSSNSTopic_namePrefix (16.04s) === CONT TestAccAWSSNSTopic_withDeliveryPolicy --- PASS: TestAccAWSSNSTopic_deliveryStatus (37.54s) === CONT TestAccAWSSNSTopic_name --- PASS: TestAccAWSSNSTopic_policy (17.02s) === CONT TestAccAWSSNSTopic_FIFOWithContentBasedDeduplication --- PASS: TestAccAWSSNSTopic_name (15.29s) === CONT TestAccAWSSNSTopic_FIFOExpectContentBasedDeduplicationError --- PASS: TestAccAWSSNSTopic_withDeliveryPolicy (16.18s) === CONT TestAccAWSSNSTopic_FIFO --- PASS: TestAccAWSSNSTopic_FIFOExpectContentBasedDeduplicationError (2.00s) === CONT TestAccAWSSNSTopic_withFakeIAMRole --- PASS: TestAccAWSSNSTopic_FIFO (18.22s) --- PASS: TestAccAWSSNSTopic_tags (42.36s) --- PASS: TestAccAWSSNSTopic_FIFOWithContentBasedDeduplication (30.10s) --- PASS: TestAccAWSSNSTopic_withFakeIAMRole (128.51s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 186.509s
Acceptance test output: % make testacc TEST=./aws TESTARGS='-run=TestAccAWSSNSTopic_' ACCTEST_PARALLELISM=4 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 4 -run=TestAccAWSSNSTopic_ -timeout 180m === RUN TestAccAWSSNSTopic_basic === PAUSE TestAccAWSSNSTopic_basic === RUN TestAccAWSSNSTopic_Name === PAUSE TestAccAWSSNSTopic_Name === RUN TestAccAWSSNSTopic_NamePrefix === PAUSE TestAccAWSSNSTopic_NamePrefix === RUN TestAccAWSSNSTopic_policy === PAUSE TestAccAWSSNSTopic_policy === RUN TestAccAWSSNSTopic_withIAMRole === PAUSE TestAccAWSSNSTopic_withIAMRole === RUN TestAccAWSSNSTopic_withFakeIAMRole === PAUSE TestAccAWSSNSTopic_withFakeIAMRole === RUN TestAccAWSSNSTopic_withDeliveryPolicy === PAUSE TestAccAWSSNSTopic_withDeliveryPolicy === RUN TestAccAWSSNSTopic_deliveryStatus === PAUSE TestAccAWSSNSTopic_deliveryStatus === RUN TestAccAWSSNSTopic_Name_Generated_FIFOTopic === PAUSE TestAccAWSSNSTopic_Name_Generated_FIFOTopic === RUN TestAccAWSSNSTopic_Name_FIFOTopic === PAUSE TestAccAWSSNSTopic_Name_FIFOTopic === RUN TestAccAWSSNSTopic_NamePrefix_FIFOTopic === PAUSE TestAccAWSSNSTopic_NamePrefix_FIFOTopic === RUN TestAccAWSSNSTopic_FIFOWithContentBasedDeduplication === PAUSE TestAccAWSSNSTopic_FIFOWithContentBasedDeduplication === RUN TestAccAWSSNSTopic_FIFOExpectContentBasedDeduplicationError === PAUSE TestAccAWSSNSTopic_FIFOExpectContentBasedDeduplicationError === RUN TestAccAWSSNSTopic_encryption === PAUSE TestAccAWSSNSTopic_encryption === RUN TestAccAWSSNSTopic_tags === PAUSE TestAccAWSSNSTopic_tags === CONT TestAccAWSSNSTopic_basic === CONT TestAccAWSSNSTopic_Name_Generated_FIFOTopic === CONT TestAccAWSSNSTopic_FIFOWithContentBasedDeduplication === CONT TestAccAWSSNSTopic_withIAMRole --- PASS: TestAccAWSSNSTopic_basic (15.80s) === CONT TestAccAWSSNSTopic_FIFOExpectContentBasedDeduplicationError --- PASS: TestAccAWSSNSTopic_Name_Generated_FIFOTopic (15.98s) === CONT TestAccAWSSNSTopic_tags --- PASS: TestAccAWSSNSTopic_FIFOExpectContentBasedDeduplicationError (1.66s) === CONT TestAccAWSSNSTopic_encryption --- PASS: TestAccAWSSNSTopic_withIAMRole (27.02s) === CONT TestAccAWSSNSTopic_withDeliveryPolicy --- PASS: TestAccAWSSNSTopic_FIFOWithContentBasedDeduplication (27.67s) === CONT TestAccAWSSNSTopic_deliveryStatus --- PASS: TestAccAWSSNSTopic_withDeliveryPolicy (14.61s) === CONT TestAccAWSSNSTopic_NamePrefix_FIFOTopic --- PASS: TestAccAWSSNSTopic_encryption (26.03s) === CONT TestAccAWSSNSTopic_Name_FIFOTopic --- PASS: TestAccAWSSNSTopic_tags (38.26s) === CONT TestAccAWSSNSTopic_NamePrefix --- PASS: TestAccAWSSNSTopic_NamePrefix_FIFOTopic (15.82s) === CONT TestAccAWSSNSTopic_policy --- PASS: TestAccAWSSNSTopic_deliveryStatus (30.05s) === CONT TestAccAWSSNSTopic_Name --- PASS: TestAccAWSSNSTopic_Name_FIFOTopic (15.76s) === CONT TestAccAWSSNSTopic_withFakeIAMRole --- PASS: TestAccAWSSNSTopic_NamePrefix (13.74s) --- PASS: TestAccAWSSNSTopic_Name (13.86s) --- PASS: TestAccAWSSNSTopic_policy (15.04s) --- PASS: TestAccAWSSNSTopic_withFakeIAMRole (125.80s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 188.961s
1372db2
to
3cafba3
Compare
Acceptance test output: % make testacc TEST=./aws TESTARGS='-run=TestAccDataSourceAwsSnsTopic_' ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 20 -run=TestAccDataSourceAwsSnsTopic_ -timeout 180m === RUN TestAccDataSourceAwsSnsTopic_basic === PAUSE TestAccDataSourceAwsSnsTopic_basic === CONT TestAccDataSourceAwsSnsTopic_basic --- PASS: TestAccDataSourceAwsSnsTopic_basic (13.01s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 16.297s
Acceptance test outputCommercial
GovCloudFailures as FIFO topics are not currently supported:
|
@tomekr @janelletavares Thanks for the contribution 👏. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
…ed (#17164) * fix: append .fifo suffix for FIFO queue if name unspecified * test: add test for unnamed fifo queues * r/aws_sqs_queue: Make name generation and validation consistent with aws_sns_topic (#15828). Acceptance test output: % make testacc TEST=./aws TESTARGS='-run=TestAccAWSSQSQueue_' ACCTEST_PARALLELISM=4 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 4 -run=TestAccAWSSQSQueue_ -timeout 180m === RUN TestAccAWSSQSQueue_basic === PAUSE TestAccAWSSQSQueue_basic === RUN TestAccAWSSQSQueue_tags === PAUSE TestAccAWSSQSQueue_tags === RUN TestAccAWSSQSQueue_namePrefix === PAUSE TestAccAWSSQSQueue_namePrefix === RUN TestAccAWSSQSQueue_namePrefix_fifo === PAUSE TestAccAWSSQSQueue_namePrefix_fifo === RUN TestAccAWSSQSQueue_policy === PAUSE TestAccAWSSQSQueue_policy === RUN TestAccAWSSQSQueue_queueDeletedRecently === PAUSE TestAccAWSSQSQueue_queueDeletedRecently === RUN TestAccAWSSQSQueue_redrivePolicy === PAUSE TestAccAWSSQSQueue_redrivePolicy === RUN TestAccAWSSQSQueue_Policybasic === PAUSE TestAccAWSSQSQueue_Policybasic === RUN TestAccAWSSQSQueue_FIFO === PAUSE TestAccAWSSQSQueue_FIFO === RUN TestAccAWSSQSQueue_FIFOExpectNameError === PAUSE TestAccAWSSQSQueue_FIFOExpectNameError === RUN TestAccAWSSQSQueue_FIFOWithContentBasedDeduplication === PAUSE TestAccAWSSQSQueue_FIFOWithContentBasedDeduplication === RUN TestAccAWSSQSQueue_ExpectContentBasedDeduplicationError === PAUSE TestAccAWSSQSQueue_ExpectContentBasedDeduplicationError === RUN TestAccAWSSQSQueue_Encryption === PAUSE TestAccAWSSQSQueue_Encryption === RUN TestAccAWSSQSQueue_FIFO_MinusName === PAUSE TestAccAWSSQSQueue_FIFO_MinusName === CONT TestAccAWSSQSQueue_basic === CONT TestAccAWSSQSQueue_FIFO === CONT TestAccAWSSQSQueue_Encryption === CONT TestAccAWSSQSQueue_policy --- PASS: TestAccAWSSQSQueue_FIFO (14.10s) === CONT TestAccAWSSQSQueue_Policybasic --- PASS: TestAccAWSSQSQueue_Encryption (14.34s) === CONT TestAccAWSSQSQueue_redrivePolicy --- PASS: TestAccAWSSQSQueue_redrivePolicy (14.96s) === CONT TestAccAWSSQSQueue_queueDeletedRecently --- PASS: TestAccAWSSQSQueue_basic (33.02s) === CONT TestAccAWSSQSQueue_FIFOWithContentBasedDeduplication --- PASS: TestAccAWSSQSQueue_FIFOWithContentBasedDeduplication (11.85s) === CONT TestAccAWSSQSQueue_ExpectContentBasedDeduplicationError --- PASS: TestAccAWSSQSQueue_ExpectContentBasedDeduplicationError (1.64s) === CONT TestAccAWSSQSQueue_namePrefix_fifo --- PASS: TestAccAWSSQSQueue_queueDeletedRecently (17.96s) === CONT TestAccAWSSQSQueue_FIFOExpectNameError --- PASS: TestAccAWSSQSQueue_FIFOExpectNameError (1.59s) === CONT TestAccAWSSQSQueue_FIFO_MinusName --- PASS: TestAccAWSSQSQueue_namePrefix_fifo (13.39s) === CONT TestAccAWSSQSQueue_tags --- PASS: TestAccAWSSQSQueue_FIFO_MinusName (13.12s) === CONT TestAccAWSSQSQueue_namePrefix --- PASS: TestAccAWSSQSQueue_policy (66.36s) --- PASS: TestAccAWSSQSQueue_namePrefix (11.90s) --- PASS: TestAccAWSSQSQueue_Policybasic (64.42s) --- PASS: TestAccAWSSQSQueue_tags (30.27s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 94.367s * r/aws_sqs_queue: Additional name generation tests. Acceptance test output: % make testacc TEST=./aws TESTARGS='-run=TestAccAWSSQSQueue_' ACCTEST_PARALLELISM=4 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 4 -run=TestAccAWSSQSQueue_ -timeout 180m === RUN TestAccAWSSQSQueue_basic === PAUSE TestAccAWSSQSQueue_basic === RUN TestAccAWSSQSQueue_tags === PAUSE TestAccAWSSQSQueue_tags === RUN TestAccAWSSQSQueue_Name_Generated === PAUSE TestAccAWSSQSQueue_Name_Generated === RUN TestAccAWSSQSQueue_Name_Generated_FIFOQueue === PAUSE TestAccAWSSQSQueue_Name_Generated_FIFOQueue === RUN TestAccAWSSQSQueue_NamePrefix === PAUSE TestAccAWSSQSQueue_NamePrefix === RUN TestAccAWSSQSQueue_NamePrefix_FIFOQueue === PAUSE TestAccAWSSQSQueue_NamePrefix_FIFOQueue === RUN TestAccAWSSQSQueue_policy === PAUSE TestAccAWSSQSQueue_policy === RUN TestAccAWSSQSQueue_queueDeletedRecently === PAUSE TestAccAWSSQSQueue_queueDeletedRecently === RUN TestAccAWSSQSQueue_redrivePolicy === PAUSE TestAccAWSSQSQueue_redrivePolicy === RUN TestAccAWSSQSQueue_Policybasic === PAUSE TestAccAWSSQSQueue_Policybasic === RUN TestAccAWSSQSQueue_FIFO === PAUSE TestAccAWSSQSQueue_FIFO === RUN TestAccAWSSQSQueue_FIFOExpectNameError === PAUSE TestAccAWSSQSQueue_FIFOExpectNameError === RUN TestAccAWSSQSQueue_FIFOWithContentBasedDeduplication === PAUSE TestAccAWSSQSQueue_FIFOWithContentBasedDeduplication === RUN TestAccAWSSQSQueue_ExpectContentBasedDeduplicationError === PAUSE TestAccAWSSQSQueue_ExpectContentBasedDeduplicationError === RUN TestAccAWSSQSQueue_Encryption === PAUSE TestAccAWSSQSQueue_Encryption === CONT TestAccAWSSQSQueue_basic === CONT TestAccAWSSQSQueue_redrivePolicy === CONT TestAccAWSSQSQueue_NamePrefix === CONT TestAccAWSSQSQueue_queueDeletedRecently --- PASS: TestAccAWSSQSQueue_NamePrefix (14.27s) === CONT TestAccAWSSQSQueue_policy --- PASS: TestAccAWSSQSQueue_redrivePolicy (16.99s) === CONT TestAccAWSSQSQueue_Name_Generated --- PASS: TestAccAWSSQSQueue_queueDeletedRecently (20.58s) === CONT TestAccAWSSQSQueue_Name_Generated_FIFOQueue --- PASS: TestAccAWSSQSQueue_Name_Generated (12.20s) === CONT TestAccAWSSQSQueue_FIFOWithContentBasedDeduplication --- PASS: TestAccAWSSQSQueue_Name_Generated_FIFOQueue (12.84s) === CONT TestAccAWSSQSQueue_NamePrefix_FIFOQueue --- PASS: TestAccAWSSQSQueue_basic (34.10s) === CONT TestAccAWSSQSQueue_tags --- PASS: TestAccAWSSQSQueue_FIFOWithContentBasedDeduplication (13.36s) === CONT TestAccAWSSQSQueue_ExpectContentBasedDeduplicationError --- PASS: TestAccAWSSQSQueue_ExpectContentBasedDeduplicationError (1.61s) === CONT TestAccAWSSQSQueue_Encryption --- PASS: TestAccAWSSQSQueue_NamePrefix_FIFOQueue (12.78s) === CONT TestAccAWSSQSQueue_FIFO --- PASS: TestAccAWSSQSQueue_Encryption (11.97s) === CONT TestAccAWSSQSQueue_FIFOExpectNameError --- PASS: TestAccAWSSQSQueue_FIFOExpectNameError (1.62s) === CONT TestAccAWSSQSQueue_Policybasic --- PASS: TestAccAWSSQSQueue_FIFO (11.88s) --- PASS: TestAccAWSSQSQueue_tags (30.67s) --- PASS: TestAccAWSSQSQueue_policy (64.88s) --- PASS: TestAccAWSSQSQueue_Policybasic (63.94s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 124.792s * r/aws_sns_topic: Remove 'ImportStateVerifyIgnore' for 'name_prefix' in acceptance tests. Acceptance test output: % make testacc TEST=./aws TESTARGS='-run=TestAccAWSSNSTopic_' ACCTEST_PARALLELISM=4 ==> Checking that code complies with gofmt requirements... TF_ACC=1 go test ./aws -v -count 1 -parallel 4 -run=TestAccAWSSNSTopic_ -timeout 180m === RUN TestAccAWSSNSTopic_basic === PAUSE TestAccAWSSNSTopic_basic === RUN TestAccAWSSNSTopic_Name === PAUSE TestAccAWSSNSTopic_Name === RUN TestAccAWSSNSTopic_NamePrefix === PAUSE TestAccAWSSNSTopic_NamePrefix === RUN TestAccAWSSNSTopic_policy === PAUSE TestAccAWSSNSTopic_policy === RUN TestAccAWSSNSTopic_withIAMRole === PAUSE TestAccAWSSNSTopic_withIAMRole === RUN TestAccAWSSNSTopic_withFakeIAMRole === PAUSE TestAccAWSSNSTopic_withFakeIAMRole === RUN TestAccAWSSNSTopic_withDeliveryPolicy === PAUSE TestAccAWSSNSTopic_withDeliveryPolicy === RUN TestAccAWSSNSTopic_deliveryStatus === PAUSE TestAccAWSSNSTopic_deliveryStatus === RUN TestAccAWSSNSTopic_Name_Generated_FIFOTopic === PAUSE TestAccAWSSNSTopic_Name_Generated_FIFOTopic === RUN TestAccAWSSNSTopic_Name_FIFOTopic === PAUSE TestAccAWSSNSTopic_Name_FIFOTopic === RUN TestAccAWSSNSTopic_NamePrefix_FIFOTopic === PAUSE TestAccAWSSNSTopic_NamePrefix_FIFOTopic === RUN TestAccAWSSNSTopic_FIFOWithContentBasedDeduplication === PAUSE TestAccAWSSNSTopic_FIFOWithContentBasedDeduplication === RUN TestAccAWSSNSTopic_FIFOExpectContentBasedDeduplicationError === PAUSE TestAccAWSSNSTopic_FIFOExpectContentBasedDeduplicationError === RUN TestAccAWSSNSTopic_encryption === PAUSE TestAccAWSSNSTopic_encryption === RUN TestAccAWSSNSTopic_tags === PAUSE TestAccAWSSNSTopic_tags === CONT TestAccAWSSNSTopic_basic === CONT TestAccAWSSNSTopic_Name_Generated_FIFOTopic === CONT TestAccAWSSNSTopic_FIFOWithContentBasedDeduplication === CONT TestAccAWSSNSTopic_FIFOExpectContentBasedDeduplicationError --- PASS: TestAccAWSSNSTopic_FIFOExpectContentBasedDeduplicationError (3.24s) === CONT TestAccAWSSNSTopic_NamePrefix_FIFOTopic --- PASS: TestAccAWSSNSTopic_basic (17.44s) === CONT TestAccAWSSNSTopic_Name_FIFOTopic --- PASS: TestAccAWSSNSTopic_Name_Generated_FIFOTopic (17.45s) === CONT TestAccAWSSNSTopic_withIAMRole --- PASS: TestAccAWSSNSTopic_NamePrefix_FIFOTopic (16.26s) === CONT TestAccAWSSNSTopic_deliveryStatus --- PASS: TestAccAWSSNSTopic_FIFOWithContentBasedDeduplication (29.43s) === CONT TestAccAWSSNSTopic_withDeliveryPolicy --- PASS: TestAccAWSSNSTopic_Name_FIFOTopic (13.79s) === CONT TestAccAWSSNSTopic_withFakeIAMRole --- PASS: TestAccAWSSNSTopic_withIAMRole (23.62s) === CONT TestAccAWSSNSTopic_Name --- PASS: TestAccAWSSNSTopic_withDeliveryPolicy (14.49s) === CONT TestAccAWSSNSTopic_policy --- PASS: TestAccAWSSNSTopic_deliveryStatus (34.30s) === CONT TestAccAWSSNSTopic_tags --- PASS: TestAccAWSSNSTopic_Name (13.55s) === CONT TestAccAWSSNSTopic_NamePrefix --- PASS: TestAccAWSSNSTopic_policy (15.40s) === CONT TestAccAWSSNSTopic_encryption --- PASS: TestAccAWSSNSTopic_NamePrefix (13.83s) --- PASS: TestAccAWSSNSTopic_encryption (26.86s) --- PASS: TestAccAWSSNSTopic_tags (38.04s) --- PASS: TestAccAWSSNSTopic_withFakeIAMRole (125.75s) PASS ok github.com/terraform-providers/terraform-provider-aws/aws 160.023s Co-authored-by: Kit Ewbank <Kit_Ewbank@hotmail.com>
This has been released in version 3.37.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks! |
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
Community Note
Closes #15805
👋 First time contributor here so might miss some things. I used the "provider/aws: Added SQS FIFO queues" commit as a point of reference for this PR.
6702479 bumps the(reverted per github-actions bot's instructions)aws-sdk-go
library tov1.35.14
in order to get the new SNS FIFO attributes added in the v1.35.13 release9cdf5bb adds tests and an implementation. Of note here is that in order to create a FIFO SNS Topic, the
FifoTopic
attribute needs to be passed in with the call tosnsconn.CreateTopic
. As a result, I add this attribute to thesns.CreateTopicInput
structb2c3615 updates the docs. Looks like VS Code's markdown auto formatter may have shifted some things. Let me know if that's a problem
cc72b21 adds SNS Topic Name validators. Per the documentation, if the SNS topic is a FIFO Topic then the name must end with
.fifo
. Since the FIFO Topic is validated, a non-FIFO name validator was added as well. The constrains from the AWS docs state:Release note for CHANGELOG:
5019aad per @tecnobrat's suggestion, force a topic recreation if the
fifo_topic
attribute changesOutput from acceptance testing: