Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * Copyright 2010 Amazon.com, Inc. or its affiliates. All Rights Reserved.
   * 
   * Licensed under the Apache License, Version 2.0 (the "License").
   * You may not use this file except in compliance with the License.
   * A copy of the License is located at
   * 
   *  http://aws.amazon.com/apache2.0
   * 
  * or in the "license" file accompanying this file. This file is distributed
  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
  * express or implied. See the License for the specific language governing
  * permissions and limitations under the License.
  */
 package com.amazonaws.services.autoscaling.model;
Container for the parameters to the CreateLaunchConfiguration operation.

Creates a new launch configuration. Once created, the new launch configuration is available for immediate use.

NOTE: The launch configuration name used must be unique, within the scope of the client's AWS account, and the maximum limit of launch configurations must not yet have been met, or else the call will fail.

 
 public class CreateLaunchConfigurationRequest extends AmazonWebServiceRequest {

    
The name of the launch configuration to create.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 
     private String launchConfigurationName;

    
Unique ID of the Amazon Machine Image (AMI) which was assigned during registration. For more information about Amazon EC2 images, please see Amazon EC2 product documentation

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 
     private String imageId;

    
The name of the EC2 key pair.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 
     private String keyName;

    
A list of names of the security groups with which to associate EC2 instances. For more information about Amazon EC2 security groups, please see Amazon EC2 product documentation
 
     private java.util.List<StringsecurityGroups;

    
The user data available to the launched EC2 instances. For more information about Amazon EC2 user data, please see Amazon EC2 product documentation

Constraints:
Length: 0 - 21847
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 
     private String userData;

    
The instance type of the EC2 instance. For more information about Amazon EC2 instance types, please see Amazon EC2 product documentation

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

 
     private String instanceType;

    
The ID of the kernel associated with the EC2 AMI.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

    private String kernelId;

    
The ID of the RAM disk associated with the EC2 AMI.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

    private String ramdiskId;

    
Specifies how block devices are exposed to the instance. Each mapping is made up of a VirtualName and a DeviceName. For more information about Amazon EC2 BlockDeviceMappings, please see Amazon EC2 product documentation
The name of the launch configuration to create.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
The name of the launch configuration to create.
        return ;
    }
    
    
The name of the launch configuration to create.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
launchConfigurationName The name of the launch configuration to create.
    public void setLaunchConfigurationName(String launchConfigurationName) {
        this. = launchConfigurationName;
    }
    
    
The name of the launch configuration to create.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
launchConfigurationName The name of the launch configuration to create.
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateLaunchConfigurationRequest withLaunchConfigurationName(String launchConfigurationName) {
        this. = launchConfigurationName;
        return this;
    }
    
    
    
Unique ID of the Amazon Machine Image (AMI) which was assigned during registration. For more information about Amazon EC2 images, please see Amazon EC2 product documentation

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
Unique ID of the Amazon Machine Image (AMI) which was assigned during registration. For more information about Amazon EC2 images, please see Amazon EC2 product documentation
    public String getImageId() {
        return ;
    }
    
    
Unique ID of the Amazon Machine Image (AMI) which was assigned during registration. For more information about Amazon EC2 images, please see Amazon EC2 product documentation

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
imageId Unique ID of the Amazon Machine Image (AMI) which was assigned during registration. For more information about Amazon EC2 images, please see Amazon EC2 product documentation
    public void setImageId(String imageId) {
        this. = imageId;
    }
    
    
Unique ID of the Amazon Machine Image (AMI) which was assigned during registration. For more information about Amazon EC2 images, please see Amazon EC2 product documentation

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
imageId Unique ID of the Amazon Machine Image (AMI) which was assigned during registration. For more information about Amazon EC2 images, please see Amazon EC2 product documentation
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = imageId;
        return this;
    }
    
    
    
The name of the EC2 key pair.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
The name of the EC2 key pair.
    public String getKeyName() {
        return ;
    }
    
    
The name of the EC2 key pair.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
keyName The name of the EC2 key pair.
    public void setKeyName(String keyName) {
        this. = keyName;
    }
    
    
The name of the EC2 key pair.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
keyName The name of the EC2 key pair.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = keyName;
        return this;
    }
    
    
    
A list of names of the security groups with which to associate EC2 instances. For more information about Amazon EC2 security groups, please see Amazon EC2 product documentation

Returns:
A list of names of the security groups with which to associate EC2 instances. For more information about Amazon EC2 security groups, please see Amazon EC2 product documentation
    public java.util.List<StringgetSecurityGroups() {
        if ( == null) {
             = new java.util.ArrayList<String>();
        }
        return ;
    }
    
    
A list of names of the security groups with which to associate EC2 instances. For more information about Amazon EC2 security groups, please see Amazon EC2 product documentation

Parameters:
securityGroups A list of names of the security groups with which to associate EC2 instances. For more information about Amazon EC2 security groups, please see Amazon EC2 product documentation
    public void setSecurityGroups(java.util.Collection<StringsecurityGroups) {
        java.util.List<StringsecurityGroupsCopy = new java.util.ArrayList<String>();
        if (securityGroups != null) {
            securityGroupsCopy.addAll(securityGroups);
        }
        this. = securityGroupsCopy;
    }
    
    
A list of names of the security groups with which to associate EC2 instances. For more information about Amazon EC2 security groups, please see Amazon EC2 product documentation

Returns a reference to this object so that method calls can be chained together.

Parameters:
securityGroups A list of names of the security groups with which to associate EC2 instances. For more information about Amazon EC2 security groups, please see Amazon EC2 product documentation
Returns:
A reference to this updated object so that method calls can be chained together.
    public CreateLaunchConfigurationRequest withSecurityGroups(String... securityGroups) {
        for (String value : securityGroups) {
            getSecurityGroups().add(value);
        }
        return this;
    }
    
    
A list of names of the security groups with which to associate EC2 instances. For more information about Amazon EC2 security groups, please see Amazon EC2 product documentation

Returns a reference to this object so that method calls can be chained together.

Parameters:
securityGroups A list of names of the security groups with which to associate EC2 instances. For more information about Amazon EC2 security groups, please see Amazon EC2 product documentation
Returns:
A reference to this updated object so that method calls can be chained together.
        java.util.List<StringsecurityGroupsCopy = new java.util.ArrayList<String>();
        if (securityGroups != null) {
            securityGroupsCopy.addAll(securityGroups);
        }
        this. = securityGroupsCopy;
        return this;
    }
    
    
The user data available to the launched EC2 instances. For more information about Amazon EC2 user data, please see Amazon EC2 product documentation

Constraints:
Length: 0 - 21847
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
The user data available to the launched EC2 instances. For more information about Amazon EC2 user data, please see Amazon EC2 product documentation
    public String getUserData() {
        return ;
    }
    
    
The user data available to the launched EC2 instances. For more information about Amazon EC2 user data, please see Amazon EC2 product documentation

Constraints:
Length: 0 - 21847
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
userData The user data available to the launched EC2 instances. For more information about Amazon EC2 user data, please see Amazon EC2 product documentation
    public void setUserData(String userData) {
        this. = userData;
    }
    
    
The user data available to the launched EC2 instances. For more information about Amazon EC2 user data, please see Amazon EC2 product documentation

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 0 - 21847
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
userData The user data available to the launched EC2 instances. For more information about Amazon EC2 user data, please see Amazon EC2 product documentation
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = userData;
        return this;
    }
    
    
    
The instance type of the EC2 instance. For more information about Amazon EC2 instance types, please see Amazon EC2 product documentation

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
The instance type of the EC2 instance. For more information about Amazon EC2 instance types, please see Amazon EC2 product documentation
    public String getInstanceType() {
        return ;
    }
    
    
The instance type of the EC2 instance. For more information about Amazon EC2 instance types, please see Amazon EC2 product documentation

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
instanceType The instance type of the EC2 instance. For more information about Amazon EC2 instance types, please see Amazon EC2 product documentation
    public void setInstanceType(String instanceType) {
        this. = instanceType;
    }
    
    
The instance type of the EC2 instance. For more information about Amazon EC2 instance types, please see Amazon EC2 product documentation

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
instanceType The instance type of the EC2 instance. For more information about Amazon EC2 instance types, please see Amazon EC2 product documentation
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = instanceType;
        return this;
    }
    
    
    
The ID of the kernel associated with the EC2 AMI.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
The ID of the kernel associated with the EC2 AMI.
    public String getKernelId() {
        return ;
    }
    
    
The ID of the kernel associated with the EC2 AMI.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
kernelId The ID of the kernel associated with the EC2 AMI.
    public void setKernelId(String kernelId) {
        this. = kernelId;
    }
    
    
The ID of the kernel associated with the EC2 AMI.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
kernelId The ID of the kernel associated with the EC2 AMI.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = kernelId;
        return this;
    }
    
    
    
The ID of the RAM disk associated with the EC2 AMI.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Returns:
The ID of the RAM disk associated with the EC2 AMI.
    public String getRamdiskId() {
        return ;
    }
    
    
The ID of the RAM disk associated with the EC2 AMI.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
ramdiskId The ID of the RAM disk associated with the EC2 AMI.
    public void setRamdiskId(String ramdiskId) {
        this. = ramdiskId;
    }
    
    
The ID of the RAM disk associated with the EC2 AMI.

Returns a reference to this object so that method calls can be chained together.

Constraints:
Length: 1 - 255
Pattern: [\u0020-\uD7FF\uE000-\uFFFD\uD800\uDC00-\uDBFF\uDFFF\r\n\t]*

Parameters:
ramdiskId The ID of the RAM disk associated with the EC2 AMI.
Returns:
A reference to this updated object so that method calls can be chained together.
        this. = ramdiskId;
        return this;
    }
    
    
    
Specifies how block devices are exposed to the instance. Each mapping is made up of a VirtualName and a DeviceName. For more information about Amazon EC2 BlockDeviceMappings, please see Amazon EC2 product documentation

Returns:
Specifies how block devices are exposed to the instance. Each mapping is made up of a VirtualName and a DeviceName. For more information about Amazon EC2 BlockDeviceMappings, please see Amazon EC2 product documentation
        if ( == null) {
             = new java.util.ArrayList<BlockDeviceMapping>();
        }
        return ;
    }
    
    
Specifies how block devices are exposed to the instance. Each mapping is made up of a VirtualName and a DeviceName. For more information about Amazon EC2 BlockDeviceMappings, please see Amazon EC2 product documentation

Parameters:
blockDeviceMappings Specifies how block devices are exposed to the instance. Each mapping is made up of a VirtualName and a DeviceName. For more information about Amazon EC2 BlockDeviceMappings, please see Amazon EC2 product documentation
    public void setBlockDeviceMappings(java.util.Collection<BlockDeviceMappingblockDeviceMappings) {
        java.util.List<BlockDeviceMappingblockDeviceMappingsCopy = new java.util.ArrayList<BlockDeviceMapping>();
        if (blockDeviceMappings != null) {
            blockDeviceMappingsCopy.addAll(blockDeviceMappings);
        }
        this. = blockDeviceMappingsCopy;
    }
    
    
Specifies how block devices are exposed to the instance. Each mapping is made up of a VirtualName and a DeviceName. For more information about Amazon EC2 BlockDeviceMappings, please see Amazon EC2 product documentation

Returns a reference to this object so that method calls can be chained together.

Parameters:
blockDeviceMappings Specifies how block devices are exposed to the instance. Each mapping is made up of a VirtualName and a DeviceName. For more information about Amazon EC2 BlockDeviceMappings, please see Amazon EC2 product documentation
Returns:
A reference to this updated object so that method calls can be chained together.
        for (BlockDeviceMapping value : blockDeviceMappings) {
            getBlockDeviceMappings().add(value);
        }
        return this;
    }
    
    
Specifies how block devices are exposed to the instance. Each mapping is made up of a VirtualName and a DeviceName. For more information about Amazon EC2 BlockDeviceMappings, please see Amazon EC2 product documentation

Returns a reference to this object so that method calls can be chained together.

Parameters:
blockDeviceMappings Specifies how block devices are exposed to the instance. Each mapping is made up of a VirtualName and a DeviceName. For more information about Amazon EC2 BlockDeviceMappings, please see Amazon EC2 product documentation
Returns:
A reference to this updated object so that method calls can be chained together.
        java.util.List<BlockDeviceMappingblockDeviceMappingsCopy = new java.util.ArrayList<BlockDeviceMapping>();
        if (blockDeviceMappings != null) {
            blockDeviceMappingsCopy.addAll(blockDeviceMappings);
        }
        this. = blockDeviceMappingsCopy;
        return this;
    }
    
    
Returns a string representation of this object; useful for testing and debugging.

Returns:
A string representation of this object.
See also:
java.lang.Object.toString()
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append("{");
        sb.append("LaunchConfigurationName: " +  + ", ");
        sb.append("ImageId: " +  + ", ");
        sb.append("KeyName: " +  + ", ");
        sb.append("SecurityGroups: " +  + ", ");
        sb.append("UserData: " +  + ", ");
        sb.append("InstanceType: " +  + ", ");
        sb.append("KernelId: " +  + ", ");
        sb.append("RamdiskId: " +  + ", ");
        sb.append("BlockDeviceMappings: " +  + ", ");
        sb.append("}");
        return sb.toString();
    }
    
}
    
New to GrepCode? Check out our FAQ X