attachPolicy
inline suspend fun CloudDirectoryClient.attachPolicy(crossinline block: AttachPolicyRequest.Builder.() -> Unit): AttachPolicyResponse
Attaches a policy object to a regular object. An object can have a limited number of attached policies.
Samples
import aws.sdk.kotlin.services.clouddirectory.model.ObjectReference
fun main() {
//sampleStart
val resp = cloudDirectoryClient.attachPolicy {
directoryArn = "arn:aws:clouddirectory:us-west-2:45132example:directory/AYb8AOV81kHNgdj8mAO3dNY"
policyReference = ObjectReference {
selector = "$AQGG_ADlfNZBzYHY_JgDt3TWgcBsTVmcQEWs6jlygfhuew"
}
objectReference = ObjectReference {
selector = "$AQGG_ADlfNZBzYHY_JgDt3TWQoovm1s3Ts2v0NKrzdVnPw"
}
}
//sampleEnd
}