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

aws_ses_domain_identity: Invalid domain name (trailing dot) #3836

Closed
ghost opened this issue Mar 19, 2018 · 6 comments · Fixed by #3840
Closed

aws_ses_domain_identity: Invalid domain name (trailing dot) #3836

ghost opened this issue Mar 19, 2018 · 6 comments · Fixed by #3840
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/ses Issues and PRs that pertain to the ses service.
Milestone

Comments

@ghost
Copy link

ghost commented Mar 19, 2018

This issue was originally opened by @eschwartz as hashicorp/terraform#17630. It was migrated here as a result of the provider split. The original body of the issue is below.


Terraform Version

v0.11.3

Terraform Configuration Files

data "aws_route53_zone" "zone" {
  name = "foo.example.com."
}

resource "aws_ses_domain_identity" "ses_id" {
  domain = "${data.aws_route53_zone.zone.name}"
}

Debug Output

018-03-19T12:10:01.312-0500 [DEBUG] plugin.terraform-provider-aws_v1.9.0_x4: Action=VerifyDomainIdentity&Domain=foo.example.com.&Version=2010-12-01
2018-03-19T12:10:01.312-0500 [DEBUG] plugin.terraform-provider-aws_v1.9.0_x4: -----------------------------------------------------
2018-03-19T12:10:01.974-0500 [DEBUG] plugin.terraform-provider-aws_v1.9.0_x4: 2018/03/19 12:10:01 [DEBUG] [aws-sdk-go] DEBUG: Response email/VerifyDomainIdentity Details:
2018-03-19T12:10:01.974-0500 [DEBUG] plugin.terraform-provider-aws_v1.9.0_x4: ---[ RESPONSE ]--------------------------------------
2018-03-19T12:10:01.974-0500 [DEBUG] plugin.terraform-provider-aws_v1.9.0_x4: HTTP/1.1 400 Bad Request
2018-03-19T12:10:01.974-0500 [DEBUG] plugin.terraform-provider-aws_v1.9.0_x4: Connection: close
2018-03-19T12:10:01.974-0500 [DEBUG] plugin.terraform-provider-aws_v1.9.0_x4: Content-Length: 290
2018-03-19T12:10:01.974-0500 [DEBUG] plugin.terraform-provider-aws_v1.9.0_x4: Content-Type: text/xml
2018-03-19T12:10:01.974-0500 [DEBUG] plugin.terraform-provider-aws_v1.9.0_x4: Date: Mon, 19 Mar 2018 17:10:01 GMT
2018-03-19T12:10:01.974-0500 [DEBUG] plugin.terraform-provider-aws_v1.9.0_x4: X-Amzn-Requestid: 5c5ef414-2b98-11e8-83b9-19d2f68b5217
2018-03-19T12:10:01.974-0500 [DEBUG] plugin.terraform-provider-aws_v1.9.0_x4: 
2018-03-19T12:10:01.974-0500 [DEBUG] plugin.terraform-provider-aws_v1.9.0_x4: 
2018-03-19T12:10:01.974-0500 [DEBUG] plugin.terraform-provider-aws_v1.9.0_x4: -----------------------------------------------------
2018-03-19T12:10:01.974-0500 [DEBUG] plugin.terraform-provider-aws_v1.9.0_x4: 2018/03/19 12:10:01 [DEBUG] [aws-sdk-go] <ErrorResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
2018-03-19T12:10:01.974-0500 [DEBUG] plugin.terraform-provider-aws_v1.9.0_x4:   <Error>
2018-03-19T12:10:01.974-0500 [DEBUG] plugin.terraform-provider-aws_v1.9.0_x4:     <Type>Sender</Type>
2018-03-19T12:10:01.974-0500 [DEBUG] plugin.terraform-provider-aws_v1.9.0_x4:     <Code>InvalidParameterValue</Code>
2018-03-19T12:10:01.974-0500 [DEBUG] plugin.terraform-provider-aws_v1.9.0_x4:     <Message>Invalid domain name foo.example.com..</Message>
2018-03-19T12:10:01.974-0500 [DEBUG] plugin.terraform-provider-aws_v1.9.0_x4:   </Error>
2018-03-19T12:10:01.974-0500 [DEBUG] plugin.terraform-provider-aws_v1.9.0_x4:   <RequestId>5c5ef414-2b98-11e8-83b9-19d2f68b5217</RequestId>
2018-03-19T12:10:01.974-0500 [DEBUG] plugin.terraform-provider-aws_v1.9.0_x4: </ErrorResponse>
2018-03-19T12:10:01.974-0500 [DEBUG] plugin.terraform-provider-aws_v1.9.0_x4: 2018/03/19 12:10:01 [DEBUG] [aws-sdk-go] DEBUG: Validate Response email/VerifyDomainIdentity failed, not retrying, error InvalidParameterValue: Invalid domain name foo.example.com..
2018-03-19T12:10:01.974-0500 [DEBUG] plugin.terraform-provider-aws_v1.9.0_x4: 	status code: 400, request id: 5c5ef414-2b98-11e8-83b9-19d2f68b5217
2018/03/19 12:10:01 [ERROR] root: eval: *terraform.EvalApplyPost, err: 1 error(s) occurred:

* aws_ses_domain_identity.ses_id: Error requesting SES domain identity verification: InvalidParameterValue: Invalid domain name foo.example.com..
	status code: 400, request id: 5c5ef414-2b98-11e8-83b9-19d2f68b5217
2018/03/19 12:10:01 [ERROR] root: eval: *terraform.EvalSequence, err: 1 error(s) occurred:

* aws_ses_domain_identity.ses_id: Error requesting SES domain identity verification: InvalidParameterValue: Invalid domain name foo.example.com..
	status code: 400, request id: 5c5ef414-2b98-11e8-83b9-19d2f68b5217

Expected Behavior

The aws_ses_domain_identity resource should have applied successfully, with domain name foo.example.com.

Actual Behavior

The aws_ses_domain_identity resource attempted to use the domain name foo.example.com.. (two trailing dots), so terraform apply failed with:

* aws_ses_domain_identity.ses_id: Error requesting SES domain identity verification: InvalidParameterValue: Invalid domain name foo.example.com..

Additional Context

My understanding was that I could pass in a Route53 zone name with or without a trailing dot. However, it appears as though an extra trailing dot is being added to the domain name before sending the request to the Amazon API

Workaround

I should be able to get around the issue by removing the trailing dot

References

@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. service/ses Issues and PRs that pertain to the ses service. labels Mar 20, 2018
@bflad bflad added this to the v1.12.0 milestone Mar 20, 2018
@bflad
Copy link
Contributor

bflad commented Mar 20, 2018

I have submitted PR #3840 to support a trailing period. 👍

@bflad
Copy link
Contributor

bflad commented Mar 20, 2018

Thanks for the report, @eschwartz! The support for trailing period in the domain name has been merged into master and will release with v1.12.0 of the AWS provider, likely later this week.

@eschwartz
Copy link

Wow, thanks for moving so quick on that :)

@bflad
Copy link
Contributor

bflad commented Mar 23, 2018

This has been released in version 1.12.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@Geartrixy
Copy link

Hello,

I think this issue has possible arisen again with the release of the provider 1.42.0 ?

I have always been using the latest aws provider, and now randomly it added a trailing dot to my configuration which was not there before and broke my setup.

I reconfigured the provider to used a specific version:

provider "aws" {
  version = "1.41.0"
  region = "${var.region}"

  #alias = "${var.region}"
}

But now I am getting the following error:

Error: Error applying plan:

1 error(s) occurred:

* aws_api_gateway_domain_name.iot_api_gateway_domain_name: 1 error(s) occurred:

* aws_api_gateway_domain_name.iot_api_gateway_domain_name: Error creating API Gateway Domain Name: BadRequestException: Trailing period should be omitted from domain
name

@ghost
Copy link
Author

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. service/ses Issues and PRs that pertain to the ses service.
Projects
None yet
3 participants