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. Include only the fields you want to change. Any field you omit from the request keeps its current value, so you do not need to retrieve the profile first and resend the fields you are not changing.

To clear an optional text field, supply an empty string for it; the field is then unset, and a subsequent read omits it rather than returning an empty string. Omitting the field from the request leaves the stored value in place. description and businessOverview can be cleared this way. displayName cannot be cleared because a display name is required, though you can change it. pillars cannot be cleared because a profile must target at least one pillar.

aggregationConfiguration behaves differently because it is a list of per-account configurations rather than a text field. Supplying an empty list removes every account entry, but the field itself remains set: a subsequent read returns an empty list rather than omitting the field. Omitting it from the request keeps the stored entries.

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. Omit this field to keep the current display name. A display name is required, so it cannot be cleared.

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

    The updated description of the profile. Omit this field to keep the current description, or supply an empty string to clear it; a cleared description is read back as absent rather than as an empty string.

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

    The updated ARN of the IAM execution role. Omit this field to keep the current execution role.

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

    The updated aggregation configuration, as a list of per-account entries. Omit this field to keep the current entries, or supply an empty list to remove them all. The field remains set either way — an emptied configuration is read back as an empty list, not as an absent field.

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

    The updated business overview for the profile. Omit this field to keep the current business overview, or supply an empty string to clear it; a cleared business overview is read back as absent rather than as an empty string.

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

    The updated Amazon Web Services Well-Architected Framework pillars for the profile. Omit this field to keep the current pillars. A profile must target at least one pillar, so an empty list is rejected.

  • 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. Include only the fields you want to change. Any field you omit from the request keeps its current value, so you do not need to retrieve the profile first and resend the fields you are not changing.</p> <p>To clear an optional text field, supply an empty string for it; the field is then unset, and a subsequent read omits it rather than returning an empty string. Omitting the field from the request leaves the stored value in place. <code>description</code> and <code>businessOverview</code> can be cleared this way. <code>displayName</code> cannot be cleared because a display name is required, though you can change it. <code>pillars</code> cannot be cleared because a profile must target at least one pillar.</p> <p> <code>aggregationConfiguration</code> behaves differently because it is a list of per-account configurations rather than a text field. Supplying an empty list removes every account entry, but the field itself remains set: a subsequent read returns an empty list rather than omitting the field. Omitting it from the request keeps the stored entries.</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. Omit this field to keep the current display name. A display name is required, so it cannot be cleared.</p>
        description: <p>The updated description of the profile. Omit this field to keep the current description, or supply an empty string to clear it; a cleared description is read back as absent rather than as an empty string.</p>
        execution_role_arn: <p>The updated ARN of the IAM execution role. Omit this field to keep the current execution role.</p>
        aggregation_configuration: <p>The updated aggregation configuration, as a list of per-account entries. Omit this field to keep the current entries, or supply an empty list to remove them all. The field remains set either way — an emptied configuration is read back as an empty list, not as an absent field.</p>
        business_overview: <p>The updated business overview for the profile. Omit this field to keep the current business overview, or supply an empty string to clear it; a cleared business overview is read back as absent rather than as an empty string.</p>
        pillars: <p>The updated Amazon Web Services Well-Architected Framework pillars for the profile. Omit this field to keep the current pillars. A profile must target at least one pillar, so an empty list is rejected.</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.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.
    """

    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