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

Ensure domain names & SANs are lower-case #46

Closed
wants to merge 7 commits into from

Conversation

alexjurkiewicz
Copy link
Contributor

If you provide an upper-case domain name, this module fails with the following error:

on .terraform/modules/my_certificate/main.tf line 37, in resource "aws_route53_record" "default":
37: name = each.value.name
A reference to "each.value" has been used in a context in which it
unavailable, such as when the configuration no longer contains the value in
its "for_each" expression. Remove this reference to each.value in your
configuration to work around this error.

what

  • Describe high-level what changed as a result of these commits (i.e. in plain-english, what do these changes mean?)
  • Use bullet points to be concise and to the point.

why

  • Provide the justifications for the changes (e.g. business case).
  • Describe why these changes were made (e.g. why do these commits fix the problem?)
  • Use bullet points to be concise and to the point.

references

  • Link to any supporting github issues or helpful documentation to add some context (e.g. stackoverflow).
  • Use closes #123, if this PR closes a GitHub issue #123

If you provide an upper-case domain name, this module fails with the following error:

  on .terraform/modules/my_certificate/main.tf line 37, in resource "aws_route53_record" "default":
  37:   name            = each.value.name
A reference to "each.value" has been used in a context in which it
unavailable, such as when the configuration no longer contains the value in
its "for_each" expression. Remove this reference to each.value in your
configuration to work around this error.
@alexjurkiewicz alexjurkiewicz requested a review from a team as a code owner June 7, 2021 02:29
alexjurkiewicz and others added 2 commits June 7, 2021 12:29
@mergify
Copy link

mergify bot commented Jul 9, 2021

This pull request is now in conflict. Could you fix it @alexjurkiewicz? 🙏

@Gowiem
Copy link
Member

Gowiem commented Jul 9, 2021

@alexjurkiewicz mind fixing the merge conflicts and we'll get this merged? Seems valid and I'm sure we can bump the minimum version of tf for this module at this point.

@Gowiem Gowiem self-requested a review July 9, 2021 18:09
@alexjurkiewicz
Copy link
Contributor Author

@alexjurkiewicz mind fixing the merge conflicts and we'll get this merged? Seems valid and I'm sure we can bump the minimum version of tf for this module at this point.

done 🙏

@Gowiem
Copy link
Member

Gowiem commented Jul 14, 2021

/test all

Gowiem
Gowiem previously approved these changes Jul 14, 2021
@Gowiem Gowiem added the terraform/0.13 Module requires Terraform 0.13 or later label Jul 14, 2021
@Gowiem
Copy link
Member

Gowiem commented Jul 14, 2021

/test terratest

@Gowiem
Copy link
Member

Gowiem commented Jul 14, 2021

@alexjurkiewicz 💥

TestExamplesComplete 2021-07-14T19:13:53Z command.go:121: 
TestExamplesComplete 2021-07-14T19:13:53Z command.go:121: Error: Invalid value for variable
TestExamplesComplete 2021-07-14T19:13:53Z command.go:121: 
TestExamplesComplete 2021-07-14T19:13:53Z command.go:121:   on main.tf line 19, in module "acm_request_certificate":
TestExamplesComplete 2021-07-14T19:13:53Z command.go:121:   19:   subject_alternative_names         = ["*.${module.zone.zone_name}"]
TestExamplesComplete 2021-07-14T19:13:53Z command.go:121: 
TestExamplesComplete 2021-07-14T19:13:53Z command.go:121: All SANs must be lower-case.
TestExamplesComplete 2021-07-14T19:13:53Z command.go:121: 
TestExamplesComplete 2021-07-14T19:13:53Z command.go:121: This was checked by the validation rule at ../../variables.tf:40,3-13.
TestExamplesComplete 2021-07-14T19:13:53Z command.go:121: 
TestExamplesComplete 2021-07-14T19:13:53Z command.go:121: 
TestExamplesComplete 2021-07-14T19:13:53Z command.go:121: Error: no matching Route53Zone found
TestExamplesComplete 2021-07-14T19:13:53Z command.go:121: 
TestExamplesComplete 2021-07-14T19:13:53Z command.go:121:   on ../../main.tf line 22, in data "aws_route53_zone" "default":
TestExamplesComplete 2021-07-14T19:13:53Z command.go:121:   22: data "aws_route53_zone" "default" {
TestExamplesComplete 2021-07-14T19:13:53Z command.go:121: 
TestExamplesComplete 2021-07-14T19:13:53Z command.go:121: 
TestExamplesComplete 2021-07-14T19:13:53Z retry.go:80: Returning due to fatal error: FatalError{Underlying: exit status 1}
    require.go:794: 
        	Error Trace:	apply.go:14
        	            				examples_complete_test.go:26
        	Error:      	Received unexpected error:
        	            	FatalError{Underlying: exit status 1}
        	Test:       	TestExamplesComplete

@alexjurkiewicz
Copy link
Contributor Author

Whoops, inverted condition, pushed a fix

@Gowiem
Copy link
Member

Gowiem commented Aug 4, 2021

/test all

@nitrocode
Copy link
Member

/test terratest

@Gowiem
Copy link
Member

Gowiem commented Aug 4, 2021

Huh we're getting the following:

TestExamplesComplete 2021-08-04T19:39:25Z command.go:121: module.zone.data.template_file.zone_name[0]: Refreshing state...
TestExamplesComplete 2021-08-04T19:39:28Z command.go:121: 
TestExamplesComplete 2021-08-04T19:39:28Z command.go:121: Error: no matching Route53Zone found
TestExamplesComplete 2021-08-04T19:39:28Z command.go:121: 
TestExamplesComplete 2021-08-04T19:39:28Z command.go:121:   on ../../main.tf line 22, in data "aws_route53_zone" "default":
TestExamplesComplete 2021-08-04T19:39:28Z command.go:121:   22: data "aws_route53_zone" "default" {
TestExamplesComplete 2021-08-04T19:39:28Z command.go:121: 
TestExamplesComplete 2021-08-04T19:39:28Z command.go:121: 
TestExamplesComplete 2021-08-04T19:39:28Z retry.go:80: Returning due to fatal error: FatalError{Underlying: exit status 1}
    require.go:794: 
        	Error Trace:	apply.go:14
        	            				examples_complete_test.go:26
        	Error:      	Received unexpected error:
        	            	FatalError{Underlying: exit status 1}
        	Test:       	TestExamplesComplete

I don't have time to look into now, but possibly a problem with the test suite overall?

@alexjurkiewicz
Copy link
Contributor Author

I can't see how it's related to this PR, at least.

@nitrocode
Copy link
Member

@Gowiem @alexjurkiewicz This PR will fix the test #48

@nitrocode
Copy link
Member

/test all

@nitrocode nitrocode requested a review from Gowiem August 19, 2021 00:17
@mergify
Copy link

mergify bot commented Sep 13, 2021

This pull request is now in conflict. Could you fix it @alexjurkiewicz? 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
terraform/0.13 Module requires Terraform 0.13 or later
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants