Uploaded image for project: 'Ansible Cloud Automation'
  1. Ansible Cloud Automation
  2. ACA-343

[amazon.aws/472] amazon.aws.aws_secret lookup with bypath=true returns only upto 10 values

XMLWordPrintable

    • ACA Sprint 21, ACA Sprint 22, ACA Sprint 23, ACA Sprint 24

      https://github.com/ansible-collections/amazon.aws/issues/472

          1. Summary

      I found an issue when using ansible lookup plugin. In my ansible playbook ( Ansible 2.10) I'm using lookup plugin to get all secrets from AWS Secrets Manager with the bypath attribute.

      ```
      vars:
      #which environment: dev, test,uat, prd
      my_env: dev
      aws_secret_path: mypath/my_env

      name: "get all secrets from AWS Secrets Manager"
      set_fact: secret_value: "{{ lookup('amazon.aws.aws_secret', 'aws_secret_path', on_missing='skip', bypath='true', region='eu-west-1' )}}"
      ```

      It is working fine however I realized that it returns only up to 10 elements.
      Is there a way to return all elements or use pagination ? Have you faced similar issue with lookup plugin ?

          1. Issue Type

      Bug Report

          1. Component Name

      amazon.aws.aws_secret

          1. Ansible Version

      ```
      ansible --version
      ansible 2.10.2
      config file = /etc/ansible/ansible.cfg
      configured module search path = ['/var/lib/awx/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
      ansible python module location = /venv/awx-venv/lib64/python3.6/site-packages/ansible
      executable location = /venv/awx-venv/bin/ansible
      python version = 3.6.8 (default, Apr 16 2020, 01:36:27) [GCC 8.3.1 20191121 (Red Hat 8.3.1-5)]
      ```

          1. Collection Versions

      ```
      Collection Version
      ----------------- -------
      amazon.aws 1.5.0
      community.aws 1.4.0
      community.general 2.3.0
      ```

          1. AWS SDK versions

      ```
      (awx-venv) bash-4.4$ pip show boto boto3 botocore
      Name: boto
      Version: 2.49.0
      Summary: Amazon Web Services Library
      Home-page: https://github.com/boto/boto/
      Author: Mitch Garnaat
      Author-email: mitch@garnaat.com
      License: MIT
      Location: /venv/awx-venv/lib/python3.6/site-packages
      Requires:
      Required-by:

      Name: boto3
      Version: 1.17.46
      Summary: The AWS SDK for Python
      Home-page: https://github.com/boto/boto3
      Author: Amazon Web Services
      Author-email: None
      License: Apache License 2.0
      Location: /venv/awx-venv/lib/python3.6/site-packages
      Requires: botocore, jmespath, s3transfer
      Required-by:

      Name: botocore
      Version: 1.20.46
      Summary: Low-level, data-driven core of boto 3.
      Home-page: https://github.com/boto/botocore
      Author: Amazon Web Services
      Author-email: None
      License: Apache License 2.0
      Location: /venv/awx-venv/lib/python3.6/site-packages
      Requires: python-dateutil, jmespath, urllib3
      Required-by: s3transfer, boto3
      ```

          1. Configuration

      ```
      $ ansible-config dump --only-changed

      ```

          1. OS / Environment

      No response

          1. Steps to Reproduce

      <!--- Paste example playbooks or commands between quotes below -->
      ```yaml (paste below)
      vars:
      #which environment: dev, test,uat, prd
      my_env: dev
      aws_secret_path: mypath/my_env

      name: "get all secrets from AWS Secrets Manager"
      set_fact: secret_value: "{{ lookup('amazon.aws.aws_secret', 'aws_secret_path', on_missing='skip', bypath='true', region='eu-west-1' )}}"
      ```

          1. Expected Results

      Lookup plugin should return all secrets from AWS Secret Manager

          1. Actual Results

      ```console (paste below)
      It returns only up tp 10 results
      ```

          1. Code of Conduct
      • [X] I agree to follow the Ansible Code of Conduct

            mandkulk@redhat.com Mandar Kulkarni
            jrouleau Jill Rouleau
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: