Skip to content

Commit

Permalink
Make deprecated updates in dynamodbo_table module fail (ansible-colle…
Browse files Browse the repository at this point in the history
…ctions#837)

Make deprecated updates in dynamodbo_table module fail

SUMMARY
Make deprecated primary key updates and all type index includes update fail in dynamodb_table module for 3.0.0
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
dynamodb_table
ADDITIONAL INFORMATION
Both parts were previously deprecated and are currently ignored, this PR actually makes those ignore updates fail on attempts to pass the bad config.

Reviewed-by: Markus Bergholz <[email protected]>
Reviewed-by: Alina Buzachis <None>
Reviewed-by: None <None>
  • Loading branch information
marknet15 authored and abikouo committed Sep 18, 2023
1 parent ecf2d4a commit 4413bc6
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions dynamodb_table.py
Original file line number Diff line number Diff line change
Expand Up @@ -678,12 +678,9 @@ def _generate_index(index, include_throughput=True):
projection['NonKeyAttributes'] = non_key_attributes
else:
if non_key_attributes:
module.deprecate(
module.fail_json(
"DynamoDB does not support specifying non-key-attributes ('includes') for "
"indexes of type 'all'. Attempts to set this attributes are currently "
"ignored, but in future will result in a failure. "
"Index name: {0}".format(index['name']),
version='3.0.0', collection_name='community.aws')
"indexes of type 'all'. Index name: {0}".format(index['name']))

idx = dict(
IndexName=index['name'],
Expand Down Expand Up @@ -857,11 +854,7 @@ def _update_tags(current_table):
def update_table(current_table):
primary_index_changes = _primary_index_changes(current_table)
if primary_index_changes:
module.deprecate("DynamoDB does not support updating the Primary keys on a table. "
"Attempts to change the keys are currently ignored, but in future will "
"result in a failure. "
"Changed paramters are {0}".format(primary_index_changes),
version='3.0.0', collection_name='community.aws')
module.fail_json("DynamoDB does not support updating the Primary keys on a table. Changed paramters are: {0}".format(primary_index_changes))

changed = False
changed |= _update_table(current_table)
Expand Down

0 comments on commit 4413bc6

Please sign in to comment.