associateWorkspaceEnforcedPolicy

Associates a WorkSpace-enforced policy with the specified WorkSpace, replacing its current WorkSpace-enforced policy. If the WorkSpace can't apply the policy, the policy stays associated and the operation returns PolicyApplyFailedException. If the WorkSpace is in a state that doesn't allow the change, the policy is being deleted, or another request changed the WorkSpace's WorkSpace-enforced policy at the same time, the operation returns ConflictException.

Samples

// The following example applies a WorkSpace enforced policy to a WorkSpace.
val resp = workSpacesClient.associateWorkspaceEnforcedPolicy {
    workspaceId = "ws-dk1example1"
    policyId = "wsep-a1b2c3d4"
}