Skip to content

Commit 9b3cd79

Browse files
committed
Update
Signed-off-by: Alina Buzachis <abuzachis@redhat.com>
1 parent 8d10302 commit 9b3cd79

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

roles/module_openapi_cloud/templates/module_directory/amazon_cloud/default_module.j2

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% include 'header.j2' %}
22

33

4-
from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAWSModule
4+
from ansible_collections.amazon.cloud.plugins.module_utils.core import AnsibleAmazonCloudModule
55
from ansible_collections.amazon.cloud.plugins.module_utils.core import CloudControlResource
66
from ansible_collections.amazon.cloud.plugins.module_utils.core import ansible_dict_to_boto3_tag_list
77
from ansible_collections.amazon.cloud.plugins.module_utils.core import scrub_none_parameters
@@ -23,14 +23,22 @@ def main():
2323
{{ mutually_exclusive|join(",") }}
2424
]
2525

26-
module = AnsibleAWSModule(argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, supports_check_mode=True)
26+
module = AnsibleAmazonCloudModule(argument_spec=argument_spec, required_if=required_if, mutually_exclusive=mutually_exclusive, supports_check_mode=True)
2727
cloud = CloudControlResource(module)
2828

2929
{% set type_name=resource_type %}
3030
type_name = {{ type_name }}
3131

3232
params = {}
3333
{{params}}
34+
35+
{% if 'AWS::RDS::DBInstance' in type_name %}
36+
if module.params.get("engine") not in ("aurora", "aurora-postgresql", "aurora-mysql"):
37+
# It can only be used when engine is one of ("aurora", "aurora-postgresql", "aurora-mysql").
38+
# Since the CloudFormation template assigns 'default: 1', it is always set to 1.
39+
params.pop("promotion_tier")
40+
{% endif %}
41+
3442
# The DesiredState we pass to AWS must be a JSONArray of non-null values
3543
_params_to_set = scrub_none_parameters(params)
3644

@@ -54,13 +62,6 @@ def main():
5462
{{ ensure_all_identifiers_defined }}
5563
results = {"changed": False, "result": {}}
5664

57-
{% if 'AWS::RDS::DBInstance' in type_name %}
58-
if module.params.get("engine") not in ("aurora", "aurora-postgresql", "aurora-mysql"):
59-
# It can only be used when engine is one of ("aurora", "aurora-postgresql", "aurora-mysql").
60-
# Since the CloudFormation template assigns 'default: 1', it is always set to 1.
61-
params.pop("promotion_tier")
62-
{% endif %}
63-
6465
if state == "list":
6566
if "list" not in handlers:
6667
module.exit_json(**results, msg=f"Resource type {type_name} cannot be listed.")

0 commit comments

Comments
 (0)