Skip to content

list_imports

list_imports(
    *,
    config_overrides: Optional[CloudFormationClientConfig] = None,
    export_name: Optional[ExportName] = None,
    next_token: Optional[NextToken] = None,
) -> ListImportsOutput

Lists all stacks that are importing an exported output value. To modify or remove an exported output value, first use this action to see which stacks are using it. To see the exported output values in your account, see ListExports.

For more information about importing an exported output value, see the Fn::ImportValue function.

Parameters:

  • export_name (Optional[ExportName], default: None ) –

    The name of the exported output value. CloudFormation returns the stack names that are importing this value.

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

    The token for the next set of items to return. (You received this token from a previous call.)

Raises:

Source code in docs_src/capo_cloudformation/_services/cloud_formation.py
def list_imports(
    self,
    *,
    config_overrides: Optional[CloudFormationClientConfig] = None,
    export_name: Optional[
        "capo_cloudformation.types.export_name.ExportName"
    ] = None,
    next_token: Optional["capo_cloudformation.types.next_token.NextToken"] = None,
) -> "capo_cloudformation.types.list_imports_output.ListImportsOutput":
    """<p>Lists all stacks that are importing an exported output value. To modify or remove an exported output value, first use this action to see which stacks are using it. To see the exported output values in your account, see <a>ListExports</a>.</p> <p>For more information about importing an exported output value, see the <a href="https://docs.aws.amazon.com/AWSCloudFormation/latest/TemplateReference/intrinsic-function-reference-importvalue.html">Fn::ImportValue</a> function.</p>

    Args:
        export_name: <p>The name of the exported output value. CloudFormation returns the stack names that are importing this value.</p>
        next_token: <p>The token for the next set of items to return. (You received this token from a previous call.)</p>

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

    def _handler(
        req: "OperationRequest[capo_cloudformation.types.list_imports_input.ListImportsInput]",
    ) -> OperationResponse[
        "capo_cloudformation.types.list_imports_output.ListImportsOutput"
    ]:
        import capo_cloudformation._operations.cloud_formation.list_imports

        output, http_response = (
            capo_cloudformation._operations.cloud_formation.list_imports.list_imports(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListImports")
    )
    input_: capo_cloudformation.types.list_imports_input.ListImportsInput = {}
    if export_name is not None:
        input_["export_name"] = export_name
    if next_token is not None:
        input_["next_token"] = next_token

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