-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/aws: Initial support for Application Load Balancers #8254
Conversation
197ef40
to
0145099
Compare
return fmt.Errorf("Unable to find ALB: %#v", describeResp.LoadBalancers) | ||
} | ||
|
||
alb := describeResp.LoadBalancers[0] |
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.
Can we guarantee that our ALB is the first in the collection?
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.
Yes - otherwise the error above would trigger.
0145099
to
db22a82
Compare
return err | ||
} | ||
|
||
log.Printf("[INFO] ALB ID: %s", d.Id()) |
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.
You are using d.Id before setting it below
697869f
to
da4f09c
Compare
}, | ||
|
||
"security_groups": { | ||
Type: schema.TypeSet, |
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.
If this cannot be modified, then this should be ForceNew: true
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.
Good catch, corrected.
da4f09c
to
9ea782b
Compare
|
||
func validateAwsAlbTargetGroupPort(v interface{}, k string) (ws []string, errors []error) { | ||
port := v.(int) | ||
if port < 0 || port > 65536 { |
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.
Should be <1 not <0
b4361ce
to
5276d21
Compare
|
||
log.Printf("[DEBUG] ALB create configuration: %#v", elbOpts) | ||
var albArn string | ||
err := resource.Retry(1*time.Minute, func() *resource.RetryError { |
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.
Why exactly are we retrying this operation if there's no RetryableError
?
5276d21
to
6619bc2
Compare
} | ||
|
||
accessLogMap := map[string]interface{}{} | ||
for _, attr := range attributesResp.Attributes { |
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.
Wouldn't this be easier to maintain going forward if we just had a single attributes
(TypeMap
) field instead of trying to do this conversion?
Admittedly we'd probably still need to have some kind of key-filtering because of #8104
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.
I don't think we can easily do that and retain the same semantics? Here we construct the required structure to set on access_log
- the other attributes work on different prefixes? We could have a single attributes
map in the schema, but I think this is more explicit and closer to expectations at the moment.
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.
the other attributes work on different prefixes
yeah, it would mean making the map keys more verbose, which goes against UX, so forget what I said. This looks 👌
6619bc2
to
3d83c41
Compare
@jen20 This is looking pretty good. I tried running the attached acceptance tests and one failed:
|
@radeksimko Yup, fixing that up at the moment. |
This commit adds a resource, acceptance tests and documentation for the new Application Load Balancer (aws_alb). We choose to use the name alb over the package name, elbv2, in order to avoid confusion. This is the first in a series of commits to fully support the new resources necessary for Application Load Balancers.
This commit adds a resource, acceptance tests and documentation for the Target Groups for Application Load Balancers. This is the second in a series of commits to fully support the new resources necessary for Application Load Balancers.
3d83c41
to
531a976
Compare
|
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
This pull request contains the first two resources for Application Load Balancers ("ALB" or "elbv2"),
aws_alb
andaws_alb_target_group
.The resources necessary will be split across a number of pull requests to facilitate review.
Part of #8137.