put_endpoint_policy
¶
put_endpoint_policy(
*,
config_overrides: Optional[SageMakerClientConfig] = None,
endpoint_name: Optional[EndpointName] = None,
resource_policy: Optional[EndpointPolicyDocument] = None,
) -> PutEndpointPolicyResponse
Attaches a resource-based policy to an endpoint. With an endpoint policy, you can allow other Amazon Web Services accounts to send requests to your endpoint, or to inference components on it, through an inference router. The policy that you specify replaces the endpoint's existing policy, if it has one.
You can't attach a policy to an endpoint whose status is Deleting or Failed. SageMaker AI rejects a policy that doesn't follow the endpoint policy rules. For information about the policy rules, see Use destinations in other accounts.
Policy changes typically take effect within 30 seconds, and can take up to 5 minutes. If you delete the endpoint, its policy is also deleted, and a new endpoint with the same name has no policy.
Parameters:
-
endpoint_name(Optional[EndpointName], default:None) –The name of the endpoint. The endpoint must be in your account and in the current Amazon Web Services Region.
-
resource_policy(Optional[EndpointPolicyDocument], default:None) –The endpoint policy, as a JSON policy document. The policy can contain only ASCII characters. For information about the policy rules, see Use destinations in other accounts.
Raises:
-
ResourceNotFound–Resource being access is not found.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_sagemaker/_services/sage_maker.py
29669 29670 29671 29672 29673 29674 29675 29676 29677 29678 29679 29680 29681 29682 29683 29684 29685 29686 29687 29688 29689 29690 29691 29692 29693 29694 29695 29696 29697 29698 29699 29700 29701 29702 29703 29704 29705 29706 29707 29708 29709 29710 29711 29712 29713 29714 29715 29716 29717 29718 29719 29720 | |