Search in sources :

Example 21 with IamClient

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

the class UpdateUser method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "    <curName> <newName> \n\n" + "Where:\n" + "    curName - the current user name. \n\n" + "    newName - an updated user name. \n\n";
    if (args.length != 2) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String curName = args[0];
    String newName = args[1];
    Region region = Region.AWS_GLOBAL;
    IamClient iam = IamClient.builder().region(region).build();
    updateIAMUser(iam, curName, newName);
    System.out.println("Done");
    iam.close();
}
Also used : IamClient(software.amazon.awssdk.services.iam.IamClient) Region(software.amazon.awssdk.regions.Region)

Example 22 with IamClient

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

the class CreateAccountAlias method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "    <alias> \n\n" + "Where:\n" + "    alias - the account alias to create (for example, myawsaccount). \n\n";
    if (args.length != 1) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String alias = args[0];
    Region region = Region.AWS_GLOBAL;
    IamClient iam = IamClient.builder().region(region).build();
    createIAMAccountAlias(iam, alias);
    iam.close();
    System.out.println("Done");
}
Also used : IamClient(software.amazon.awssdk.services.iam.IamClient) Region(software.amazon.awssdk.regions.Region)

Example 23 with IamClient

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

the class CreateRole method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "    <rolename> <fileLocation> \n\n" + "Where:\n" + "    rolename - the name of the role to create. \n\n" + "    fileLocation - the location of the JSON document that represents the trust policy. \n\n";
    if (args.length != 2) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String rolename = args[0];
    String fileLocation = args[1];
    Region region = Region.AWS_GLOBAL;
    IamClient iam = IamClient.builder().region(region).build();
    String result = createIAMRole(iam, rolename, fileLocation);
    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 24 with IamClient

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

the class DeleteUser 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 delete. \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();
    deleteIAMUser(iam, userName);
    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