Example usage for com.amazonaws.services.identitymanagement.model PutGroupPolicyRequest setPolicyDocument

List of usage examples for com.amazonaws.services.identitymanagement.model PutGroupPolicyRequest setPolicyDocument

Introduction

In this page you can find the example usage for com.amazonaws.services.identitymanagement.model PutGroupPolicyRequest setPolicyDocument.

Prototype


public void setPolicyDocument(String policyDocument) 

Source Link

Document

The policy document.

Usage

From source file:org.cloudfoundry.community.servicebroker.s3.service.Iam.java

License:Apache License

public void applyGroupPolicy(String groupName, String policyName, String bucketName) {
    // https://forums.aws.amazon.com/message.jspa?messageID=356160
    PutGroupPolicyRequest request = new PutGroupPolicyRequest();
    logger.info("Putting policy document on group '{}': {}", groupName,
            bucketGroupPolicy.policyDocumentForBucket(bucketName));
    request.setGroupName(groupName);//from ww  w  .  j a  va2  s . c o m
    request.setPolicyName(policyName);
    request.setPolicyDocument(bucketGroupPolicy.policyDocumentForBucket(bucketName));
    iam.putGroupPolicy(request);
}