mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
[cloud] Update VPC configuration for existing lambda (#24368)
If a lambda exists but does not have a VPC configuration, add the VPC configuration when it's present in the ansible parameters. Prior to this change, setting VPC configuration on a lambda that did not have any VPC configuration would ignore that config.
This commit is contained in:
parent
4d890c1e9f
commit
6e13e3918f
1 changed files with 3 additions and 3 deletions
|
@ -364,9 +364,9 @@ def main():
|
||||||
subnet_net_id_changed = sorted(vpc_subnet_ids) != sorted(current_vpc_subnet_ids)
|
subnet_net_id_changed = sorted(vpc_subnet_ids) != sorted(current_vpc_subnet_ids)
|
||||||
vpc_security_group_ids_changed = sorted(vpc_security_group_ids) != sorted(current_vpc_security_group_ids)
|
vpc_security_group_ids_changed = sorted(vpc_security_group_ids) != sorted(current_vpc_security_group_ids)
|
||||||
|
|
||||||
if any((subnet_net_id_changed, vpc_security_group_ids_changed)):
|
if 'VpcConfig' not in current_config or subnet_net_id_changed or vpc_security_group_ids_changed:
|
||||||
func_kwargs.update({'VpcConfig':
|
func_kwargs.update({'VpcConfig':
|
||||||
{'SubnetIds': vpc_subnet_ids,'SecurityGroupIds': vpc_security_group_ids}})
|
{'SubnetIds': vpc_subnet_ids,'SecurityGroupIds': vpc_security_group_ids}})
|
||||||
else:
|
else:
|
||||||
# No VPC configuration is desired, assure VPC config is empty when present in current config
|
# No VPC configuration is desired, assure VPC config is empty when present in current config
|
||||||
if ('VpcConfig' in current_config and
|
if ('VpcConfig' in current_config and
|
||||||
|
|
Loading…
Reference in a new issue