Search in sources :

Example 6 with IamClient

use of software.amazon.awssdk.services.iam.IamClient in project aws-doc-sdk-examples by awsdocs.

the class DeleteAccessKey method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "    <username> <accessKey> \n\n" + "Where:\n" + "    username - the name of the user. \n\n" + "    accessKey - the access key ID for the secret access key you want to delete. \n\n";
    if (args.length != 2) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String username = args[0];
    String accessKey = args[1];
    Region region = Region.AWS_GLOBAL;
    IamClient iam = IamClient.builder().region(region).build();
    deleteKey(iam, username, accessKey);
    iam.close();
}
Also used : IamClient(software.amazon.awssdk.services.iam.IamClient) Region(software.amazon.awssdk.regions.Region)

Example 7 with IamClient

use of software.amazon.awssdk.services.iam.IamClient in project aws-doc-sdk-examples by awsdocs.

the class DeletePolicy method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "    <policyARN> \n\n" + "Where:\n" + "    policyARN - a policy ARN value to delete. \n\n";
    if (args.length != 1) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String policyARN = args[0];
    Region region = Region.AWS_GLOBAL;
    IamClient iam = IamClient.builder().region(region).build();
    deleteIAMPolicy(iam, policyARN);
    iam.close();
}
Also used : IamClient(software.amazon.awssdk.services.iam.IamClient) Region(software.amazon.awssdk.regions.Region)

Example 8 with IamClient

use of software.amazon.awssdk.services.iam.IamClient in project aws-doc-sdk-examples by awsdocs.

the class CreatePolicy method main.

// snippet-end:[iam.java2.create_policy.policy_document]
public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "    CreatePolicy <policyName> \n\n" + "Where:\n" + "    policyName - a unique policy name. \n\n";
    if (args.length != 1) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String policyName = args[0];
    Region region = Region.AWS_GLOBAL;
    IamClient iam = IamClient.builder().region(region).build();
    String result = createIAMPolicy(iam, policyName);
    System.out.println("Successfully created a policy with this ARN value: " + result);
    iam.close();
}
Also used : IamClient(software.amazon.awssdk.services.iam.IamClient) Region(software.amazon.awssdk.regions.Region)

Example 9 with IamClient

use of software.amazon.awssdk.services.iam.IamClient in project aws-doc-sdk-examples by awsdocs.

the class CreateUser method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "    <username> \n\n" + "Where:\n" + "    username - the name of the user to create. \n\n";
    if (args.length != 1) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String username = args[0];
    Region region = Region.AWS_GLOBAL;
    IamClient iam = IamClient.builder().region(region).build();
    String result = createIAMUser(iam, username);
    System.out.println("Successfully created user: " + result);
    iam.close();
}
Also used : IamClient(software.amazon.awssdk.services.iam.IamClient) Region(software.amazon.awssdk.regions.Region)

Example 10 with IamClient

use of software.amazon.awssdk.services.iam.IamClient in project aws-doc-sdk-examples by awsdocs.

the class DeleteServerCertificate method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "    <certName> \n\n" + "Where:\n" + "    certName - a certificate name to delete. \n\n";
    if (args.length != 1) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String certName = args[0];
    Region region = Region.AWS_GLOBAL;
    IamClient iam = IamClient.builder().region(region).build();
    deleteCert(iam, certName);
    System.out.println("Done");
    iam.close();
}
Also used : IamClient(software.amazon.awssdk.services.iam.IamClient) Region(software.amazon.awssdk.regions.Region)

Aggregations

IamClient (software.amazon.awssdk.services.iam.IamClient)24 Region (software.amazon.awssdk.regions.Region)23 DatasetProvider (com.amazonaws.personalize.client.datasets.DatasetProvider)1 MovieLensDatasetProvider (com.amazonaws.personalize.client.datasets.MovieLensDatasetProvider)1 CampaignManager (com.amazonaws.personalize.client.resource.CampaignManager)1 EventTrackerManager (com.amazonaws.personalize.client.resource.EventTrackerManager)1 PersonalizeClient (software.amazon.awssdk.services.personalize.PersonalizeClient)1 PersonalizeEventsClient (software.amazon.awssdk.services.personalizeevents.PersonalizeEventsClient)1 PersonalizeRuntimeClient (software.amazon.awssdk.services.personalizeruntime.PersonalizeRuntimeClient)1 S3Client (software.amazon.awssdk.services.s3.S3Client)1