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

dynamodb_table: AnsibleAwsModule, billing_mode, point_in_time_recovery #68320

Closed
wants to merge 9 commits into from

Conversation

anryko
Copy link
Contributor

@anryko anryko commented Mar 19, 2020

SUMMARY

Fix AnsibleAwsModule migration stale PR (#45402). Add billing_mode and point_in_time_recovery. Small bug fixes. Integration tests fixes.

Fixes #45402
Fixes #56923

ISSUE TYPE
  • Bugfix Pull Request
  • Feature Pull Request
COMPONENT NAME
  • dynamodb_table
ADDITIONAL INFORMATION
    - name: enable on-demand billing and backups
      dynamodb_table:
        name: table_name
        hash_key_name: myhashkey
        billing_mode: PAY_PER_REQUEST
        point_in_time_recovery: yes

@ansibot
Copy link
Contributor

ansibot commented Mar 19, 2020

@ansibot
Copy link
Contributor

ansibot commented Mar 19, 2020

@anryko, just so you are aware we have a dedicated Working Group for aws.
You can find other people interested in this in #ansible-aws on Freenode IRC
For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help

@ansibot ansibot added affects_2.10 This issue/PR affects Ansible v2.10 aws bug This issue/PR relates to a bug. cloud core_review In order to be merged, this PR must follow the core review workflow. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Mar 19, 2020
@ansibot
Copy link
Contributor

ansibot commented Mar 19, 2020

The test ansible-test sanity --test validate-modules [explain] failed with 10 errors:

lib/ansible/modules/cloud/amazon/dynamodb_table.py:0:0: doc-default-does-not-match-spec: Argument 'billing_mode' in argument_spec defines default as (None) but documentation defines default as ('PROVISIONED')
lib/ansible/modules/cloud/amazon/dynamodb_table.py:0:0: option-incorrect-version-added: version_added for new option (sse_enabled) should be '2.10'. Currently StrictVersion ('2.8')
lib/ansible/modules/cloud/amazon/dynamodb_table.py:0:0: option-incorrect-version-added: version_added for new option (sse_kms_master_key_id) should be '2.10'. Currently StrictVersion ('2.8')
lib/ansible/modules/cloud/amazon/dynamodb_table.py:0:0: option-incorrect-version-added: version_added for new option (sse_type) should be '2.10'. Currently StrictVersion ('2.8')
lib/ansible/modules/cloud/amazon/dynamodb_table.py:0:0: option-incorrect-version-added: version_added for new option (stream_enabled) should be '2.10'. Currently StrictVersion ('2.8')
lib/ansible/modules/cloud/amazon/dynamodb_table.py:0:0: option-incorrect-version-added: version_added for new option (stream_view_type) should be '2.10'. Currently StrictVersion ('2.8')
lib/ansible/modules/cloud/amazon/dynamodb_table.py:0:0: parameter-type-not-in-doc: Argument 'sse_kms_master_key_id' in argument_spec defines type as 'str' but documentation doesn't define type
lib/ansible/modules/cloud/amazon/dynamodb_table.py:0:0: parameter-type-not-in-doc: Argument 'sse_type' in argument_spec defines type as 'str' but documentation doesn't define type
lib/ansible/modules/cloud/amazon/dynamodb_table.py:0:0: parameter-type-not-in-doc: Argument 'stream_view_type' in argument_spec defines type as 'str' but documentation doesn't define type
lib/ansible/modules/cloud/amazon/dynamodb_table.py:0:0: required_if-key-in-requirements: required_if contains its key sse_type in requirements

The test ansible-test sanity --test pylint [explain] failed with 3 errors:

lib/ansible/modules/cloud/amazon/dynamodb_table.py:248:4: ansible-bad-module-import: Import external package or ansible.module_utils not ansible.utils.vars
lib/ansible/modules/cloud/amazon/dynamodb_table.py:295:31: ansible-format-automatic-specification: Format string contains automatic field numbering specification
lib/ansible/modules/cloud/amazon/dynamodb_table.py:305:8: ansible-format-automatic-specification: Format string contains automatic field numbering specification

The test ansible-test sanity --test compile --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/dynamodb_table.py:330:11: SyntaxError: for key, value in merge_hash(tags, table_tags).items()

The test ansible-test sanity --test future-import-boilerplate [explain] failed with 1 error:

test/units/modules/cloud/amazon/test_dynamodb_table.py:0:0: missing: from __future__ import (absolute_import, division, print_function)

The test ansible-test sanity --test import --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/dynamodb_table.py:330:11: traceback: SyntaxError: invalid syntax

The test ansible-test sanity --test metaclass-boilerplate [explain] failed with 1 error:

test/units/modules/cloud/amazon/test_dynamodb_table.py:0:0: missing: __metaclass__ = type

click here for bot help

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. core_review In order to be merged, this PR must follow the core review workflow. and removed core_review In order to be merged, this PR must follow the core review workflow. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Mar 19, 2020
@ansibot
Copy link
Contributor

ansibot commented Mar 23, 2020

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/dynamodb_table.py:0:0: doc-default-does-not-match-spec: Argument 'billing_mode' in argument_spec defines default as (None) but documentation defines default as ('PROVISIONED')

The test ansible-test sanity --test future-import-boilerplate [explain] failed with 1 error:

test/units/modules/cloud/amazon/test_dynamodb_table.py:0:0: missing: from __future__ import (absolute_import, division, print_function)

The test ansible-test sanity --test metaclass-boilerplate [explain] failed with 1 error:

test/units/modules/cloud/amazon/test_dynamodb_table.py:0:0: missing: __metaclass__ = type

click here for bot help

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed core_review In order to be merged, this PR must follow the core review workflow. labels Mar 23, 2020
@ansibot ansibot added the needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html label Mar 23, 2020
@ansibot ansibot removed the needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html label Mar 23, 2020
@ansibot
Copy link
Contributor

ansibot commented Mar 23, 2020

The test ansible-test sanity --test ansible-doc [explain] failed with the error:

Output on stderr from ansible-doc is considered an error.

Command "ansible-doc -t module dynamodb_table" returned exit status 0.
>>> Standard Error
[WARNING]: module dynamodb_table not found in:
/dev/null:/root/ansible/lib/ansible/modules

The test ansible-test sanity --test docs-build [explain] failed with the error:

Command "/usr/bin/python3.6 /root/ansible/test/sanity/code-smell/docs-build.py" returned exit status 1.
>>> Standard Error
Command 'make singlehtmldocs' failed with status code: 2
--> Standard Output
PYTHONPATH=../../lib ../../hacking/build-ansible.py collection-meta --template-file=../templates/collections_galaxy_meta.rst.j2 --output-dir=rst/dev_guide/ ../../lib/ansible/galaxy/data/collections_galaxy_meta.yml
PYTHONPATH=../../lib ../../hacking/build-ansible.py document-config --template-file=../templates/config.rst.j2 --output-dir=rst/reference_appendices/ ../../lib/ansible/config/base.yml
mkdir -p rst/cli
PYTHONPATH=../../lib ../../hacking/build-ansible.py generate-man --template-file=../templates/cli_rst.j2 --output-dir=rst/cli/ --output-format rst ../../lib/ansible/cli/*.py
PYTHONPATH=../../lib ../../hacking/build-ansible.py document-keywords --template-dir=../templates --output-dir=rst/reference_appendices/ ./keyword_desc.yml
PYTHONPATH=../../lib ../../hacking/build-ansible.py document-plugins -t rst --template-dir=../templates --module-dir=../../lib/ansible/modules -o rst/modules/ 
Evaluating module files...
Makefile:99: recipe for target 'modules' failed
--> Standard Error
Traceback (most recent call last):
  File "../../hacking/build-ansible.py", line 92, in <module>
    main()
  File "../../hacking/build-ansible.py", line 81, in main
    retval = command.main(args)
  File "/root/ansible/hacking/build_library/build_ansible/command_plugins/plugin_formatter.py", line 747, in main
    plugin_info, categories = get_plugin_info(args.module_dir, limit_to=args.limit_to, verbose=(args.verbosity > 0))
  File "/root/ansible/hacking/build_library/build_ansible/command_plugins/plugin_formatter.py", line 225, in get_plugin_info
    doc, examples, returndocs, metadata = plugin_docs.get_docstring(module_path, fragment_loader, verbose=verbose)
  File "/root/ansible/lib/ansible/utils/plugin_docs.py", line 128, in get_docstring
    add_fragments(data['doc'], filename, fragment_loader=fragment_loader)
  File "/root/ansible/lib/ansible/utils/plugin_docs.py", line 116, in add_fragments
    raise AnsibleError('unknown doc_fragment(s) in file {0}: {1}'.format(filename, to_native(', '.join(unknown_fragments))))
ansible.errors.AnsibleError: unknown doc_fragment(s) in file ../../lib/ansible/modules/cloud/amazon/dynamodb_table.py: aws, ec2
make: *** [modules] Error 1

The test ansible-test sanity --test package-data [explain] failed with 2 errors:

lib/ansible/modules/cloud/amazon/dynamodb_table.py:0:0: File not installed
lib/ansible/modules/cloud/amazon/dynamodb_table.py:0:0: File was not added to sdist

The test ansible-test sanity --test import --python 2.6 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/dynamodb_table.py:0:0: traceback: ImportWarning: Not importing directory '/root/ansible/lib/ansible/modules/cloud': missing __init__.py

The test ansible-test sanity --test import --python 2.7 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/dynamodb_table.py:0:0: traceback: ImportWarning: Not importing directory '/root/ansible/lib/ansible/modules/cloud': missing __init__.py

The test ansible-test sanity --test import --python 3.5 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/dynamodb_table.py:282:0: traceback: NameError: name 'AWSRetry' is not defined

The test ansible-test sanity --test import --python 3.6 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/dynamodb_table.py:282:0: traceback: NameError: name 'AWSRetry' is not defined

The test ansible-test sanity --test import --python 3.7 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/dynamodb_table.py:282:0: traceback: NameError: name 'AWSRetry' is not defined

The test ansible-test sanity --test import --python 3.8 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/dynamodb_table.py:282:0: traceback: NameError: name 'AWSRetry' is not defined

The test ansible-test sanity --test import --python 3.9 [explain] failed with 1 error:

lib/ansible/modules/cloud/amazon/dynamodb_table.py:282:0: traceback: NameError: name 'AWSRetry' is not defined

The test ansible-test sanity --test integration-aliases [explain] failed with 1 error:

test/integration/targets/dynamodb_table/aliases:0:0: missing alias `shippable/cloud/group1` or `unsupported`

click here for bot help

@bcoca bcoca removed the needs_triage Needs a first human triage before being processed. label Mar 26, 2020
@ansibot ansibot added the needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html label Mar 26, 2020
@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Apr 3, 2020
@ansibot ansibot added collection Related to Ansible Collections work collection:community.aws labels Apr 24, 2020
@marknet15
Copy link

Hi @anryko I'm not sure if you are still currently working on this PR but I have created the following based on your changes, if you wouldn't mind taking a look at ? it provides some fixes on top of your changes based on usage of your updated module internally.
anryko#1

@tremble
Copy link
Contributor

tremble commented May 4, 2020

Hi @marknet15 thanks for taking the time to try and move this forward.

Unfortunately the AWS modules have been moved from the main Ansible repository. There are now two repos which include AWS modules

dynamodb_table can now be found in the 'community' repo: https://github.com/ansible-collections/community.aws/blob/master/plugins/modules/dynamodb_table.py

Additionally the IAM policies used for testing have been moved into https://github.com/mattclay/aws-terminator/tree/master/hacking (the repo will probably get renamed at some point)

If you migrate the PR over to the new repo feel free to CC me and I'll have a first pass at reviewing it.

@marknet15
Copy link

Hi @tremble, no problem at all and thanks for your response and extra information, much appreciated! I will look at getting the ball rolling and re-create the PR as requested.

@Akasurde
Copy link
Member

Closing in favor of ansible-collections/community.aws#65

@Akasurde Akasurde closed this Aug 20, 2020
@Akasurde
Copy link
Member

@anryko Thanks for the contribution.

@ansible ansible locked and limited conversation to collaborators Sep 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.10 This issue/PR affects Ansible v2.10 aws bug This issue/PR relates to a bug. cloud collection:community.aws collection Related to Ansible Collections work module This issue/PR relates to a module. needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. support:community This issue/PR relates to code supported by the Ansible community. support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dynamodb_table support for On-Demand billing
7 participants