-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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 Route 53 Resolver endpoint resource #6574
Conversation
This is still a WIP as I'm having problems supporting more than one "IP address" (subnet ID and optional specified IP) per subnet.
|
You might be able to use |
Your
|
350fbf4
to
65fb362
Compare
Not having much luck with the // TODO
// TODO * "ip" may be computed - Blank on input, set by API on output; How to handle?
// TODO * Multiple "ip_address" values per "subnet_id" are allowed in the API
// TODO but a List (instead of a Set) won't work because of non-deterministic order
// TODO on listing ip_address, plus how to determine diffs for update?
// TODO Acceptance tests: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsRoute53ResolverEndpoint_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccAwsRoute53ResolverEndpoint_ -timeout 120m
=== RUN TestAccAwsRoute53ResolverEndpoint_basicInbound
=== PAUSE TestAccAwsRoute53ResolverEndpoint_basicInbound
=== RUN TestAccAwsRoute53ResolverEndpoint_updateOutbound
=== PAUSE TestAccAwsRoute53ResolverEndpoint_updateOutbound
=== CONT TestAccAwsRoute53ResolverEndpoint_basicInbound
=== CONT TestAccAwsRoute53ResolverEndpoint_updateOutbound
--- PASS: TestAccAwsRoute53ResolverEndpoint_basicInbound (135.30s)
--- PASS: TestAccAwsRoute53ResolverEndpoint_updateOutbound (516.18s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 516.201s |
7d24122
to
038c0bf
Compare
Rebased to fix conflicts. $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsRoute53ResolverEndpoint_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccAwsRoute53ResolverEndpoint_ -timeout 120m
=== RUN TestAccAwsRoute53ResolverEndpoint_basicInbound
=== PAUSE TestAccAwsRoute53ResolverEndpoint_basicInbound
=== RUN TestAccAwsRoute53ResolverEndpoint_updateOutbound
=== PAUSE TestAccAwsRoute53ResolverEndpoint_updateOutbound
=== CONT TestAccAwsRoute53ResolverEndpoint_basicInbound
=== CONT TestAccAwsRoute53ResolverEndpoint_updateOutbound
--- PASS: TestAccAwsRoute53ResolverEndpoint_basicInbound (132.30s)
--- PASS: TestAccAwsRoute53ResolverEndpoint_updateOutbound (569.06s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 569.081s |
@bflad Looking for advice on the best way of dealing with the set/list conundrum for the |
|
Hi team, any updates when this will be available ? |
@bflad Any thoughts on my stumbling block - #6574 (comment)? |
hi guys, any update for this feature become available ? thanks |
@aar6ncai I'm going to need this quite soon too 😄. |
@ewbankkit @gazoakley - any word? We need this pretty soon as well. |
Acceptance tests: $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsRoute53ResolverEndpoint_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccAwsRoute53ResolverEndpoint_ -timeout 120m
=== RUN TestAccAwsRoute53ResolverEndpoint_basicInbound
=== PAUSE TestAccAwsRoute53ResolverEndpoint_basicInbound
=== RUN TestAccAwsRoute53ResolverEndpoint_updateOutbound
=== PAUSE TestAccAwsRoute53ResolverEndpoint_updateOutbound
=== CONT TestAccAwsRoute53ResolverEndpoint_basicInbound
=== CONT TestAccAwsRoute53ResolverEndpoint_updateOutbound
--- PASS: TestAccAwsRoute53ResolverEndpoint_basicInbound (108.17s)
--- PASS: TestAccAwsRoute53ResolverEndpoint_updateOutbound (614.07s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 629.443s |
39dbee3
to
2c56405
Compare
Rebased to remove the merge conflict (and use $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsRoute53ResolverEndpoint_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccAwsRoute53ResolverEndpoint_ -timeout 120m
=== RUN TestAccAwsRoute53ResolverEndpoint_basicInbound
=== PAUSE TestAccAwsRoute53ResolverEndpoint_basicInbound
=== RUN TestAccAwsRoute53ResolverEndpoint_updateOutbound
=== PAUSE TestAccAwsRoute53ResolverEndpoint_updateOutbound
=== CONT TestAccAwsRoute53ResolverEndpoint_basicInbound
=== CONT TestAccAwsRoute53ResolverEndpoint_updateOutbound
--- PASS: TestAccAwsRoute53ResolverEndpoint_basicInbound (96.67s)
--- PASS: TestAccAwsRoute53ResolverEndpoint_updateOutbound (561.65s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 561.708s |
@ewbankkit @kmcquade do you have a sense of what the general use case would be for the subnet selection when creating resolvers? More specifically, would you say that the need is to configure resolvers with two different |
The AWS recommendation is two or more IP addresses in different Availability Zones which means distinct subnet IDs (and I think the API even enforces this, I'll check on that) and that is certainly how we will configuring our setup. Verified that distinct subnet IDs must be specified: $ aws route53resolver create-resolver-endpoint --name foo --security-group-ids sg-01234567 --creator-request-id foo --direction INBOUND --ip-addresses SubnetId=subnet-01234567,SubnetId=subnet-01234567
An error occurred (InvalidRequestException) when calling the CreateResolverEndpoint operation: [RSLVR-00400] Resolver endpoint need to have at least 2 IP addresses. |
I've tested locally using a TypeList and the API doesn't seem to enforce it. But I think we are in agreement on it not being a big enough use case.
|
Agreed, my test may have not been a real test of the API as the CLI might have collapsed the duplicated subnet IDs. |
@nywilken - definitely not the same |
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 thanks again for pushing this forward and for working through this PR with me. I left a few nitpicks around if/err
checks but this is otherwise good to go.
resp, err := conn.GetResolverEndpoint(&route53resolver.GetResolverEndpointInput{ | ||
ResolverEndpointId: aws.String(epId), | ||
}) | ||
if err != 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.
For readability we tend to go with the following convention:
if isAWSErr(err, route53resolver.ErrCodeResourceNotFoundException, "") {
return &route53resolver.ResolverEndpoint{}, route53ResolverEndpointStatusDeleted, nil
}
if err != nil {
return nil, "", err
}
buf.WriteString(fmt.Sprintf("%s-", m["subnet_id"].(string))) | ||
// TODO | ||
// TODO * "ip" may be computed - Blank on input, set by API on output; How to handle? | ||
// TODO * Multiple "ip_address" values per "subnet_id" are allowed in the API |
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.
Seems like we have debunked this via the documentation so it is safe to remove the multiple ip_address per subnet_id TODO.
_, err := conn.GetResolverEndpoint(&route53resolver.GetResolverEndpointInput{ | ||
ResolverEndpointId: aws.String(rs.Primary.ID), | ||
}) | ||
if err != 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.
ditto
_, err := conn.DeleteResolverEndpoint(&route53resolver.DeleteResolverEndpointInput{ | ||
ResolverEndpointId: aws.String(id), | ||
}) | ||
if err != 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.
ditto
Additional code review changes made. $ make testacc TEST=./aws/ TESTARGS='-run=TestAccAwsRoute53ResolverEndpoint_'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./aws/ -v -parallel 20 -run=TestAccAwsRoute53ResolverEndpoint_ -timeout 120m
=== RUN TestAccAwsRoute53ResolverEndpoint_basicInbound
=== PAUSE TestAccAwsRoute53ResolverEndpoint_basicInbound
=== RUN TestAccAwsRoute53ResolverEndpoint_updateOutbound
=== PAUSE TestAccAwsRoute53ResolverEndpoint_updateOutbound
=== CONT TestAccAwsRoute53ResolverEndpoint_basicInbound
=== CONT TestAccAwsRoute53ResolverEndpoint_updateOutbound
--- PASS: TestAccAwsRoute53ResolverEndpoint_basicInbound (206.00s)
--- PASS: TestAccAwsRoute53ResolverEndpoint_updateOutbound (707.33s)
PASS
ok github.com/terraform-providers/terraform-provider-aws/aws 707.352s |
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.
This is great @ewbankkit! Thanks again.
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! |
Fixes #6563.
Includes:
Acceptance tests (so far):