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

elb_application_lb: test a rule based on http-header #347

Conversation

goneri
Copy link
Member

@goneri goneri commented Jan 7, 2021

This should initially fail and be fixed the day ansible-collections/amazon.aws#188
is merged.

See: ansible-collections/amazon.aws#187
See: #117

@goneri
Copy link
Member Author

goneri commented Jan 8, 2021

On hold until #348 is merged.

@ansibullbot
Copy link

@goneri goneri force-pushed the elb_application_lb-test-a-rule-based-on-http-header_9315 branch from 95f328c to d124b4c Compare January 19, 2021 15:27
@goneri
Copy link
Member Author

goneri commented Jan 19, 2021

This feature depends on boto3 1.16.57 which is not availbe in our CI env. ansible-collections/amazon.aws#188 (comment)

@ansibullbot ansibullbot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR and removed community_review labels Jan 19, 2021
@jillr
Copy link
Collaborator

jillr commented Feb 4, 2021

@goneri 1.16.57 is very new, it's only been out for a few weeks. It's unlikely many of our users will have it yet in their environments.

Rather than requiring this version of boto3 in the mod_util we should check in the affected module(s) for the boto3 version when the feature that needs this version is used, like we do here:
https://github.com/ansible-collections/community.aws/blob/main/plugins/modules/iam_role.py#L641-L645

Then the integration tests would setup a virtualenv with that version of boto3 when testing that feature: https://github.com/ansible-collections/community.aws/blob/main/tests/integration/targets/elb_application_lb/tasks/main.yml

Copy link
Contributor

@tremble tremble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some examples of adding the new version of boto to environments can be found in:
#390

Note: I would generally recommend putting the dependency on the version of botocore rather than boto3. (That's where the actual test is happening)

to find the exact version of botocore you can do the following:

git clone https://github.com/boto/botocore.git
cd botocore
git blame botocore/data/elbv2/2015-12-01/service-2.json

Search for the API parameter you're trying to set (in this case HttpHeaderConfig):

4667b46391 (aws-sdk-python-automation 2019-06-24 20:15:37 +0000 2657)         "HttpHeaderConfig":{
4667b46391 (aws-sdk-python-automation 2019-06-24 20:15:37 +0000 2658)           "shape":"HttpHeaderConditionConfig",
4667b46391 (aws-sdk-python-automation 2019-06-24 20:15:37 +0000 2659)           "documentation":"<p>Information for an HTTP header condition. Specify only when <code>Field</code> is <code>http-header</code>.</p>"
4667b46391 (aws-sdk-python-automation 2019-06-24 20:15:37 +0000 2660)         },

The commit hash at the start of the line then tells you when the option was added to botocore

git tag --contains 4667b46391

This will then spit out a list of all botocore versions with support for that feature
the earliest being 1.12.176 ( Tue Jun 25 19:29:47 2019 ) which is much more reasonable to expect people to have installed than one from 2 weeks ago.

Digging a little further it looks like you're passing the wrong parameters for HttpHeaderConfig. See also https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/elbv2.html#ElasticLoadBalancingv2.Client.create_rule

@tremble tremble force-pushed the elb_application_lb-test-a-rule-based-on-http-header_9315 branch from 12549ad to 593de15 Compare March 16, 2021 17:22
@ansibullbot ansibullbot added community_review and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Mar 16, 2021
@tremble tremble merged commit 8c0ea48 into ansible-collections:main Mar 16, 2021
danquixote pushed a commit to danquixote/community.aws that referenced this pull request May 16, 2021
…ions#347)

* elb_application_lb: test a rule based on http-header

This should initially fail and be fixed the day ansible-collections/amazon.aws#188
is merged.

See: ansible-collections/amazon.aws#187
See: ansible-collections#117


Co-authored-by: Mark Chappell <[email protected]>
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request Jul 19, 2021
…ions#347)

* elb_application_lb: test a rule based on http-header

This should initially fail and be fixed the day ansible-collections/amazon.aws#188
is merged.

See: ansible-collections/amazon.aws#187
See: ansible-collections#117


Co-authored-by: Mark Chappell <[email protected]>
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request Jul 19, 2021
…ions#347)

* elb_application_lb: test a rule based on http-header

This should initially fail and be fixed the day ansible-collections/amazon.aws#188
is merged.

See: ansible-collections/amazon.aws#187
See: ansible-collections#117


Co-authored-by: Mark Chappell <[email protected]>
danielcotton pushed a commit to danielcotton/community.aws that referenced this pull request Nov 23, 2021
…ions#347)

* elb_application_lb: test a rule based on http-header

This should initially fail and be fixed the day ansible-collections/amazon.aws#188
is merged.

See: ansible-collections/amazon.aws#187
See: ansible-collections#117


Co-authored-by: Mark Chappell <[email protected]>
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request May 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community_review integration tests/integration plugins plugin (any type) tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants