Access policy
VK Object Storage allows configuring access to a bucket and objects using an access policy.
-
Go to the VK Cloud management console.
-
Select the project where the desired bucket is located.
-
Go to the Object Storage → Buckets section.
-
Click
for the desired bucket and select Settings.
-
Go to the Access Policies tab.
-
Click the Edit Bucket Policy button.
-
Enable or disable the access policies.
-
Go to the VK Cloud management console.
-
Select the project where the desired bucket is located.
-
Go to the Object Storage → Buckets section.
-
Click
for the desired bucket and select Settings.
-
Go to the Access Policies tab.
-
Click the Edit Ownership control ACL button.
-
Enable or disable the Access Control Lists (ACL) option.
-
Install and configure the AWS CLI, if it is not installed yet.
-
Retrieve the configuration using the command:
aws s3api get-bucket-policy \--bucket <BUCKET_NAME> \--query Policy \--output text \--endpoint <ENDPOINT_URL>Here:
-
<BUCKET_NAME>— the name of the bucket for which you need to retrieve the access policy configuration. -
<ENDPOINT_URL>— must match the account region:https://hb.vkcloud-storage.ruorhttps://hb.ru-msk.vkcloud-storage.ru— the domain of the Moscow region;https://hb.kz-ast.vkcloud-storage.ru— the domain of the Kazakhstan region.
-
-
Install and configure the AWS CLI, if it is not installed yet.
-
Create a new configuration file
<CONFIGURATION>.json. -
In the file, specify the access policy configuration.
-
Upload the new configuration using the command:
aws s3api put-bucket-policy \--bucket <BUCKET_NAME> \--policy=file://<CONFIGURATION>.json--endpoint <ENDPOINT_URL>Here:
-
<BUCKET_NAME>— the name of the bucket for which you need to apply the access policy configuration. -
<CONFIGURATION>— the name of the access policy configuration file in JSON format. -
<ENDPOINT_URL>— must match the account region:https://hb.vkcloud-storage.ruorhttps://hb.ru-msk.vkcloud-storage.ru— the domain of the Moscow region;https://hb.kz-ast.vkcloud-storage.ru— the domain of the Kazakhstan region.
-
-
Install and configure the AWS CLI, if it is not installed yet.
-
Save the configuration locally to a file
<CONFIGURATION>.jsonusing the command:aws s3api get-bucket-policy \--bucket <BUCKET_NAME> \--query Policy \--output text \--endpoint <ENDPOINT_URL> \> <CONFIGURATION>.jsonHere:
-
<BUCKET_NAME>— the name of the bucket for which you need to edit the access policy configuration. -
<ENDPOINT_URL>— must match the account region:https://hb.vkcloud-storage.ruorhttps://hb.ru-msk.vkcloud-storage.ru— the domain of the Moscow region;https://hb.kz-ast.vkcloud-storage.ru— the domain of the Kazakhstan region.
-
<CONFIGURATION>— the name of the access policy configuration file in JSON format.
-
-
Make the necessary changes to the
<CONFIGURATION>.jsonfile. If necessary, set other configuration parameters. -
Apply the new configuration:
aws s3api put-bucket-policy \--bucket <BUCKET_NAME> \--policy=file://<CONFIGURATION>.json--endpoint <ENDPOINT_URL>Here:
-
<BUCKET_NAME>— the name of the bucket for which you need to apply the access policy configuration. -
<CONFIGURATION>— the name of the access policy configuration file in JSON format. -
<ENDPOINT_URL>— must match the account region:https://hb.vkcloud-storage.ruorhttps://hb.ru-msk.vkcloud-storage.ru— the domain of the Moscow region;https://hb.kz-ast.vkcloud-storage.ru— the domain of the Kazakhstan region.
-
-
Install and configure the AWS CLI, if it is not installed yet.
-
Delete the configuration using the command:
aws s3api delete-bucket-policy \--bucket <BUCKET_NAME> \--endpoint <ENDPOINT_URL>Here:
-
<BUCKET_NAME>— the name of the bucket for which you need to delete the access policy configuration. -
<ENDPOINT_URL>— must match the account region:https://hb.vkcloud-storage.ruorhttps://hb.ru-msk.vkcloud-storage.ru— the domain of the Moscow region;https://hb.kz-ast.vkcloud-storage.ru— the domain of the Kazakhstan region.
-