corrected version to 2.2. Ensure no vpc-id is returned if detached
This commit is contained in:
parent
9d51e84c6f
commit
8be42e0676
1 changed files with 3 additions and 3 deletions
|
@ -22,7 +22,7 @@ description:
|
||||||
- Deletes AWS VPN Virtual Gateways
|
- Deletes AWS VPN Virtual Gateways
|
||||||
- Attaches Virtual Gateways to VPCs
|
- Attaches Virtual Gateways to VPCs
|
||||||
- Detaches Virtual Gateways from VPCs
|
- Detaches Virtual Gateways from VPCs
|
||||||
version_added: "2.1"
|
version_added: "2.2"
|
||||||
requirements: [ boto3 ]
|
requirements: [ boto3 ]
|
||||||
options:
|
options:
|
||||||
state:
|
state:
|
||||||
|
@ -139,7 +139,7 @@ def get_vgw_info(vgws):
|
||||||
for tag in vgw['Tags']:
|
for tag in vgw['Tags']:
|
||||||
vgw_info['tags'][tag['Key']] = tag['Value']
|
vgw_info['tags'][tag['Key']] = tag['Value']
|
||||||
|
|
||||||
if len(vgw['VpcAttachments']) != 0:
|
if len(vgw['VpcAttachments']) != 0 and vgw['VpcAttachments'][0]['State'] == 'attached':
|
||||||
vgw_info['vpc_id'] = vgw['VpcAttachments'][0]['VpcId']
|
vgw_info['vpc_id'] = vgw['VpcAttachments'][0]['VpcId']
|
||||||
|
|
||||||
return vgw_info
|
return vgw_info
|
||||||
|
@ -537,7 +537,7 @@ def ensure_vgw_absent(client, module):
|
||||||
changed = False
|
changed = False
|
||||||
deleted_vgw = None
|
deleted_vgw = None
|
||||||
|
|
||||||
result = get_vgw_info(deleted_vgw)
|
result = deleted_vgw
|
||||||
return changed, result
|
return changed, result
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue