forked from ansible-collections/community.aws
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
aws_glue_connection: Add multiple connection types, add check mode (a…
…nsible-collections#503) * Add multiple connection types and support for check mode Examples: ``` - community.aws.aws_glue_connection: name: My connection availability_zone: us-east-1a connection_properties: JDBC_ENFORCE_SSL: "false" connection_type: NETWORK description: My test connection security_groups: - test subnet_id: subnet-123abc state: present ``` * Add retries. * Add description of how to create a Glue network connection Co-authored-by: Mark Chappell <[email protected]>
- Loading branch information
1 parent
03c305a
commit eb1a31c
Showing
5 changed files
with
483 additions
and
97 deletions.
There are no files selected for viewing
3 changes: 3 additions & 0 deletions
3
changelogs/fragments/503-aws_glue_connection-types-check-mode.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
minor_changes: | ||
- aws_glue_connection - Added multple connection types (https://github.com/ansible-collections/community.aws/pull/503). | ||
- aws_glue_connection - Added support for check mode (https://github.com/ansible-collections/community.aws/pull/503). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
83 changes: 7 additions & 76 deletions
83
tests/integration/targets/aws_glue_connection/tasks/main.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,82 +1,13 @@ | ||
--- | ||
- name: 'aws_glue_connection integration tests' | ||
- name: aws_glue_connection integration tests | ||
collections: | ||
- amazon.aws | ||
module_defaults: | ||
group/aws: | ||
aws_access_key: '{{ aws_access_key }}' | ||
aws_secret_key: '{{ aws_secret_key }}' | ||
security_token: '{{ security_token | default(omit) }}' | ||
region: '{{ aws_region }}' | ||
aws_access_key: "{{ aws_access_key }}" | ||
aws_secret_key: "{{ aws_secret_key }}" | ||
security_token: "{{ security_token | default(omit) }}" | ||
region: "{{ aws_region }}" | ||
block: | ||
|
||
# TODO: description, match_criteria, security_groups, and subnet_id are unused module options | ||
|
||
- name: create glue connection | ||
aws_glue_connection: | ||
name: "{{ resource_prefix }}" | ||
connection_properties: | ||
JDBC_CONNECTION_URL: "jdbc:mysql://mydb:3306/{{ resource_prefix }}" | ||
USERNAME: my-username | ||
PASSWORD: my-password | ||
state: present | ||
register: result | ||
|
||
- assert: | ||
that: | ||
- result.changed | ||
|
||
- name: test idempotence creating glue connection | ||
aws_glue_connection: | ||
name: "{{ resource_prefix }}" | ||
connection_properties: | ||
JDBC_CONNECTION_URL: "jdbc:mysql://mydb:3306/{{ resource_prefix }}" | ||
USERNAME: my-username | ||
PASSWORD: my-password | ||
state: present | ||
register: result | ||
|
||
- assert: | ||
that: | ||
- not result.changed | ||
|
||
- name: test updating JDBC connection url | ||
aws_glue_connection: | ||
name: "{{ resource_prefix }}" | ||
connection_properties: | ||
JDBC_CONNECTION_URL: "jdbc:mysql://mydb:3306/{{ resource_prefix }}-updated" | ||
USERNAME: my-username | ||
PASSWORD: my-password | ||
state: present | ||
register: result | ||
|
||
- assert: | ||
that: | ||
- result.changed | ||
|
||
- name: delete glue connection | ||
aws_glue_connection: | ||
name: "{{ resource_prefix }}" | ||
state: absent | ||
register: result | ||
|
||
- assert: | ||
that: | ||
- result.changed | ||
|
||
- name: test idempotence removing glue connection | ||
aws_glue_connection: | ||
name: "{{ resource_prefix }}" | ||
state: absent | ||
register: result | ||
|
||
- assert: | ||
that: | ||
- not result.changed | ||
|
||
always: | ||
|
||
- name: delete glue connection | ||
aws_glue_connection: | ||
name: "{{ resource_prefix }}" | ||
state: absent | ||
- include_tasks: test_connection_network.yml | ||
- include_tasks: test_connection_jdbc.yml |
74 changes: 74 additions & 0 deletions
74
tests/integration/targets/aws_glue_connection/tasks/test_connection_jdbc.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
--- | ||
- name: 'aws_glue_connection integration tests (JDBC)' | ||
block: | ||
|
||
# TODO: description, match_criteria, security_groups, and subnet_id are unused module options | ||
|
||
- name: create glue connection | ||
aws_glue_connection: | ||
name: "{{ resource_prefix }}" | ||
connection_properties: | ||
JDBC_CONNECTION_URL: "jdbc:mysql://mydb:3306/{{ resource_prefix }}" | ||
USERNAME: my-username | ||
PASSWORD: my-password | ||
state: present | ||
register: result | ||
|
||
- assert: | ||
that: | ||
- result.changed | ||
|
||
- name: test idempotence creating glue connection | ||
aws_glue_connection: | ||
name: "{{ resource_prefix }}" | ||
connection_properties: | ||
JDBC_CONNECTION_URL: "jdbc:mysql://mydb:3306/{{ resource_prefix }}" | ||
USERNAME: my-username | ||
PASSWORD: my-password | ||
state: present | ||
register: result | ||
|
||
- assert: | ||
that: | ||
- not result.changed | ||
|
||
- name: test updating JDBC connection url | ||
aws_glue_connection: | ||
name: "{{ resource_prefix }}" | ||
connection_properties: | ||
JDBC_CONNECTION_URL: "jdbc:mysql://mydb:3306/{{ resource_prefix }}-updated" | ||
USERNAME: my-username | ||
PASSWORD: my-password | ||
state: present | ||
register: result | ||
|
||
- assert: | ||
that: | ||
- result.changed | ||
|
||
- name: delete glue connection | ||
aws_glue_connection: | ||
name: "{{ resource_prefix }}" | ||
state: absent | ||
register: result | ||
|
||
- assert: | ||
that: | ||
- result.changed | ||
|
||
- name: test idempotence removing glue connection | ||
aws_glue_connection: | ||
name: "{{ resource_prefix }}" | ||
state: absent | ||
register: result | ||
|
||
- assert: | ||
that: | ||
- not result.changed | ||
|
||
always: | ||
|
||
- name: delete glue connection | ||
aws_glue_connection: | ||
name: "{{ resource_prefix }}" | ||
state: absent |
Oops, something went wrong.