Skip to content

enable_baseline async

enable_baseline(
    baseline_version: BaselineVersion,
    baseline_identifier: Arn,
    target_identifier: Arn,
    *,
    config_overrides: Optional[AsyncControlTowerClientConfig] = None,
    parameters: Optional[EnabledBaselineParameters] = None,
    tags: Optional[TagMap] = None,
) -> EnableBaselineOutput

Enable (apply) a Baseline to a Target. This API starts an asynchronous operation to deploy resources specified by the Baseline to the specified Target. For usage examples, see the Amazon Web Services Control Tower User Guide .

Parameters:

  • baseline_version (BaselineVersion) –

    The specific version to be enabled of the specified baseline.

  • parameters (Optional[EnabledBaselineParameters], default: None ) –

    A list of key-value objects that specify enablement parameters, where key is a string and value is a document of any type.

  • baseline_identifier (Arn) –

    The ARN of the baseline to be enabled.

  • target_identifier (Arn) –

    The ARN of the target on which the baseline will be enabled. Only OUs are supported as targets.

  • tags (Optional[TagMap], default: None ) –

    Tags associated with input to EnableBaseline.

Raises:

Source code in docs_src/capo_controltower/_services/async_control_tower.py
async def enable_baseline(
    self,
    baseline_version: "capo_controltower.types.baseline_version.BaselineVersion",
    baseline_identifier: "capo_controltower.types.arn.Arn",
    target_identifier: "capo_controltower.types.arn.Arn",
    *,
    config_overrides: Optional[AsyncControlTowerClientConfig] = None,
    parameters: Optional[
        "capo_controltower.types.enabled_baseline_parameters.EnabledBaselineParameters"
    ] = None,
    tags: Optional["capo_controltower.types.tag_map.TagMap"] = None,
) -> "capo_controltower.types.enable_baseline_output.EnableBaselineOutput":
    """<p>Enable (apply) a <code>Baseline</code> to a Target. This API starts an asynchronous operation to deploy resources specified by the <code>Baseline</code> to the specified Target. For usage examples, see <a href="https://docs.aws.amazon.com/controltower/latest/userguide/baseline-api-examples.html"> <i>the Amazon Web Services Control Tower User Guide</i> </a>.</p>

    Args:
        baseline_version: <p>The specific version to be enabled of the specified baseline.</p>
        parameters: <p>A list of <code>key-value</code> objects that specify enablement parameters, where <code>key</code> is a string and <code>value</code> is a document of any type.</p>
        baseline_identifier: <p>The ARN of the baseline to be enabled.</p>
        target_identifier: <p>The ARN of the target on which the baseline will be enabled. Only OUs are supported as targets.</p>
        tags: <p>Tags associated with input to <code>EnableBaseline</code>.</p>

    Raises:
        capo_controltower.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_controltower.errors.conflict_exception.ConflictException: <p>Updating or deleting the resource can cause an inconsistent state.</p>
        capo_controltower.errors.internal_server_exception.InternalServerException: <p>An unexpected error occurred during processing of a request.</p>
        capo_controltower.errors.resource_not_found_exception.ResourceNotFoundException: <p>The request references a resource that does not exist.</p>
        capo_controltower.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request would cause a service quota to be exceeded. See <a href="https://docs.aws.amazon.com/controltower/latest/userguide/request-an-increase.html">Service quotas</a>.</p>
        capo_controltower.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_controltower.errors.validation_exception.ValidationException: <p>The input does not satisfy the constraints specified by an Amazon Web Services service.</p>
        capo_controltower.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_controltower.types.enable_baseline_input.EnableBaselineInput]",
    ) -> AsyncOperationResponse[
        "capo_controltower.types.enable_baseline_output.EnableBaselineOutput"
    ]:
        import capo_controltower._operations.aws_control_tower_apis.enable_baseline

        (
            output,
            http_response,
        ) = await capo_controltower._operations.aws_control_tower_apis.enable_baseline.async_enable_baseline(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("EnableBaseline")
    )
    input_: capo_controltower.types.enable_baseline_input.EnableBaselineInput = {
        "baseline_version": baseline_version,
        "baseline_identifier": baseline_identifier,
        "target_identifier": target_identifier,
    }
    if parameters is not None:
        input_["parameters"] = parameters
    if tags is not None:
        input_["tags"] = tags

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