mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
[cloud] Add vpc_id option for ec2_lc security group lookups by name (#24459)
This commit is contained in:
parent
cf4806d29d
commit
0210a1a7dc
1 changed files with 9 additions and 2 deletions
|
@ -121,6 +121,11 @@ options:
|
|||
- A list of security group id's with which to associate the ClassicLink VPC instances.
|
||||
required: false
|
||||
version_added: "2.0"
|
||||
vpc_id:
|
||||
description:
|
||||
- VPC ID, used when resolving security group names to IDs.
|
||||
required: false
|
||||
version_added: "2.4"
|
||||
extends_documentation_fragment:
|
||||
- aws
|
||||
- ec2
|
||||
|
@ -189,8 +194,9 @@ def create_launch_config(connection, module):
|
|||
name = module.params.get('name')
|
||||
image_id = module.params.get('image_id')
|
||||
key_name = module.params.get('key_name')
|
||||
vpc_id = module.params.get('vpc_id')
|
||||
try:
|
||||
security_groups = get_ec2_security_group_ids_from_names(module.params.get('security_groups'), ec2_connect(module), vpc_id=None, boto3=False)
|
||||
security_groups = get_ec2_security_group_ids_from_names(module.params.get('security_groups'), ec2_connect(module), vpc_id=vpc_id, boto3=False)
|
||||
except ValueError as e:
|
||||
module.fail_json(msg=str(e))
|
||||
user_data = module.params.get('user_data')
|
||||
|
@ -319,7 +325,8 @@ def main():
|
|||
instance_monitoring=dict(default=False, type='bool'),
|
||||
assign_public_ip=dict(type='bool'),
|
||||
classic_link_vpc_security_groups=dict(type='list'),
|
||||
classic_link_vpc_id=dict(type='str')
|
||||
classic_link_vpc_id=dict(type='str'),
|
||||
vpc_id=dict(type='str')
|
||||
)
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in a new issue