Skip to content

Commit

Permalink
update meta/runtime.yml, modules and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
abikouo committed Oct 15, 2024
1 parent dd35176 commit 4495c26
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
1 change: 1 addition & 0 deletions meta/runtime.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ action_groups:
- ec2_vol_info
- ec2_vpc_dhcp_option
- ec2_vpc_dhcp_option_info
- ec2_vpc_egress_igw
- ec2_vpc_egress_igw_info
- ec2_vpc_endpoint
- ec2_vpc_endpoint_info
Expand Down
7 changes: 4 additions & 3 deletions plugins/modules/ec2_vpc_egress_igw.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
---
module: ec2_vpc_egress_igw
version_added: 1.0.0
version_added_collection: community.aws
short_description: Manage an AWS VPC Egress Only Internet gateway
description:
- Manage an AWS VPC Egress Only Internet gateway
Expand Down Expand Up @@ -40,12 +41,12 @@
# Ensure that the VPC has an Internet Gateway.
# The Internet Gateway ID is can be accessed via {{eigw.gateway_id}} for use in setting up NATs etc.
- name: Create Egress internet only gateway
community.aws.ec2_vpc_egress_igw:
amazon.aws.ec2_vpc_egress_igw:
vpc_id: vpc-abcdefgh
state: present
- name: Delete Egress internet only gateway
community.aws.ec2_vpc_egress_igw:
amazon.aws.ec2_vpc_egress_igw:
vpc_id: vpc-abcdefgh
state: absent
"""
Expand Down Expand Up @@ -81,7 +82,7 @@
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ensure_ec2_tags
from ansible_collections.amazon.aws.plugins.module_utils.tagging import boto3_tag_list_to_ansible_dict

from ansible_collections.community.aws.plugins.module_utils.modules import AnsibleCommunityAWSModule as AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.modules import AnsibleAWSModule


def delete_eigw(module: AnsibleAWSModule, connection, eigw_id: str) -> Dict[str, Union[str, bool]]:
Expand Down
20 changes: 10 additions & 10 deletions tests/integration/targets/ec2_vpc_egress_igw/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

# ============================================================
- name: Test failure with no parameters
community.aws.ec2_vpc_egress_igw:
amazon.aws.ec2_vpc_egress_igw:
register: result
ignore_errors: true

Expand All @@ -22,7 +22,7 @@

# ============================================================
- name: Test failure with non-existent VPC ID
community.aws.ec2_vpc_egress_igw:
amazon.aws.ec2_vpc_egress_igw:
state: present
vpc_id: vpc-02394e50abc1807e8
register: result
Expand All @@ -49,7 +49,7 @@

# ============================================================
- name: Create egress-only internet gateway using check_mode=true
community.aws.ec2_vpc_egress_igw:
amazon.aws.ec2_vpc_egress_igw:
state: present
vpc_id: "{{ vpc_result.vpc.id }}"
register: vpc_eigw_create_check_mode
Expand All @@ -62,7 +62,7 @@

# # ============================================================
- name: Create egress-only internet gateway (expected changed=true)
community.aws.ec2_vpc_egress_igw:
amazon.aws.ec2_vpc_egress_igw:
state: present
vpc_id: "{{ vpc_result.vpc.id }}"
register: vpc_eigw_create
Expand All @@ -74,7 +74,7 @@

# # ============================================================
- name: Create egress-only internet gateway once again (idempotency)
community.aws.ec2_vpc_egress_igw:
amazon.aws.ec2_vpc_egress_igw:
state: present
vpc_id: "{{ vpc_result.vpc.id }}"
register: vpc_eigw_create_idempotency
Expand All @@ -101,7 +101,7 @@

# # ============================================================
- name: Delete egress-only internet gateway once again (idempotency)
community.aws.ec2_vpc_egress_igw:
amazon.aws.ec2_vpc_egress_igw:
state: absent
vpc_id: "{{ vpc_result.vpc.id }}"
register: vpc_eigw_delete
Expand All @@ -127,7 +127,7 @@
## ============================================================
## Tagging
- name: Create Egress only internet gateway with tags
community.aws.ec2_vpc_egress_igw:
amazon.aws.ec2_vpc_egress_igw:
vpc_id: "{{ vpc_result.vpc.id }}"
tags:
ResourcePrefix: "{{ resource_prefix }}"
Expand All @@ -140,7 +140,7 @@
- create_with_tags is changed

- name: Trying to update tags (no change)
community.aws.ec2_vpc_egress_igw:
amazon.aws.ec2_vpc_egress_igw:
vpc_id: "{{ vpc_result.vpc.id }}"
tags:
ResourcePrefix: "{{ resource_prefix }}"
Expand All @@ -153,7 +153,7 @@
- update_tags is not changed

- name: Add tag to existing tags
community.aws.ec2_vpc_egress_igw:
amazon.aws.ec2_vpc_egress_igw:
vpc_id: "{{ vpc_result.vpc.id }}"
tags:
Phase: integration
Expand All @@ -168,7 +168,7 @@
always:
# ============================================================
- name: Tidy up EIGW
community.aws.ec2_vpc_egress_igw:
amazon.aws.ec2_vpc_egress_igw:
state: absent
vpc_id: "{{ vpc_result.vpc.id }}"
ignore_errors: true
Expand Down

0 comments on commit 4495c26

Please sign in to comment.