put_resource_policy
async
¶
put_resource_policy(
policy_name: PolicyName,
policy_document: PolicyDocument,
*,
config_overrides: Optional[AsyncXRayClientConfig] = 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/async_x_ray.py
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 2100 2101 2102 2103 2104 2105 2106 2107 2108 2109 2110 2111 2112 2113 2114 2115 2116 2117 2118 2119 2120 2121 2122 2123 2124 2125 2126 2127 2128 2129 2130 2131 2132 2133 2134 2135 2136 | |