set_vault_access_policy
¶
set_vault_access_policy(
account_id: string,
vault_name: string,
*,
config_overrides: Optional[GlacierClientConfig] = None,
policy: Optional[VaultAccessPolicy] = None,
) -> None
This operation configures an access policy for a vault and will overwrite an existing policy. To configure a vault access policy, send a PUT request to the access-policy subresource of the vault. An access policy is specific to a vault and is also called a vault subresource. You can set one access policy per vault and the policy can be up to 20 KB in size. For more information about vault access policies, see Amazon Glacier Access Control with Vault Access Policies.
Parameters:
-
account_id(string) –The
AccountIdvalue is the AWS account ID of the account that owns the vault. You can either specify an AWS account ID or optionally a single '-' (hyphen), in which case Amazon Glacier uses the AWS account ID associated with the credentials used to sign the request. If you use an account ID, do not include any hyphens ('-') in the ID. -
vault_name(string) –The name of the vault.
-
policy(Optional[VaultAccessPolicy], default:None) –The vault access policy as a JSON string.
Raises:
-
InvalidParameterValueException–Returned if a parameter of the request is incorrectly specified.
-
MissingParameterValueException–Returned if a required header or parameter is missing from the request.
-
NoLongerSupportedException–Returned if the request was made by a customer with no Amazon Glacier storage. The request is denied as the API is no longer supported for new customers. Please use Amazon S3 Glacier storage classes instead.
-
ResourceNotFoundException–Returned if the specified resource (such as a vault, upload ID, or job ID) doesn't exist.
-
ServiceUnavailableException–Returned if the service cannot complete the request.
-
UnknownServiceError–The service returned an error code this client does not model.
Examples:
To set the access-policy on a vault The example configures an access policy for the vault named examplevault.
>>> client.set_vault_access_policy(account_id='-', vault_name='examplevault', policy={'Policy': '{"Version":"2012-10-17","Statement":[{"Sid":"Define-owner-access-rights","Effect":"Allow","Principal":{"AWS":"arn:aws:iam::999999999999:root"},"Action":"glacier:DeleteArchive","Resource":"arn:aws:glacier:us-west-2:999999999999:vaults/examplevault"}]}'})
Source code in docs_src/capo_glacier/_services/glacier.py
2174 2175 2176 2177 2178 2179 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2221 2222 2223 2224 2225 2226 2227 2228 2229 2230 2231 2232 2233 2234 | |