Skip to content

describe_launch_templates

describe_launch_templates(
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional[Boolean] = None,
    launch_template_ids: Optional[LaunchTemplateIdStringList] = None,
    launch_template_names: Optional[LaunchTemplateNameStringList] = None,
    filters: Optional[FilterList] = None,
    next_token: Optional[String] = None,
    max_results: Optional[DescribeLaunchTemplatesMaxResults] = None,
    include_managed_resources: Optional[Boolean] = None,
) -> DescribeLaunchTemplatesResult

Describes one or more launch templates.

Parameters:

  • dry_run (Optional[Boolean], default: None ) –

    Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • launch_template_ids (Optional[LaunchTemplateIdStringList], default: None ) –

    One or more launch template IDs.

  • launch_template_names (Optional[LaunchTemplateNameStringList], default: None ) –

    One or more launch template names.

  • filters (Optional[FilterList], default: None ) –

    One or more filters.

    • create-time - The time the launch template was created.

    • launch-template-name - The name of the launch template.

    • tag: - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key Owner and the value TeamA, specify tag:Owner for the filter name and TeamA for the filter value.

    • tag-key - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.

  • next_token (Optional[String], default: None ) –

    The token to request the next page of results.

  • max_results (Optional[DescribeLaunchTemplatesMaxResults], default: None ) –

    The maximum number of results to return in a single call. To retrieve the remaining results, make another call with the returned NextToken value. This value can be between 1 and 200.

  • include_managed_resources (Optional[Boolean], default: None ) –

    Indicates whether to include managed resources in the output. If this parameter is set to true, the output includes resources that are managed by Amazon Web Services services, even if managed resource visibility is set to hidden.

Raises:

Examples:

To describe a launch template This example describes the specified launch template.

>>> client.describe_launch_templates(launch_template_ids=['lt-01238c059e3466abc'])
Source code in docs_src/capo_ec2/_services/ec2.py
def describe_launch_templates(
    self,
    *,
    config_overrides: Optional[EC2ClientConfig] = None,
    dry_run: Optional["capo_ec2.types.boolean.Boolean"] = None,
    launch_template_ids: Optional[
        "capo_ec2.types.launch_template_id_string_list.LaunchTemplateIdStringList"
    ] = None,
    launch_template_names: Optional[
        "capo_ec2.types.launch_template_name_string_list.LaunchTemplateNameStringList"
    ] = None,
    filters: Optional["capo_ec2.types.filter_list.FilterList"] = None,
    next_token: Optional["capo_ec2.types.string.String"] = None,
    max_results: Optional[
        "capo_ec2.types.describe_launch_templates_max_results.DescribeLaunchTemplatesMaxResults"
    ] = None,
    include_managed_resources: Optional["capo_ec2.types.boolean.Boolean"] = None,
) -> (
    "capo_ec2.types.describe_launch_templates_result.DescribeLaunchTemplatesResult"
):
    """<p>Describes one or more launch templates.</p>

    Args:
        dry_run: <p>Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is <code>DryRunOperation</code>. Otherwise, it is <code>UnauthorizedOperation</code>.</p>
        launch_template_ids: <p>One or more launch template IDs.</p>
        launch_template_names: <p>One or more launch template names.</p>
        filters: <p>One or more filters.</p> <ul> <li> <p> <code>create-time</code> - The time the launch template was created.</p> </li> <li> <p> <code>launch-template-name</code> - The name of the launch template.</p> </li> <li> <p> <code>tag</code>:<key> - The key/value combination of a tag assigned to the resource. Use the tag key in the filter name and the tag value as the filter value. For example, to find all resources that have a tag with the key <code>Owner</code> and the value <code>TeamA</code>, specify <code>tag:Owner</code> for the filter name and <code>TeamA</code> for the filter value.</p> </li> <li> <p> <code>tag-key</code> - The key of a tag assigned to the resource. Use this filter to find all resources assigned a tag with a specific key, regardless of the tag value.</p> </li> </ul>
        next_token: <p>The token to request the next page of results.</p>
        max_results: <p>The maximum number of results to return in a single call. To retrieve the remaining results, make another call with the returned <code>NextToken</code> value. This value can be between 1 and 200.</p>
        include_managed_resources: <p>Indicates whether to include managed resources in the output. If this parameter is set to <code>true</code>, the output includes resources that are managed by Amazon Web Services services, even if managed resource visibility is set to hidden.</p>

    Raises:
        capo_ec2.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        To describe a launch template
        This example describes the specified launch template.

        >>> client.describe_launch_templates(launch_template_ids=['lt-01238c059e3466abc'])
    """

    def _handler(
        req: "OperationRequest[capo_ec2.types.describe_launch_templates_request.DescribeLaunchTemplatesRequest]",
    ) -> OperationResponse[
        "capo_ec2.types.describe_launch_templates_result.DescribeLaunchTemplatesResult"
    ]:
        import capo_ec2._operations.amazon_ec2.describe_launch_templates

        output, http_response = (
            capo_ec2._operations.amazon_ec2.describe_launch_templates.describe_launch_templates(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DescribeLaunchTemplates")
    )
    input_: capo_ec2.types.describe_launch_templates_request.DescribeLaunchTemplatesRequest = {}
    if dry_run is not None:
        input_["dry_run"] = dry_run
    if launch_template_ids is not None:
        input_["launch_template_ids"] = launch_template_ids
    if launch_template_names is not None:
        input_["launch_template_names"] = launch_template_names
    if filters is not None:
        input_["filters"] = filters
    if next_token is not None:
        input_["next_token"] = next_token
    if max_results is not None:
        input_["max_results"] = max_results
    if include_managed_resources is not None:
        input_["include_managed_resources"] = include_managed_resources

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output