Example usage for com.amazonaws.services.ec2.model IamInstanceProfileSpecification getName

List of usage examples for com.amazonaws.services.ec2.model IamInstanceProfileSpecification getName

Introduction

In this page you can find the example usage for com.amazonaws.services.ec2.model IamInstanceProfileSpecification getName.

Prototype


public String getName() 

Source Link

Document

The name of the instance profile.

Usage

From source file:de.tuhrig.deployman.launch.Launcher.java

private CreateLaunchConfigurationRequest createLaunchConfigurationRequest(Formation formation) {
    Machine machine = formation.getMachine();
    Scaling scaling = machine.getScaling();

    Properties generalProperties = getMetaInformationProperties(formation);
    CloudInitScript initScript = getParallelCloudInitScript(machine, generalProperties);
    IamInstanceProfileSpecification profil = this.ec2Client
            .getIamInstanceProfileSpecification(getUserProperty(REPO_PROFILE));

    return new CreateLaunchConfigurationRequest().withLaunchConfigurationName(scaling.getName())
            .withInstanceType(machine.getInstanceType()).withImageId(machine.getImageId())
            .withUserData(initScript.renderAsBase64()).withSecurityGroups(machine.getSecurityGroup())
            .withIamInstanceProfile(profil.getName())
            // the name NOT the ARN!
            .withKeyName(getUserProperty(EC2_INSTANCE_KEY))
            .withInstanceMonitoring(new InstanceMonitoring().withEnabled(false));

}