Skip to content

create_agent_profile async

create_agent_profile(
    name: str,
    pillars: Pillars,
    execution_role_arn: RoleArn,
    aggregation_configuration: AggregationConfigurations,
    *,
    config_overrides: Optional[AsyncWellArchitectedClientConfig] = None,
    display_name: Optional[SensitiveString] = None,
    description: Optional[SensitiveString] = None,
    business_overview: Optional[SensitiveString] = None,
    deletion_protection: Optional[bool] = None,
    client_token: Optional[str] = None,
    tags: Optional[Tags] = None,
) -> CreateAgentProfileResponse

Creates an optimization profile that defines the scope and configuration for generating recommendations. A profile specifies the execution role, target pillars, and aggregation settings for analyzing your Amazon Web Services resources.

Parameters:

  • name (str) –

    The system name of the profile.

  • display_name (Optional[SensitiveString], default: None ) –

    The display name of the profile shown to users.

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

    A description of the profile.

  • business_overview (Optional[SensitiveString], default: None ) –

    The business overview for this profile.

  • pillars (Pillars) –

    The Well-Architected Tool Framework pillars to associate with this profile.

  • deletion_protection (Optional[bool], default: None ) –

    Indicates whether deletion protection is enabled for the profile.

  • execution_role_arn (RoleArn) –

    The ARN of the IAM execution role used for recommendation actions.

  • aggregation_configuration (AggregationConfigurations) –

    The aggregation configuration that defines which Amazon Web Services accounts and Regions to analyze.

  • client_token (Optional[str], default: None ) –

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.

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

    The tags to associate with the profile.

Raises:

Source code in docs_src/capo_wellarchitected/_services/async_well_architected.py
async def create_agent_profile(
    self,
    name: str,
    pillars: "capo_wellarchitected.types.pillars.Pillars",
    execution_role_arn: "capo_wellarchitected.types.role_arn.RoleArn",
    aggregation_configuration: "capo_wellarchitected.types.aggregation_configurations.AggregationConfigurations",
    *,
    config_overrides: Optional[AsyncWellArchitectedClientConfig] = None,
    display_name: Optional[
        "capo_wellarchitected.types.sensitive_string.SensitiveString"
    ] = None,
    description: Optional[
        "capo_wellarchitected.types.sensitive_string.SensitiveString"
    ] = None,
    business_overview: Optional[
        "capo_wellarchitected.types.sensitive_string.SensitiveString"
    ] = None,
    deletion_protection: Optional[bool] = None,
    client_token: Optional[str] = None,
    tags: Optional["capo_wellarchitected.types.tags.Tags"] = None,
) -> "capo_wellarchitected.types.create_agent_profile_response.CreateAgentProfileResponse":
    """<p>Creates an optimization profile that defines the scope and configuration for generating recommendations. A profile specifies the execution role, target pillars, and aggregation settings for analyzing your Amazon Web Services resources.</p>

    Args:
        name: <p>The system name of the profile.</p>
        display_name: <p>The display name of the profile shown to users.</p>
        description: <p>A description of the profile.</p>
        business_overview: <p>The business overview for this profile.</p>
        pillars: <p>The Well-Architected Tool Framework pillars to associate with this profile.</p>
        deletion_protection: <p>Indicates whether deletion protection is enabled for the profile.</p>
        execution_role_arn: <p>The ARN of the IAM execution role used for recommendation actions.</p>
        aggregation_configuration: <p>The aggregation configuration that defines which Amazon Web Services accounts and Regions to analyze.</p>
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
        tags: <p>The tags to associate with the profile.</p>

    Raises:
        capo_wellarchitected.errors.access_denied_exception.AccessDeniedException: <p>User does not have sufficient access to perform this action.</p>
        capo_wellarchitected.errors.conflict_exception.ConflictException: <p>The resource has already been processed, was deleted, or is too large.</p>
        capo_wellarchitected.errors.internal_server_exception.InternalServerException: <p>There is a problem with the Well-Architected Tool API service.</p>
        capo_wellarchitected.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The user has reached their resource quota.</p>
        capo_wellarchitected.errors.throttling_exception.ThrottlingException: <p>Request was denied due to request throttling.</p>
        capo_wellarchitected.errors.validation_exception.ValidationException: <p>The user input is not valid.</p>
        capo_wellarchitected.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_wellarchitected.types.create_agent_profile_request.CreateAgentProfileRequest]",
    ) -> AsyncOperationResponse[
        "capo_wellarchitected.types.create_agent_profile_response.CreateAgentProfileResponse"
    ]:
        import capo_wellarchitected._operations.well_architected_api_service_lambda.create_agent_profile

        (
            output,
            http_response,
        ) = await capo_wellarchitected._operations.well_architected_api_service_lambda.create_agent_profile.async_create_agent_profile(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_wellarchitected.types.create_agent_profile_request.CreateAgentProfileRequest",
    ) -> dict[str, Any]:
        import capo_wellarchitected.types.create_agent_profile_request

        return capo_wellarchitected.types.create_agent_profile_request.redact_sensitive(
            input_
        )

    def _redact_output(
        output: "capo_wellarchitected.types.create_agent_profile_response.CreateAgentProfileResponse",
    ) -> dict[str, Any]:
        import capo_wellarchitected.types.create_agent_profile_response

        return capo_wellarchitected.types.create_agent_profile_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateAgentProfile",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_wellarchitected.types.create_agent_profile_request.CreateAgentProfileRequest = {
        "name": name,
        "pillars": pillars,
        "execution_role_arn": execution_role_arn,
        "aggregation_configuration": aggregation_configuration,
    }
    if display_name is not None:
        input_["display_name"] = display_name
    if description is not None:
        input_["description"] = description
    if business_overview is not None:
        input_["business_overview"] = business_overview
    if deletion_protection is not None:
        input_["deletion_protection"] = deletion_protection
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    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