put_resource_policy
¶
put_resource_policy(
policy_name: PolicyName,
policy_document: PolicyDocument,
*,
config_overrides: Optional[XRayClientConfig] = None,
policy_revision_id: Optional[PolicyRevisionId] = None,
bypass_policy_lockout_check: Optional[Boolean] = None,
) -> PutResourcePolicyResult
Sets the resource policy to grant one or more Amazon Web Services services and accounts permissions to access X-Ray. Each resource policy will be associated with a specific Amazon Web Services account. Each Amazon Web Services account can have a maximum of 5 resource policies, and each policy name must be unique within that account. The maximum size of each resource policy is 5KB.
Parameters:
-
policy_name(PolicyName) –The name of the resource policy. Must be unique within a specific Amazon Web Services account.
-
policy_document(PolicyDocument) –The resource policy document, which can be up to 5kb in size.
-
policy_revision_id(Optional[PolicyRevisionId], default:None) –Specifies a specific policy revision, to ensure an atomic create operation. By default the resource policy is created if it does not exist, or updated with an incremented revision id. The revision id is unique to each policy in the account.
If the policy revision id does not match the latest revision id, the operation will fail with an
InvalidPolicyRevisionIdExceptionexception. You can also provide aPolicyRevisionIdof 0. In this case, the operation will fail with anInvalidPolicyRevisionIdExceptionexception if a resource policy with the same name already exists. -
bypass_policy_lockout_check(Optional[Boolean], default:None) –A flag to indicate whether to bypass the resource policy lockout safety check.
Setting this value to true increases the risk that the policy becomes unmanageable. Do not set this value to true indiscriminately.
Use this parameter only when you include a policy in the request and you intend to prevent the principal that is making the request from making a subsequent
PutResourcePolicyrequest.The default value is false.
Raises:
-
InvalidPolicyRevisionIdException–A policy revision id was provided which does not match the latest policy revision. This exception is also if a policy revision id of 0 is provided via
PutResourcePolicyand a policy with the same name already exists. -
LockoutPreventionException–The provided resource policy would prevent the caller of this request from calling PutResourcePolicy in the future.
-
MalformedPolicyDocumentException–Invalid policy document provided in request.
-
PolicyCountLimitExceededException–Exceeded the maximum number of resource policies for a target Amazon Web Services account.
-
PolicySizeLimitExceededException–Exceeded the maximum size for a resource policy.
-
ThrottledException–The request exceeds the maximum number of requests per second.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_xray/_services/x_ray.py
2038 2039 2040 2041 2042 2043 2044 2045 2046 2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065 2066 2067 2068 2069 2070 2071 2072 2073 2074 2075 2076 2077 2078 2079 2080 2081 2082 2083 2084 2085 2086 2087 2088 2089 2090 2091 2092 2093 2094 2095 2096 2097 2098 2099 | |