Menetapkan kebijakan secret untuk sebuah secret dalam instance KMS.
Deskripsi operasi
-
Untuk informasi mengenai kebijakan akses yang diperlukan oleh pengguna RAM atau role RAM untuk memanggil operasi ini, lihat Resource Access Management.
-
Untuk informasi selengkapnya mengenai kebijakan secret, lihat Secret policy overview.
Coba sekarang
Test
RAM authorization
Parameter permintaan
|
Parameter |
Type |
Required |
Description |
Example |
| SecretName |
string |
Yes |
Nama atau Alibaba Cloud Resource Name (ARN) dari secret tersebut. Catatan
Saat Anda mengakses secret di Akun Alibaba Cloud lain, Anda harus menentukan ARN secret tersebut. Format ARN secret adalah |
secret_test |
| PolicyName |
string |
No |
Nama kebijakan secret. Nilainya hanya dapat berupa `default`. |
default |
| Policy |
string |
Yes |
Konten kebijakan secret. Nilainya harus dalam format JSON dan panjangnya tidak boleh melebihi 32.768 byte. Kebijakan secret terdiri atas elemen-elemen berikut:
Kode berikut menunjukkan format kebijakan secret:
Bagian berikut menjelaskan elemen-elemen dalam suatu pernyataan:
Catatan
Setelah Anda memberikan izin kepada RAM user atau RAM role dari Akun Alibaba Cloud lain, Anda harus masuk ke Konsol RAM dan menggunakan Akun Alibaba Cloud tempat RAM user atau RAM role tersebut berada untuk memberikan izin kepada mereka agar dapat menggunakan secret tersebut. Untuk informasi selengkapnya, lihat Custom policies for KMS, Grant permissions to a RAM user, dan Grant permissions to a RAM role. |
{"Version":"1","Statement": [{"Sid":"kms default secret policy","Effect":"Allow","Principal":{"RAM": ["acs:ram::119285303511****:*"]},"Action":["kms:*"],"Resource": ["*"] }] } |
Elemen respons
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
ID permintaan, yaitu pengenal unik yang dihasilkan oleh Alibaba Cloud. Anda dapat menggunakan ID ini untuk memecahkan masalah. |
381D5D33-BB8F-395F-8EE4-AE3BB4B523C8 |
Contoh
Respons sukses
JSONformat
{
"RequestId": "381D5D33-BB8F-395F-8EE4-AE3BB4B523C8"
}
Kode kesalahan
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | MissingParameter | The parameter needed but no provided. | The required parameters are not specified. |
| 400 | InvalidParameter | The specified parameter is not valid. | An invalid value is specified for the parameter. |
| 400 | Forbidden.NoPermission | This operation is forbidden by permission system. | You are not authorized to perform this operation. |
| 400 | Forbidden.KeyPolicyUnSupported | The specified key does not support key policy. | The specified key does not support key policies. |
| 400 | Rejected.ShareQuotaExceedLimit | Instance Share Quota Exceed Limit. | The instance share quota exceeds the limit. |
| 403 | Forbidden.DKMSInstanceStateInvalid | The DKMS instance state is invalid. | Your dedicated KMS instance is invalid. |
| 404 | Forbidden.ResourceNotFound | Resource not found. | The resource is not found. |
| 404 | Forbidden.KeyNotFound | The specified Key is not found. | The error message returned because the specified CMK does not exist. |
| 503 | SerivceUnvailableTemporary | Service Unvailable Temporary | The service is temporarily unavailable. |
Lihat Error Codes untuk daftar lengkap.
Catatan rilis
Lihat Release Notes untuk daftar lengkap.