Skip to content

create_home_region_control

create_home_region_control(
    home_region: HomeRegion,
    target: Target,
    *,
    config_overrides: Optional[MigrationHubConfigClientConfig] = None,
    dry_run: Optional[DryRun] = None,
) -> CreateHomeRegionControlResult

This API sets up the home region for the calling account only.

Parameters:

  • home_region (HomeRegion) –

    The name of the home region of the calling account.

  • target (Target) –

    The account for which this command sets up a home region control. The Target is always of type ACCOUNT.

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

    Optional Boolean flag to indicate whether any effect should take place. It tests whether the caller has permission to make the call.

Raises:

  • AccessDeniedException –

    You do not have sufficient access to perform this action.

  • DryRunOperation –

    Exception raised to indicate that authorization of an action was successful, when the DryRun flag is set to true.

  • InternalServerError –

    Exception raised when an internal, configuration, or dependency error is encountered.

  • InvalidInputException –

    Exception raised when the provided input violates a policy constraint or is entered in the wrong format or data type.

  • ServiceUnavailableException –

    Exception raised when a request fails due to temporary unavailability of the service.

  • ThrottlingException –

    The request was denied due to request throttling.

  • UnknownServiceError –

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

Source code in docs_src/capo_migrationhub_config/_services/migration_hub_config.py
def create_home_region_control(
    self,
    home_region: "capo_migrationhub_config.types.home_region.HomeRegion",
    target: "capo_migrationhub_config.types.target.Target",
    *,
    config_overrides: Optional[MigrationHubConfigClientConfig] = None,
    dry_run: Optional["capo_migrationhub_config.types.dry_run.DryRun"] = None,
) -> "capo_migrationhub_config.types.create_home_region_control_result.CreateHomeRegionControlResult":
    """<p>This API sets up the home region for the calling account only.</p>

    Args:
        home_region: <p>The name of the home region of the calling account.</p>
        target: <p>The account for which this command sets up a home region control. The <code>Target</code> is always of type <code>ACCOUNT</code>.</p>
        dry_run: <p>Optional Boolean flag to indicate whether any effect should take place. It tests whether the caller has permission to make the call.</p>

    Raises:
        capo_migrationhub_config.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_migrationhub_config.errors.dry_run_operation.DryRunOperation: <p>Exception raised to indicate that authorization of an action was successful, when the <code>DryRun</code> flag is set to true.</p>
        capo_migrationhub_config.errors.internal_server_error.InternalServerError: <p>Exception raised when an internal, configuration, or dependency error is encountered.</p>
        capo_migrationhub_config.errors.invalid_input_exception.InvalidInputException: <p>Exception raised when the provided input violates a policy constraint or is entered in the wrong format or data type.</p>
        capo_migrationhub_config.errors.service_unavailable_exception.ServiceUnavailableException: <p>Exception raised when a request fails due to temporary unavailability of the service.</p>
        capo_migrationhub_config.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_migrationhub_config.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_migrationhub_config.types.create_home_region_control_request.CreateHomeRegionControlRequest]",
    ) -> OperationResponse[
        "capo_migrationhub_config.types.create_home_region_control_result.CreateHomeRegionControlResult"
    ]:
        import capo_migrationhub_config._operations.aws_migration_hub_multi_account_service.create_home_region_control

        output, http_response = (
            capo_migrationhub_config._operations.aws_migration_hub_multi_account_service.create_home_region_control.create_home_region_control(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateHomeRegionControl")
    )
    input_: capo_migrationhub_config.types.create_home_region_control_request.CreateHomeRegionControlRequest = {
        "home_region": home_region,
        "target": target,
    }
    if dry_run is not None:
        input_["dry_run"] = dry_run

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