createPolicyStore
inline suspend fun VerifiedPermissionsClient.createPolicyStore(crossinline block: CreatePolicyStoreRequest.Builder.() -> Unit): CreatePolicyStoreResponse
Creates a policy store. A policy store is a container for policy resources.
Although Cedar supports multiple namespaces, Verified Permissions currently supports only one namespace per policy store.
Verified Permissions is eventually consistent. It can take a few seconds for a new or changed element to propagate through the service and be visible in the results of other Verified Permissions operations.
Samples
import aws.sdk.kotlin.services.verifiedpermissions.model.EncryptionSettings
import aws.sdk.kotlin.services.verifiedpermissions.model.KmsEncryptionSettings
import aws.sdk.kotlin.services.verifiedpermissions.model.ValidationMode
import aws.sdk.kotlin.services.verifiedpermissions.model.ValidationSettings
fun main() {
//sampleStart
// The following example creates a new policy store with strict validation turned on.
val resp = verifiedPermissionsClient.createPolicyStore {
validationSettings = ValidationSettings {
mode = ValidationMode.fromValue("STRICT")
}
clientToken = "a1b2c3d4-e5f6-a1b2-c3d4-TOKEN1111111"
}
//sampleEnd
}import aws.sdk.kotlin.services.verifiedpermissions.model.EncryptionSettings
import aws.sdk.kotlin.services.verifiedpermissions.model.KmsEncryptionSettings
import aws.sdk.kotlin.services.verifiedpermissions.model.ValidationMode
import aws.sdk.kotlin.services.verifiedpermissions.model.ValidationSettings
fun main() {
//sampleStart
// The following example creates a new policy store with encryption settings based on a provided KMS
// key.
val resp = verifiedPermissionsClient.createPolicyStore {
validationSettings = ValidationSettings {
mode = ValidationMode.fromValue("STRICT")
}
encryptionSettings = EncryptionSettings.KmsEncryptionSettings(KmsEncryptionSettings {
key = "arn:aws:kms:us-east-1:123456789012:key/abcdefgh-ijkl-mnop-qrst-uvwxyz123456"
encryptionContext = mapOf<String, String>(
"policy_store_owner" to "Tim"
)
}
)
clientToken = "a1b2c3d4-e5f6-a1b2-c3d4-TOKEN1111111"
}
//sampleEnd
}