Skip to content

Commit

Permalink
Merge pull request ansible-collections#553 from ichekaldin/aws_config…
Browse files Browse the repository at this point in the history
…_aggregator/fix_organization_source

Fix KeyError in aws_config_aggregator module

Reviewed-by: Ansibullbot manages ticket workflow
             https://github.com/ansibullbot
  • Loading branch information
ansible-zuul[bot] committed Apr 25, 2021
2 parents 2ee7d6f + 09dfde7 commit 1df617a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
minor_changes:
- aws_config_aggregator - Fix typos in attribute names (https://github.com/ansible-collections/community.aws/pull/553).
8 changes: 4 additions & 4 deletions plugins/modules/aws_config_aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
def resource_exists(client, module, params):
try:
aggregator = client.describe_configuration_aggregators(
ConfigurationAggregatorNames=[params['name']]
ConfigurationAggregatorNames=[params['ConfigurationAggregatorName']]
)
return aggregator['ConfigurationAggregators'][0]
except is_boto3_error_code('NoSuchConfigurationAggregatorException'):
Expand All @@ -128,7 +128,7 @@ def create_resource(client, module, params, result):

def update_resource(client, module, params, result):
current_params = client.describe_configuration_aggregators(
ConfigurationAggregatorNames=[params['name']]
ConfigurationAggregatorNames=[params['ConfigurationAggregatorName']]
)

del current_params['ConfigurationAggregatorArn']
Expand Down Expand Up @@ -181,8 +181,8 @@ def main():
params = {}
if name:
params['ConfigurationAggregatorName'] = name
params['AccountAggregationSources'] = []
if module.params.get('account_sources'):
params['AccountAggregationSources'] = []
for i in module.params.get('account_sources'):
tmp_dict = {}
if i.get('account_ids'):
Expand All @@ -203,7 +203,7 @@ def main():
'AwsRegions': module.params.get('organization_source').get('aws_regions')
})
if module.params.get('organization_source').get('all_aws_regions') is not None:
params['OrganizationAggregationSourcep'].update({
params['OrganizationAggregationSource'].update({
'AllAwsRegions': module.params.get('organization_source').get('all_aws_regions')
})

Expand Down

0 comments on commit 1df617a

Please sign in to comment.