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

resource/aws_ses_event_destination: Add support for SNS destinations #1737

Merged
merged 2 commits into from
Jan 3, 2018

Conversation

stack72
Copy link
Contributor

@stack72 stack72 commented Sep 23, 2017

Fixes: #1697

terraform-provider-aws [master●] % acctests aws TestAccAWSSESEventDestination_basic
=== RUN   TestAccAWSSESEventDestination_basic
--- PASS: TestAccAWSSESEventDestination_basic (159.86s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	159.898s

Fixes: hashicorp#1697

```
terraform-provider-aws [master●] % acctests aws TestAccAWSSESEventDestination_basic
=== RUN   TestAccAWSSESEventDestination_basic
--- PASS: TestAccAWSSESEventDestination_basic (159.86s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	159.898s
```
Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left you some comments about randomization (those are blockers) and testing. Otherwise this is looking good.

@@ -156,6 +158,10 @@ data "aws_iam_policy_document" "fh_felivery_document" {
}
}

resource "aws_sns_topic" "ses_destination" {
name = "ses-destination-test"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you mind randomizing this name here?

default_value = "default"
dimension_name = "dimension"
value_source = "emailHeader"
}
}

resource "aws_ses_event_destination" "sns" {
name = "event-destination-sns",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Likewise ^ do you mind randomizing it?

@@ -26,6 +26,8 @@ func TestAccAWSSESEventDestination_basic(t *testing.T) {
"aws_ses_event_destination.kinesis", "name", "event-destination-kinesis"),
resource.TestCheckResourceAttr(
"aws_ses_event_destination.cloudwatch", "name", "event-destination-cloudwatch"),
resource.TestCheckResourceAttr(
"aws_ses_event_destination.sns", "name", "event-destination-sns"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick - but do you mind adding check for sns_destination.0.topic_arn as that is the field being added and that's the one that should also be tested?

@radeksimko radeksimko added bug Addresses a defect in current functionality. enhancement Requests to existing resources that expand the functionality or scope. and removed bug Addresses a defect in current functionality. labels Sep 27, 2017
@stack72
Copy link
Contributor Author

stack72 commented Oct 4, 2017

@radeksimko so I looked at this and the reason the original tests are not actually randomized is that there is nothing happening in the Read func - therefore, when we check that a destroy happens, we are actually checking the hardcoded SES destination to make sure it no longer exists

Thoughts?

P.

@caJaeger
Copy link

@radeksimko Is this dead in the water? I would love to see this in the next release...

@sefaYavuz
Copy link

sefaYavuz commented Nov 9, 2017

@radeksimko +1 need this!

@radeksimko radeksimko added the size/M Managed by automation to categorize the size of a PR. label Nov 15, 2017
@pccowboy
Copy link

@stack72 I have what might be valid tests for what @radeksimko has asked for - how best to get them into this PR?

pccowboy pushed a commit to ValiMail/terraform-provider-aws that referenced this pull request Nov 28, 2017
Add random digits to SNS event and topic resources
Add check for correct SNS destination ARN
Rename poorly named test
adjust log msgs for same
Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for all the work here @stack72

I just added the randomization & pushed to your branch. I hope you don't mind.

=== RUN   TestAccAWSSESEventDestination_basic
--- PASS: TestAccAWSSESEventDestination_basic (206.21s)
PASS
ok  	github.com/terraform-providers/terraform-provider-aws/aws	206.240s

@radeksimko
Copy link
Member

There are other things to improve on that resource - e.g. turning all the MaxItems: 1 TypeSets into TypeLists to make nested fields easier to reference in tests and elsewhere, but that's certainly outside of scope of this PR.

Merging now...

@radeksimko radeksimko merged commit 91a1c6e into hashicorp:master Jan 3, 2018
@bflad
Copy link
Contributor

bflad commented Jan 12, 2018

This has been released in terraform-provider-aws version 1.7.0. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@bflad bflad added this to the v1.7.0 milestone Jan 12, 2018
@@ -53,20 +53,21 @@ func resourceAwsSesEventDestination() *schema.Resource {
Type: schema.TypeSet,
Optional: true,
ForceNew: true,
ConflictsWith: []string{"kinesis_destination"},
MaxItems: 1,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interestingly enough, this resource actually did appear to support multiple cloudwatch_destination previously, even if it wasn't appropriately acceptance tested. This change will likely be reverted in #6690

@ghost
Copy link

ghost commented Apr 2, 2020

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!

@ghost ghost locked and limited conversation to collaborators Apr 2, 2020
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. size/M Managed by automation to categorize the size of a PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

aws_ses_event_destination: SNS destination?
6 participants