Skip to content

create_stack_refactor async

create_stack_refactor(
    *,
    config_overrides: Optional[AsyncCloudFormationClientConfig] = None,
    description: Optional[Description] = None,
    enable_stack_creation: Optional[EnableStackCreation] = None,
    resource_mappings: Optional[ResourceMappings] = None,
    stack_definitions: Optional[StackDefinitions] = None,
) -> CreateStackRefactorOutput

Creates a refactor across multiple stacks, with the list of stacks and resources that are affected.

Parameters:

  • description (Optional[Description], default: None ) –

    A description to help you identify the stack refactor.

  • enable_stack_creation (Optional[EnableStackCreation], default: None ) –

    Determines if a new stack is created with the refactor.

  • resource_mappings (Optional[ResourceMappings], default: None ) –

    The mappings for the stack resource Source and stack resource Destination.

  • stack_definitions (Optional[StackDefinitions], default: None ) –

    The stacks being refactored.

Raises:

Source code in docs_src/capo_cloudformation/_services/async_cloud_formation.py
async def create_stack_refactor(
    self,
    *,
    config_overrides: Optional[AsyncCloudFormationClientConfig] = None,
    description: Optional[
        "capo_cloudformation.types.description.Description"
    ] = None,
    enable_stack_creation: Optional[
        "capo_cloudformation.types.enable_stack_creation.EnableStackCreation"
    ] = None,
    resource_mappings: Optional[
        "capo_cloudformation.types.resource_mappings.ResourceMappings"
    ] = None,
    stack_definitions: Optional[
        "capo_cloudformation.types.stack_definitions.StackDefinitions"
    ] = None,
) -> "capo_cloudformation.types.create_stack_refactor_output.CreateStackRefactorOutput":
    """<p>Creates a refactor across multiple stacks, with the list of stacks and resources that are affected.</p>

    Args:
        description: <p>A description to help you identify the stack refactor.</p>
        enable_stack_creation: <p>Determines if a new stack is created with the refactor.</p>
        resource_mappings: <p>The mappings for the stack resource <code>Source</code> and stack resource <code>Destination</code>.</p>
        stack_definitions: <p>The stacks being refactored.</p>

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

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudformation.types.create_stack_refactor_input.CreateStackRefactorInput]",
    ) -> AsyncOperationResponse[
        "capo_cloudformation.types.create_stack_refactor_output.CreateStackRefactorOutput"
    ]:
        import capo_cloudformation._operations.cloud_formation.create_stack_refactor

        (
            output,
            http_response,
        ) = await capo_cloudformation._operations.cloud_formation.create_stack_refactor.async_create_stack_refactor(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateStackRefactor")
    )
    input_: capo_cloudformation.types.create_stack_refactor_input.CreateStackRefactorInput = {}
    if description is not None:
        input_["description"] = description
    if enable_stack_creation is not None:
        input_["enable_stack_creation"] = enable_stack_creation
    if resource_mappings is not None:
        input_["resource_mappings"] = resource_mappings
    if stack_definitions is not None:
        input_["stack_definitions"] = stack_definitions

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output