deletePolicyStoreAlias

Deletes the specified policy store alias.

This operation is idempotent. If you specify a policy store alias that does not exist, the request response will still return a successful HTTP 200 status code.

By default, when a policy store alias is deleted, it enters the PendingDeletion state. When a policy store alias is in the PendingDeletion state, new policy store aliases cannot be created with the same name. If the policy store alias is used in an API that has a policyStoreId field, the operation will fail with a ResourceNotFound exception.

To immediately delete a policy store alias and bypass the PendingDeletion state, set the deletionMode parameter to HardDelete.

Verified Permissions is eventually consistent. If you hard delete a policy store alias and then immediately recreate it to be associated with a different policy store, requests that reference this alias may continue to be evaluated against the previously associated policy store for a short period of time.

Samples

// The following example soft deletes the policy store alias with name example policy store. The alias
// enters the PendingDeletion state.
val resp = verifiedPermissionsClient.deletePolicyStoreAlias {
    aliasName = "policy-store-alias/example-policy-store"
}
// The following example hard deletes the policy store alias with name example policy store. The alias
// is immediately deleted, bypassing the PendingDeletion state.
val resp = verifiedPermissionsClient.deletePolicyStoreAlias {
    aliasName = "policy-store-alias/example-policy-store"
    deletionMode = DeletionMode.fromValue("HardDelete")
}