RetireGrant.java - AWS Code Sample

RetireGrant.java

RetireGrant.java demonstrates how to retire a grant for an AWS KMS customer master key.

package aws.example.kms; import com.amazonaws.services.kms.AWSKMS; import com.amazonaws.services.kms.AWSKMSClientBuilder; import com.amazonaws.services.kms.model.RetireGrantRequest; import com.amazonaws.services.kms.model.RetireGrantResult; public class RetireGrant { public static void main(String[] args) { AWSKMS kmsClient = AWSKMSClientBuilder.standard().build(); // Retire a grant // String grantToken = "Place your grant token here"; RetireGrantRequest request = new RetireGrantRequest().withGrantToken(grantToken); RetireGrantResult response = kmsClient.retireGrant(request); } }

Sample Details

Service: kms

Last tested: 2019-04-08

Author: AWS

Type: full-example