Amazon Web Services Bootcamp
上QQ阅读APP看书,第一时间看更新

Attaching a group policy

The following code attaches the managed policy under the group:

attachGroupPolicy(groupName, policyARN); 
........ 
public void attachGroupPolicy(
String groupName,
String policyARN) {
AttachGroupPolicyRequest attachGroupPolicyRequest =
new AttachGroupPolicyRequest()
.withGroupName(groupName)
.withPolicyArn(policyARN);

AttachGroupPolicyResult attachGroupPolicyResult =
amazonIdentityManagement.
attachGroupPolicy(attachGroupPolicyRequest);
}