launch_template#
Exec module for managing launch template.
- async idem_aws.exec.aws.ec2.launch_template.get(hub, ctx, name, resource_id: str = None, filters: List = None) Dict [source]#
Get a Launch template resource from AWS. Supply one of the inputs as the filter.
- Parameters:
name (str) – The name of the Idem state.
resource_id (string, Optional) – AWS Launch template id to identify the resource.
filters (list, Optional) – One or more filters: for example, tag :<key>, tag-key. A complete list of filters can be found at https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2.html#EC2.Client.describe_launch_templates
- Returns:
Returns launch_template in present format
- Return type:
Dict[str, Any]
Examples
Calling this exec module function from the cli with filters
idem exec aws.ec2.launch_template.get name=my_resource filters=[{'name': 'tag:Name', 'values': ['value']}]
Calling this exec module function from within a state module in pure python.
async def state_function(hub, ctx, name, service_namespace, scaling_resource_id, scalable_dimension): await hub.exec.aws.ec2.launch_template.get( ctx=ctx, name=name, resource_id=resource_id, filters=filters )
Using in a state:
my_unmanaged_resource: exec.run: - path: aws.ec2.launch_template.get - kwargs: name: my_resource filters: - name: 'launch-template-name' values: [ "template-name" ] - name: 'tag:Key' values: [ "value" ]
- async idem_aws.exec.aws.ec2.launch_template.list_(hub, ctx, name: str = None, filters: List = None) Dict [source]#
Get Launch templates from AWS. Supply one of the inputs as the filter.
- Parameters:
name (str, Optional) – The name of the Idem state.
filters (list, Optional) – One or more filters: for example, tag :<key>, tag-key. A complete list of filters can be found at https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ec2.html#EC2.Client.describe_launch_templates
- Returns:
Returns launch_templates in present format
- Return type:
Dict[str, Any]
Examples
Calling this exec module function from the cli with filters
idem exec aws.ec2.launch_template.list name="my_resources" filters=[{'name': 'launch-template-name', 'values': ['template-name']}]
Calling this exec module function from within a state module in pure python.
async def state_function(hub, ctx, name, service_namespace, scaling_resource_id, scalable_dimension): await hub.exec.aws.ec2.launch_template.list( ctx=ctx, name=name, filters=filters )
Using in a state:
my_unmanaged_resource: exec.run: - path: aws.ec2.launch_template.list - kwargs: name: my_resources filters: - name: 'launch-template-name' values: ["template-name"]