Search in sources :

Example 11 with IamClient

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

the class DetachRolePolicy method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "    <roleName> <policyArn> \n\n" + "Where:\n" + "    roleName - a role name that you can obtain from the AWS Management Console. \n\n" + "    policyArn - a policy ARN that you can obtain from the AWS Management Console. \n\n";
    if (args.length != 2) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String roleName = args[0];
    String policyArn = args[1];
    Region region = Region.AWS_GLOBAL;
    IamClient iam = IamClient.builder().region(region).build();
    detachPolicy(iam, roleName, policyArn);
    System.out.println("Done");
    iam.close();
}
Also used : IamClient(software.amazon.awssdk.services.iam.IamClient) Region(software.amazon.awssdk.regions.Region)

Example 12 with IamClient

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

the class ListServerCertificates method main.

public static void main(String[] args) {
    Region region = Region.AWS_GLOBAL;
    IamClient iam = IamClient.builder().region(region).build();
    listCertificates(iam);
    System.out.println("Done");
    iam.close();
}
Also used : IamClient(software.amazon.awssdk.services.iam.IamClient) Region(software.amazon.awssdk.regions.Region)

Example 13 with IamClient

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

the class UpdateAccessKey method main.

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

Example 14 with IamClient

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

the class CreateAccessKey method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "   <user> \n\n" + "Where:\n" + "   user - an AWS IAM user that you can obtain from the AWS Management Console.\n\n";
    if (args.length != 1) {
        System.out.println(USAGE);
        System.exit(1);
    }
    String user = args[0];
    Region region = Region.AWS_GLOBAL;
    IamClient iam = IamClient.builder().region(region).build();
    String keyId = createIAMAccessKey(iam, user);
    System.out.println("The Key Id is " + keyId);
    iam.close();
}
Also used : IamClient(software.amazon.awssdk.services.iam.IamClient) Region(software.amazon.awssdk.regions.Region)

Example 15 with IamClient

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

the class DeleteAccountAlias method main.

public static void main(String[] args) {
    final String USAGE = "\n" + "Usage:\n" + "    <alias> \n\n" + "Where:\n" + "    alias - the account alias to delete. \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();
    deleteIAMAccountAlias(iam, alias);
    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