Skip to content

import_resources_to_draft_app_version

import_resources_to_draft_app_version(
    app_arn: Arn,
    *,
    config_overrides: Optional[resiliencehubClientConfig] = None,
    source_arns: Optional[ArnList] = None,
    terraform_sources: Optional[TerraformSourceList] = None,
    import_strategy: Optional[ResourceImportStrategyType] = None,
    eks_sources: Optional[EksSourceList] = None,
) -> ImportResourcesToDraftAppVersionResponse

Imports resources to Resilience Hub application draft version from different input sources. For more information about the input sources supported by Resilience Hub, see Discover the structure and describe your Resilience Hub application.

Parameters:

  • app_arn (Arn) –

    Amazon Resource Name (ARN) of the Resilience Hub application. The format for this ARN is: arn:partition:resiliencehub:region:account:app/app-id. For more information about ARNs, see Amazon Resource Names (ARNs) in the Amazon Web Services General Reference guide.

  • source_arns (Optional[ArnList], default: None ) –

    The Amazon Resource Names (ARNs) for the resources.

  • terraform_sources (Optional[TerraformSourceList], default: None ) –

    A list of terraform file s3 URLs you need to import.

  • import_strategy (Optional[ResourceImportStrategyType], default: None ) –

    The import strategy you would like to set to import resources into Resilience Hub application.

  • eks_sources (Optional[EksSourceList], default: None ) –

    The input sources of the Amazon Elastic Kubernetes Service resources you need to import.

Raises:

  • AccessDeniedException –

    You don't have permissions to perform the requested operation. The user or role that is making the request must have at least one IAM permissions policy attached that grants the required permissions.

  • ConflictException –

    This exception occurs when a conflict with a previous successful write is detected. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.

  • InternalServerException –

    This exception occurs when there is an internal failure in the Resilience Hub service.

  • ResourceNotFoundException –

    This exception occurs when the specified resource could not be found.

  • ServiceQuotaExceededException –

    This exception occurs when you have exceeded your service quota. To perform the requested action, remove some of the relevant resources, or use Service Quotas to request a service quota increase.

  • ThrottlingException –

    This exception occurs when you have exceeded the limit on the number of requests per second.

  • ValidationException –

    This exception occurs when a request is not valid.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_resiliencehub/_services/resiliencehub.py
def import_resources_to_draft_app_version(
    self,
    app_arn: "capo_resiliencehub.types.arn.Arn",
    *,
    config_overrides: Optional[resiliencehubClientConfig] = None,
    source_arns: Optional["capo_resiliencehub.types.arn_list.ArnList"] = None,
    terraform_sources: Optional[
        "capo_resiliencehub.types.terraform_source_list.TerraformSourceList"
    ] = None,
    import_strategy: Optional[
        "capo_resiliencehub.types.resource_import_strategy_type.ResourceImportStrategyType"
    ] = None,
    eks_sources: Optional[
        "capo_resiliencehub.types.eks_source_list.EksSourceList"
    ] = None,
) -> "capo_resiliencehub.types.import_resources_to_draft_app_version_response.ImportResourcesToDraftAppVersionResponse":
    """<p>Imports resources to Resilience Hub application draft version from different input sources. For more information about the input sources supported by Resilience Hub, see <a href="https://docs.aws.amazon.com/resilience-hub/latest/userguide/discover-structure.html">Discover the structure and describe your Resilience Hub application</a>.</p>

    Args:
        app_arn: <p>Amazon Resource Name (ARN) of the Resilience Hub application. The format for this ARN is: arn:<code>partition</code>:resiliencehub:<code>region</code>:<code>account</code>:app/<code>app-id</code>. For more information about ARNs, see <a href="https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html"> Amazon Resource Names (ARNs)</a> in the <i>Amazon Web Services General Reference</i> guide.</p>
        source_arns: <p>The Amazon Resource Names (ARNs) for the resources.</p>
        terraform_sources: <p> A list of terraform file s3 URLs you need to import. </p>
        import_strategy: <p>The import strategy you would like to set to import resources into Resilience Hub application.</p>
        eks_sources: <p>The input sources of the Amazon Elastic Kubernetes Service resources you need to import.</p>

    Raises:
        capo_resiliencehub.errors.access_denied_exception.AccessDeniedException: <p>You don't have permissions to perform the requested operation. The user or role that is making the request must have at least one IAM permissions policy attached that grants the required permissions.</p>
        capo_resiliencehub.errors.conflict_exception.ConflictException: <p>This exception occurs when a conflict with a previous successful write is detected. This generally occurs when the previous write did not have time to propagate to the host serving the current request. A retry (with appropriate backoff logic) is the recommended response to this exception.</p>
        capo_resiliencehub.errors.internal_server_exception.InternalServerException: <p>This exception occurs when there is an internal failure in the Resilience Hub service.</p>
        capo_resiliencehub.errors.resource_not_found_exception.ResourceNotFoundException: <p>This exception occurs when the specified resource could not be found.</p>
        capo_resiliencehub.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>This exception occurs when you have exceeded your service quota. To perform the requested action, remove some of the relevant resources, or use Service Quotas to request a service quota increase.</p>
        capo_resiliencehub.errors.throttling_exception.ThrottlingException: <p>This exception occurs when you have exceeded the limit on the number of requests per second.</p>
        capo_resiliencehub.errors.validation_exception.ValidationException: <p>This exception occurs when a request is not valid.</p>
        capo_resiliencehub.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_resiliencehub.types.import_resources_to_draft_app_version_request.ImportResourcesToDraftAppVersionRequest]",
    ) -> OperationResponse[
        "capo_resiliencehub.types.import_resources_to_draft_app_version_response.ImportResourcesToDraftAppVersionResponse"
    ]:
        import capo_resiliencehub._operations.aws_resilience_hub.import_resources_to_draft_app_version

        output, http_response = (
            capo_resiliencehub._operations.aws_resilience_hub.import_resources_to_draft_app_version.import_resources_to_draft_app_version(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ImportResourcesToDraftAppVersion")
    )
    input_: capo_resiliencehub.types.import_resources_to_draft_app_version_request.ImportResourcesToDraftAppVersionRequest = {
        "app_arn": app_arn
    }
    if source_arns is not None:
        input_["source_arns"] = source_arns
    if terraform_sources is not None:
        input_["terraform_sources"] = terraform_sources
    if import_strategy is not None:
        input_["import_strategy"] = import_strategy
    if eks_sources is not None:
        input_["eks_sources"] = eks_sources

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