put_endpoint_policy
async
¶
put_endpoint_policy(
*,
config_overrides: Optional[AsyncSageMakerClientConfig] = 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/async_sage_maker.py
30038 30039 30040 30041 30042 30043 30044 30045 30046 30047 30048 30049 30050 30051 30052 30053 30054 30055 30056 30057 30058 30059 30060 30061 30062 30063 30064 30065 30066 30067 30068 30069 30070 30071 30072 30073 30074 30075 30076 30077 30078 30079 30080 30081 30082 30083 30084 30085 30086 30087 30088 30089 30090 | |