hashicorp / terraform-provider-aws

The AWS Provider enables Terraform to manage AWS resources.
https://registry.terraform.io/providers/hashicorp/aws
Mozilla Public License 2.0
9.74k stars 9.1k forks source link

[Bug]: SES TrackingOptionsDoesNotExist #34842

Open enchorb opened 9 months ago

enchorb commented 9 months ago

Terraform Core Version

1.6.5

AWS Provider Version

5.3.0

Affected Resource(s)

aws_ses_configuration_set

Expected Behavior

Tracking options deploys successfully without having top manually add it in the AWS console first

Actual Behavior

Get the error updating SES configuration set tracking options: TrackingOptionsDoesNotExist: There are no tracking options for configuration set

Relevant Error/Panic Output Snippet

╷
│ Error: updating SES configuration set tracking options: TrackingOptionsDoesNotExist: There are no tracking options for configuration set
│       status code: 400, request id: f9b026c1-b9b9-4b67-bc4f-20a686c624b9
│ 
│   with module.ses.aws_ses_configuration_set.configuration_set,
│   on ../modules/aws/ses/main.tf line 55, in resource "aws_ses_configuration_set" "configuration_set":
│   55: resource "aws_ses_configuration_set" "configuration_set" {
│ 
╵

Terraform Configuration Files

N/A

Steps to Reproduce

resource "aws_ses_configuration_set" "configuration_set" {
  name                       = "${local.name}-configuration-set"
  reputation_metrics_enabled = true
  tracking_options {
    custom_redirect_domain = "mail.link.${var.domain}"
  }
}

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

github-actions[bot] commented 9 months ago

Community Note

Voting for Prioritization

Volunteering to Work on This Issue

justinretzolk commented 9 months ago

Possibly related: #26229

kamilturek commented 8 months ago

Looks like this issue occurs when UpdateConfigurationSetTrackingOptionsWithContext is called without calling CreateConfigurationSetTrackingOptionsInput before.

This can happen when the configuration set is created first without tracking options, and then it's updated to include tracking options.

https://github.com/hashicorp/terraform-provider-aws/blob/5deca6413355b80d737a33f646223798dc0af2cc/internal/service/ses/configuration_set.go#L261 https://github.com/hashicorp/terraform-provider-aws/blob/5deca6413355b80d737a33f646223798dc0af2cc/internal/service/ses/configuration_set.go#L149

jd-ucpa commented 4 months ago

I have the exact same error using AWS provider 5.49.0

Error: updating SES configuration set (<MyConfigurationSetName>) tracking options: TrackingOptionsDoesNotExist: There are no tracking options for configuration set <MyConfigurationSetName>

UPDATE

Using sesv2_configuration_set instead of ses_configuration_set resolve this issue