public String createAndUploadPolicyExample(IamClient iam, String accountID, String policyName) {
                // Build the policy.
                IamPolicy policy = IamPolicy.builder() // 'version' defaults to "2012-10-17".
                                .addStatement(IamStatement.builder()
                                                .effect(IamEffect.ALLOW)
                                                .addAction("dynamodb:PutItem")
                                                .addResource("arn:aws:dynamodb:us-east-1:" + accountID
                                                                + ":table/exampleTableName")
                                                .build())
                                .build();
                // Upload the policy.
                iam.createPolicy(r -> r.policyName(policyName).policyDocument(policy.toJson()));
                return policy.toJson(IamPolicyWriter.builder().prettyPrint(true).build());
        }
@Test
    @Tag("IntegrationTest")
    void createAndUploadPolicyExample() {
        String accountId = examples.getAccountID();
        String policyName = "AllowPutItemToExampleTable";
        String jsonPolicy = examples.createAndUploadPolicyExample(iam, accountId, policyName);
        logger.info(jsonPolicy);

        GetPolicyResponse putItemPolicy = iam
                .getPolicy(b -> b.policyArn("arn:aws:iam::" + accountId + ":policy/" + policyName));
        iam.deletePolicy(b -> b.policyArn(putItemPolicy.policy().arn()));
        logger.info("Policy [{}] deleted", putItemPolicy.policy().arn());
    }