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

fix/elbv2-tg: KeyError when getting ProtocolVersion #1800

Merged

Conversation

mtulio
Copy link
Contributor

@mtulio mtulio commented May 2, 2023

SUMMARY

Fix KeyError on module elb_target_group.

Given the task:

- name: Target | AWS | Create {{ tg.name }}
  community.aws.elb_target_group:
    state: present
    region: "{{ tg.region | d(omit) }}"
    name: "{{ tg.name }}"
    vpc_id: "{{ vpc_id }}"
    tags: "{{ tg.tags | d(omit) }}"
    purge_tags: "{{ tg.purge_tags | d('no') }}"
    protocol: "{{ tg.protocol }}"
    port: "{{ tg.port }}"
    # Health Check
    health_check_protocol: "{{ tg.health_check_protocol }}"
    health_check_path: "{{ tg.health_check_path | d(omit) }}"
    health_check_port: "{{ tg.health_check_port | d(omit) }}"
    successful_response_codes: "{{ tg.successful_response_codes | d(omit) }}"
    health_check_interval: "{{ tg.health_check_interval | d(omit) }}"
    health_check_timeout: "{{ tg.health_check_timeout | d(omit) }}"
    healthy_threshold_count: "{{ tg.healthy_threshold_count | d(omit) }}"
    unhealthy_threshold_count: "{{ tg.unhealthy_threshold_count | d(omit) }}"
    # Targets
    target_type: "{{ tg.target_type | d(omit) }}"
    modify_targets: "{{ tg.modify_targets | d(omit) }}"
    tagets: "{{ tg.tagets | d(omit) }}"
    # Config
    stickiness_enabled: "{{ tg.stickiness_enabled | d(omit) }}"
    stickiness_app_cookie_duration: "{{ tg.stickiness_app_cookie_duration | d(omit) }}"
    stickiness_app_cookie_name: "{{ tg.stickiness_app_cookie_name | d(omit) }}"
    stickiness_lb_cookie_duration: "{{ tg.stickiness_lb_cookie_duration | d(omit) }}"
    stickiness_type: "{{ tg.stickiness_type | d(omit) }}"
    proxy_protocol_v2_enabled: "{{ tg.proxy_protocol_v2_enabled | d(omit) }}"
    preserve_client_ip_enabled: "{{ tg.preserve_client_ip_enabled | d(omit) }}"
    deregistration_delay_timeout: "{{ tg.deregistration_delay_timeout | d(omit) }}"
  register: tg_out
  until: "tg_out is not failed"
  retries: 10
  delay: 5
  • The following error when running against existing resources (after creation/idempotency) that do not use ProtocolVersion (optional*, E.g: TCP):
The full traceback is:
Traceback (most recent call last):
  File "/home/myuser/.ansible/tmp/ansible-tmp-1683068584.628099-3322568-261537723315094/AnsiballZ_elb_target_group.py", line 107, in <module>
    _ansiballz_main()
  File "/home/myuser/.ansible/tmp/ansible-tmp-1683068584.628099-3322568-261537723315094/AnsiballZ_elb_target_group.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/myuser/.ansible/tmp/ansible-tmp-1683068584.628099-3322568-261537723315094/AnsiballZ_elb_target_group.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.community.aws.plugins.modules.elb_target_group', init_globals=dict(_module_fqn='ansible_collections.community.aws.plugins.modules.elb_target_group', _modlib_path=modlib_path),
  File "/usr/lib64/python3.9/runpy.py", line 225, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib64/python3.9/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib64/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_community.aws.elb_target_group_payload_y5gefe7e/ansible_community.aws.elb_target_group_payload.zip/ansible_collections/community/aws/plugins/modules/elb_target_group.py", line 989, in <module>
  File "/tmp/ansible_community.aws.elb_target_group_payload_y5gefe7e/ansible_community.aws.elb_target_group_payload.zip/ansible_collections/community/aws/plugins/modules/elb_target_group.py", line 983, in main
  File "/tmp/ansible_community.aws.elb_target_group_payload_y5gefe7e/ansible_community.aws.elb_target_group_payload.zip/ansible_collections/community/aws/plugins/modules/elb_target_group.py", line 685, in create_or_update_target_group
KeyError: 'ProtocolVersion'
fatal: [localhost]: FAILED! => {
    "attempts": 10,
    "changed": false,
    "module_stderr": "Traceback (most recent call last):\n  File \"/home/myuser/.ansible/tmp/ansible-tmp-1683068584.628099-3322568-261537723315094/AnsiballZ_elb_target_group.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/home/myuser/.ansible/tmp/ansible-tmp-1683068584.628099-3322568-261537723315094/AnsiballZ_elb_target_group.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/myuser/.ansible/tmp/ansible-tmp-1683068584.628099-3322568-261537723315094/AnsiballZ_elb_target_group.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.community.aws.plugins.modules.elb_target_group', init_globals=dict(_module_fqn='ansible_collections.community.aws.plugins.modules.elb_target_group', _modlib_path=modlib_path),\n  File \"/usr/lib64/python3.9/runpy.py\", line 225, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib64/python3.9/runpy.py\", line 97, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib64/python3.9/runpy.py\", line 87, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_community.aws.elb_target_group_payload_y5gefe7e/ansible_community.aws.elb_target_group_payload.zip/ansible_collections/community/aws/plugins/modules/elb_target_group.py\", line 989, in <module>\n  File \"/tmp/ansible_community.aws.elb_target_group_payload_y5gefe7e/ansible_community.aws.elb_target_group_payload.zip/ansible_collections/community/aws/plugins/modules/elb_target_group.py\", line 983, in main\n  File \"/tmp/ansible_community.aws.elb_target_group_payload_y5gefe7e/ansible_community.aws.elb_target_group_payload.zip/ansible_collections/community/aws/plugins/modules/elb_target_group.py\", line 685, in create_or_update_target_group\nKeyError: 'ProtocolVersion'\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}
  • ProtocolVersion is not returned a valid attribute from the resource using TCP Protocol
$ aws elbv2  describe-target-groups --target-group-arns arn:aws:elasticloadbalancing:us-east-1:[redacted:AWS_ACCOUNT_ID]:targetgroup/okipr3601-lfmwl-aext/513dc1925ba2791f
{
    "TargetGroups": [
        {
            "TargetGroupArn": "arn:aws:elasticloadbalancing:us-east-1:[redacted:AWS_ACCOUNT_ID]:targetgroup/okipr3601-lfmwl-aext/513dc1925ba2791f",
            "TargetGroupName": "okipr3601-lfmwl-aext",
            "Protocol": "TCP",
            "Port": 6443,
            "VpcId": "vpc-0eef74291b5613c03",
            "HealthCheckProtocol": "HTTPS",
            "HealthCheckPort": "6443",
            "HealthCheckEnabled": true,
            "HealthCheckIntervalSeconds": 10,
            "HealthCheckTimeoutSeconds": 10,
            "HealthyThresholdCount": 2,
            "UnhealthyThresholdCount": 2,
            "HealthCheckPath": "/readyz",
            "Matcher": {
                "HttpCode": "200-399"
            },
            "LoadBalancerArns": [
                "arn:aws:elasticloadbalancing:us-east-1:[redacted:AWS_ACCOUNT_ID]:loadbalancer/net/okipr3601-lfmwl-ext/93bc672ccecb2bd7"
            ],
            "TargetType": "ip",
            "IpAddressType": "ipv4"
        }
    ]
}

  • Versions
$ ansible-galaxy collection list
Collection           Version     
-------------------- ------------
amazon.aws           5.4.0       
community.aws        5.4.0       

$ python -V
Python 3.9.13

 ansible --version
ansible [core 2.14.5]
  config file = /home/ansible.cfg
  configured module search path = ['/home/myuser/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/myuser/.venvs/vpy3.9/lib64/python3.9/site-packages/ansible
  ansible collection location = /home/collections
  executable location = /home/myuser/.venvs/vpy3.9/bin/ansible
  python version = 3.9.13 (main, Nov  9 2022, 13:16:24) [GCC 8.5.0 20210514 (Red Hat 8.5.0-15)] (/home/myuser/.venvs/vpy3.9/bin/python3.9)
  jinja version = 3.1.2
  libyaml = True

 $ pip freeze |grep boto
boto3==1.26.125
botocore==1.29.125

*ProtocolVersion is not Required, according to the API definition: https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_TargetGroup.html

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME
  • elb_target_group
ADDITIONAL INFORMATION

@softwarefactory-project-zuul
Copy link
Contributor

Merge Failed.

This change or one of its cross-repo dependencies was unable to be automatically merged with the current state of its repository. Please rebase the change and upload a new patchset.
Warning:
Error merging github.com/ansible-collections/community.aws for 1800,97cb8416d1abd09519faa955b870e5eeecc16013

@mtulio
Copy link
Contributor Author

mtulio commented May 2, 2023

@tremble , ptal?
/cc @tremble

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/f497a65344b1420b99dd0a644aa7126f

✔️ ansible-galaxy-importer SUCCESS in 4m 10s
✔️ build-ansible-collection SUCCESS in 13m 11s
✔️ ansible-test-sanity-docker-devel SUCCESS in 9m 23s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 11m 39s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 11m 34s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 9m 28s
✔️ ansible-test-sanity-docker-stable-2.14 SUCCESS in 9m 32s
✔️ ansible-test-units-amazon-aws-python36 SUCCESS in 10m 51s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 7m 31s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 7m 03s
✔️ ansible-test-units-amazon-aws-python310 SUCCESS in 9m 47s
ansible-test-changelog FAILURE in 4m 29s
✔️ ansible-test-splitter SUCCESS in 4m 49s
✔️ integration-community.aws-1 SUCCESS in 24m 42s
Skipped 21 jobs

@markuman
Copy link
Member

markuman commented May 3, 2023

recheck

@markuman markuman added the backport-5 PR should be backported to the stable-5 branch label May 3, 2023
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/5973e1829f034b4c8bdba9c86cb7242b

✔️ ansible-galaxy-importer SUCCESS in 4m 20s
✔️ build-ansible-collection SUCCESS in 13m 16s
✔️ ansible-test-sanity-docker-devel SUCCESS in 13m 21s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 13m 08s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 10m 51s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 11m 32s
✔️ ansible-test-sanity-docker-stable-2.14 SUCCESS in 12m 45s
✔️ ansible-test-units-amazon-aws-python36 SUCCESS in 6m 39s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 7m 47s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 6m 43s
✔️ ansible-test-units-amazon-aws-python310 SUCCESS in 9m 02s
✔️ ansible-test-changelog SUCCESS in 4m 52s
✔️ ansible-test-splitter SUCCESS in 5m 31s
✔️ integration-community.aws-1 SUCCESS in 23m 15s
Skipped 21 jobs

@mtulio
Copy link
Contributor Author

mtulio commented May 3, 2023

@markuman is it possible that ansible/third-party-check job failed by a flake? It passed here without any changes

@alinabuzachis
Copy link
Contributor

recheck

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/3d4377e7b3124dab93857df90b527084

✔️ ansible-galaxy-importer SUCCESS in 3m 57s
✔️ build-ansible-collection SUCCESS in 12m 57s
✔️ ansible-test-sanity-docker-devel SUCCESS in 12m 39s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 10m 37s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 9m 34s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 9m 40s
✔️ ansible-test-sanity-docker-stable-2.14 SUCCESS in 11m 37s
✔️ ansible-test-units-amazon-aws-python36 SUCCESS in 5m 42s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 6m 19s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 6m 53s
✔️ ansible-test-units-amazon-aws-python310 SUCCESS in 6m 34s
✔️ ansible-test-changelog SUCCESS in 4m 47s
✔️ ansible-test-splitter SUCCESS in 5m 20s
✔️ integration-community.aws-1 SUCCESS in 21m 44s
Skipped 21 jobs

@tremble tremble added the mergeit Merge the PR (SoftwareFactory) label May 5, 2023
@github-actions
Copy link

github-actions bot commented May 5, 2023

Docs Build 📝

Thank you for contribution!✨

This PR has been merged and your docs changes will be incorporated when they are next published.

@softwarefactory-project-zuul
Copy link
Contributor

Build failed (gate pipeline). For information on how to proceed, see
http://docs.openstack.org/infra/manual/developers.html#automated-testing

https://ansible.softwarefactory-project.io/zuul/buildset/fa5da130e7a7413dafccc948a1be5027

ansible-galaxy-importer FAILURE in 4m 14s
✔️ build-ansible-collection SUCCESS in 13m 27s
✔️ ansible-test-sanity-docker-devel SUCCESS in 10m 07s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 12m 03s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 10m 52s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 11m 16s
✔️ ansible-test-sanity-docker-stable-2.14 SUCCESS in 10m 15s
✔️ ansible-test-units-amazon-aws-python36 SUCCESS in 6m 10s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 5m 33s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 6m 14s
✔️ ansible-test-units-amazon-aws-python310 SUCCESS in 8m 48s
✔️ ansible-test-changelog SUCCESS in 4m 34s
✔️ ansible-test-splitter SUCCESS in 5m 04s
✔️ integration-community.aws-1 SUCCESS in 24m 19s
Skipped 21 jobs

@tremble
Copy link
Contributor

tremble commented May 5, 2023

regate

@tremble tremble added this to the 5.5.0 milestone May 5, 2023
@tremble tremble mentioned this pull request May 5, 2023
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).
https://ansible.softwarefactory-project.io/zuul/buildset/ef36e797d85c4665bb2f82a8bbf35182

✔️ ansible-galaxy-importer SUCCESS in 4m 08s
✔️ build-ansible-collection SUCCESS in 12m 46s
✔️ ansible-test-sanity-docker-devel SUCCESS in 13m 02s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 10m 18s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 13m 10s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 13m 29s
✔️ ansible-test-sanity-docker-stable-2.14 SUCCESS in 11m 45s
✔️ ansible-test-units-amazon-aws-python36 SUCCESS in 8m 48s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 6m 30s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 8m 55s
✔️ ansible-test-units-amazon-aws-python310 SUCCESS in 9m 01s
✔️ ansible-test-changelog SUCCESS in 4m 27s
✔️ ansible-test-splitter SUCCESS in 4m 53s
✔️ integration-community.aws-1 SUCCESS in 21m 58s
Skipped 21 jobs

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 3db37d7 into ansible-collections:main May 5, 2023
@patchback
Copy link

patchback bot commented May 5, 2023

Backport to stable-5: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply 3db37d7 on top of patchback/backports/stable-5/3db37d7507afeda96ae50630c15a120a94633f26/pr-1800

Backporting merged PR #1800 into main

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/ansible-collections/community.aws.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/stable-5/3db37d7507afeda96ae50630c15a120a94633f26/pr-1800 upstream/stable-5
  4. Now, cherry-pick PR fix/elbv2-tg: KeyError when getting ProtocolVersion #1800 contents into that branch:
    $ git cherry-pick -x 3db37d7507afeda96ae50630c15a120a94633f26
    If it'll yell at you with something like fatal: Commit 3db37d7507afeda96ae50630c15a120a94633f26 is a merge but no -m option was given., add -m 1 as follows instead:
    $ git cherry-pick -m1 -x 3db37d7507afeda96ae50630c15a120a94633f26
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR fix/elbv2-tg: KeyError when getting ProtocolVersion #1800 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/stable-5/3db37d7507afeda96ae50630c15a120a94633f26/pr-1800
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

softwarefactory-project-zuul bot pushed a commit that referenced this pull request May 5, 2023
[backport] [stable-5] fix/elbv2-tg: KeyError when getting ProtocolVersion

Manual backport of #1800
SUMMARY

Fix KeyError on module elb_target_group.

Given the task:
- name: Target | AWS | Create {{ tg.name }}
  community.aws.elb_target_group:
    state: present
    region: "{{ tg.region | d(omit) }}"
    name: "{{ tg.name }}"
    vpc_id: "{{ vpc_id }}"
    tags: "{{ tg.tags | d(omit) }}"
    purge_tags: "{{ tg.purge_tags | d('no') }}"
    protocol: "{{ tg.protocol }}"
    port: "{{ tg.port }}"
    # Health Check
    health_check_protocol: "{{ tg.health_check_protocol }}"
    health_check_path: "{{ tg.health_check_path | d(omit) }}"
    health_check_port: "{{ tg.health_check_port | d(omit) }}"
    successful_response_codes: "{{ tg.successful_response_codes | d(omit) }}"
    health_check_interval: "{{ tg.health_check_interval | d(omit) }}"
    health_check_timeout: "{{ tg.health_check_timeout | d(omit) }}"
    healthy_threshold_count: "{{ tg.healthy_threshold_count | d(omit) }}"
    unhealthy_threshold_count: "{{ tg.unhealthy_threshold_count | d(omit) }}"
    # Targets
    target_type: "{{ tg.target_type | d(omit) }}"
    modify_targets: "{{ tg.modify_targets | d(omit) }}"
    tagets: "{{ tg.tagets | d(omit) }}"
    # Config
    stickiness_enabled: "{{ tg.stickiness_enabled | d(omit) }}"
    stickiness_app_cookie_duration: "{{ tg.stickiness_app_cookie_duration | d(omit) }}"
    stickiness_app_cookie_name: "{{ tg.stickiness_app_cookie_name | d(omit) }}"
    stickiness_lb_cookie_duration: "{{ tg.stickiness_lb_cookie_duration | d(omit) }}"
    stickiness_type: "{{ tg.stickiness_type | d(omit) }}"
    proxy_protocol_v2_enabled: "{{ tg.proxy_protocol_v2_enabled | d(omit) }}"
    preserve_client_ip_enabled: "{{ tg.preserve_client_ip_enabled | d(omit) }}"
    deregistration_delay_timeout: "{{ tg.deregistration_delay_timeout | d(omit) }}"
  register: tg_out
  until: "tg_out is not failed"
  retries: 10
  delay: 5


The following error when running against existing resources (after creation/idempotency) that do not use ProtocolVersion (optional*, E.g: TCP):

The full traceback is:
Traceback (most recent call last):
  File "/home/myuser/.ansible/tmp/ansible-tmp-1683068584.628099-3322568-261537723315094/AnsiballZ_elb_target_group.py", line 107, in <module>
    _ansiballz_main()
  File "/home/myuser/.ansible/tmp/ansible-tmp-1683068584.628099-3322568-261537723315094/AnsiballZ_elb_target_group.py", line 99, in _ansiballz_main
    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)
  File "/home/myuser/.ansible/tmp/ansible-tmp-1683068584.628099-3322568-261537723315094/AnsiballZ_elb_target_group.py", line 47, in invoke_module
    runpy.run_module(mod_name='ansible_collections.community.aws.plugins.modules.elb_target_group', init_globals=dict(_module_fqn='ansible_collections.community.aws.plugins.modules.elb_target_group', _modlib_path=modlib_path),
  File "/usr/lib64/python3.9/runpy.py", line 225, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib64/python3.9/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib64/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/tmp/ansible_community.aws.elb_target_group_payload_y5gefe7e/ansible_community.aws.elb_target_group_payload.zip/ansible_collections/community/aws/plugins/modules/elb_target_group.py", line 989, in <module>
  File "/tmp/ansible_community.aws.elb_target_group_payload_y5gefe7e/ansible_community.aws.elb_target_group_payload.zip/ansible_collections/community/aws/plugins/modules/elb_target_group.py", line 983, in main
  File "/tmp/ansible_community.aws.elb_target_group_payload_y5gefe7e/ansible_community.aws.elb_target_group_payload.zip/ansible_collections/community/aws/plugins/modules/elb_target_group.py", line 685, in create_or_update_target_group
KeyError: 'ProtocolVersion'
fatal: [localhost]: FAILED! => {
    "attempts": 10,
    "changed": false,
    "module_stderr": "Traceback (most recent call last):\n  File \"/home/myuser/.ansible/tmp/ansible-tmp-1683068584.628099-3322568-261537723315094/AnsiballZ_elb_target_group.py\", line 107, in <module>\n    _ansiballz_main()\n  File \"/home/myuser/.ansible/tmp/ansible-tmp-1683068584.628099-3322568-261537723315094/AnsiballZ_elb_target_group.py\", line 99, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/home/myuser/.ansible/tmp/ansible-tmp-1683068584.628099-3322568-261537723315094/AnsiballZ_elb_target_group.py\", line 47, in invoke_module\n    runpy.run_module(mod_name='ansible_collections.community.aws.plugins.modules.elb_target_group', init_globals=dict(_module_fqn='ansible_collections.community.aws.plugins.modules.elb_target_group', _modlib_path=modlib_path),\n  File \"/usr/lib64/python3.9/runpy.py\", line 225, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib64/python3.9/runpy.py\", line 97, in _run_module_code\n    _run_code(code, mod_globals, init_globals,\n  File \"/usr/lib64/python3.9/runpy.py\", line 87, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_community.aws.elb_target_group_payload_y5gefe7e/ansible_community.aws.elb_target_group_payload.zip/ansible_collections/community/aws/plugins/modules/elb_target_group.py\", line 989, in <module>\n  File \"/tmp/ansible_community.aws.elb_target_group_payload_y5gefe7e/ansible_community.aws.elb_target_group_payload.zip/ansible_collections/community/aws/plugins/modules/elb_target_group.py\", line 983, in main\n  File \"/tmp/ansible_community.aws.elb_target_group_payload_y5gefe7e/ansible_community.aws.elb_target_group_payload.zip/ansible_collections/community/aws/plugins/modules/elb_target_group.py\", line 685, in create_or_update_target_group\nKeyError: 'ProtocolVersion'\n",
    "module_stdout": "",
    "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error",
    "rc": 1
}


ProtocolVersion is not returned a valid attribute from the resource using TCP Protocol

$ aws elbv2  describe-target-groups --target-group-arns arn:aws:elasticloadbalancing:us-east-1:[redacted:AWS_ACCOUNT_ID]:targetgroup/okipr3601-lfmwl-aext/513dc1925ba2791f
{
    "TargetGroups": [
        {
            "TargetGroupArn": "arn:aws:elasticloadbalancing:us-east-1:[redacted:AWS_ACCOUNT_ID]:targetgroup/okipr3601-lfmwl-aext/513dc1925ba2791f",
            "TargetGroupName": "okipr3601-lfmwl-aext",
            "Protocol": "TCP",
            "Port": 6443,
            "VpcId": "vpc-0eef74291b5613c03",
            "HealthCheckProtocol": "HTTPS",
            "HealthCheckPort": "6443",
            "HealthCheckEnabled": true,
            "HealthCheckIntervalSeconds": 10,
            "HealthCheckTimeoutSeconds": 10,
            "HealthyThresholdCount": 2,
            "UnhealthyThresholdCount": 2,
            "HealthCheckPath": "/readyz",
            "Matcher": {
                "HttpCode": "200-399"
            },
            "LoadBalancerArns": [
                "arn:aws:elasticloadbalancing:us-east-1:[redacted:AWS_ACCOUNT_ID]:loadbalancer/net/okipr3601-lfmwl-ext/93bc672ccecb2bd7"
            ],
            "TargetType": "ip",
            "IpAddressType": "ipv4"
        }
    ]
}



Versions

$ ansible-galaxy collection list
Collection           Version     
-------------------- ------------
amazon.aws           5.4.0       
community.aws        5.4.0       

$ python -V
Python 3.9.13

 ansible --version
ansible [core 2.14.5]
  config file = /home/ansible.cfg
  configured module search path = ['/home/myuser/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/myuser/.venvs/vpy3.9/lib64/python3.9/site-packages/ansible
  ansible collection location = /home/collections
  executable location = /home/myuser/.venvs/vpy3.9/bin/ansible
  python version = 3.9.13 (main, Nov  9 2022, 13:16:24) [GCC 8.5.0 20210514 (Red Hat 8.5.0-15)] (/home/myuser/.venvs/vpy3.9/bin/python3.9)
  jinja version = 3.1.2
  libyaml = True

 $ pip freeze |grep boto
boto3==1.26.125
botocore==1.29.125

*ProtocolVersion is not Required, according to the API definition: https://docs.aws.amazon.com/elasticloadbalancing/latest/APIReference/API_TargetGroup.html
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME

elb_target_group

ADDITIONAL INFORMATION
@mtulio mtulio deleted the fix-elbv2-tg branch May 22, 2023 01:04
@mtulio
Copy link
Contributor Author

mtulio commented May 22, 2023

@tremble @alinabuzachis I wonder if this bug is a candidate for fixes on Z-stream of 5.3, what is the release cadence?

@mtulio
Copy link
Contributor Author

mtulio commented May 22, 2023

@tremble @alinabuzachis I wonder if this bug is a candidate for fixes on Z-stream of 5.3, what is the release cadence?

NVM, I managed to use tag 5.5 - I was looking only for the Release page! 🙅🏽

Thanks!

abikouo pushed a commit to abikouo/community.aws that referenced this pull request Oct 24, 2023
…s#1800)

s3_object - remove docs for create/delete bucket.

SUMMARY
We dropped support for creating/deleting buckets through s3_object.
ISSUE TYPE

Docs Pull Request

COMPONENT NAME
s3_object
ADDITIONAL INFORMATION

Reviewed-by: Alina Buzachis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-5 PR should be backported to the stable-5 branch mergeit Merge the PR (SoftwareFactory)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants