Skip to content

update_agent_profile

update_agent_profile(
    profile_arn: AgentProfileArn,
    *,
    config_overrides: Optional[WellArchitectedClientConfig] = None,
    client_token: Optional[str] = None,
    display_name: Optional[SensitiveString] = None,
    description: Optional[SensitiveString] = None,
    execution_role_arn: Optional[RoleArn] = None,
    aggregation_configuration: Optional[AggregationConfigurations] = None,
    business_overview: Optional[SensitiveString] = None,
    pillars: Optional[Pillars] = None,
    deletion_protection: Optional[bool] = None,
) -> UpdateAgentProfileResponse

Updates an existing optimization profile's configuration, including its pillars, execution role, and aggregation settings.

Parameters:

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

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

  • profile_arn (AgentProfileArn) –

    The Amazon Resource Name (ARN) of the profile to update.

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

    The updated display name of the profile.

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

    The updated description of the profile.

  • execution_role_arn (Optional[RoleArn], default: None ) –

    The updated ARN of the IAM execution role.

  • aggregation_configuration (Optional[AggregationConfigurations], default: None ) –

    The updated aggregation configuration.

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

    The updated business overview for the profile.

  • pillars (Optional[Pillars], default: None ) –

    The updated Well-Architected Tool Framework pillars for the profile.

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

    Indicates whether deletion protection is enabled for the profile.

Raises:

Source code in docs_src/capo_wellarchitected/_services/well_architected.py
def update_agent_profile(
    self,
    profile_arn: "capo_wellarchitected.types.agent_profile_arn.AgentProfileArn",
    *,
    config_overrides: Optional[WellArchitectedClientConfig] = None,
    client_token: Optional[str] = None,
    display_name: Optional[
        "capo_wellarchitected.types.sensitive_string.SensitiveString"
    ] = None,
    description: Optional[
        "capo_wellarchitected.types.sensitive_string.SensitiveString"
    ] = None,
    execution_role_arn: Optional[
        "capo_wellarchitected.types.role_arn.RoleArn"
    ] = None,
    aggregation_configuration: Optional[
        "capo_wellarchitected.types.aggregation_configurations.AggregationConfigurations"
    ] = None,
    business_overview: Optional[
        "capo_wellarchitected.types.sensitive_string.SensitiveString"
    ] = None,
    pillars: Optional["capo_wellarchitected.types.pillars.Pillars"] = None,
    deletion_protection: Optional[bool] = None,
) -> "capo_wellarchitected.types.update_agent_profile_response.UpdateAgentProfileResponse":
    """<p>Updates an existing optimization profile's configuration, including its pillars, execution role, and aggregation settings.</p>

    Args:
        client_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.</p>
        profile_arn: <p>The Amazon Resource Name (ARN) of the profile to update.</p>
        display_name: <p>The updated display name of the profile.</p>
        description: <p>The updated description of the profile.</p>
        execution_role_arn: <p>The updated ARN of the IAM execution role.</p>
        aggregation_configuration: <p>The updated aggregation configuration.</p>
        business_overview: <p>The updated business overview for the profile.</p>
        pillars: <p>The updated Well-Architected Tool Framework pillars for the profile.</p>
        deletion_protection: <p>Indicates whether deletion protection is enabled for 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.internal_server_exception.InternalServerException: <p>There is a problem with the Well-Architected Tool API service.</p>
        capo_wellarchitected.errors.resource_not_found_exception.ResourceNotFoundException: <p>The requested resource was not found.</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.
    """

    def _handler(
        req: "OperationRequest[capo_wellarchitected.types.update_agent_profile_request.UpdateAgentProfileRequest]",
    ) -> OperationResponse[
        "capo_wellarchitected.types.update_agent_profile_response.UpdateAgentProfileResponse"
    ]:
        import capo_wellarchitected._operations.well_architected_api_service_lambda.update_agent_profile

        output, http_response = (
            capo_wellarchitected._operations.well_architected_api_service_lambda.update_agent_profile.update_agent_profile(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

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

        return capo_wellarchitected.types.update_agent_profile_request.redact_sensitive(
            input_
        )

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

        return capo_wellarchitected.types.update_agent_profile_response.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "UpdateAgentProfile",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_wellarchitected.types.update_agent_profile_request.UpdateAgentProfileRequest = {
        "profile_arn": profile_arn
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if display_name is not None:
        input_["display_name"] = display_name
    if description is not None:
        input_["description"] = description
    if execution_role_arn is not None:
        input_["execution_role_arn"] = execution_role_arn
    if aggregation_configuration is not None:
        input_["aggregation_configuration"] = aggregation_configuration
    if business_overview is not None:
        input_["business_overview"] = business_overview
    if pillars is not None:
        input_["pillars"] = pillars
    if deletion_protection is not None:
        input_["deletion_protection"] = deletion_protection

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