Class LaunchConfiguration


  • public class LaunchConfiguration
    extends com.pulumi.resources.CustomResource
    Provides a resource to create a new launch configuration, used for Auto Scaling groups. > **WARNING:** The use of launch configurations is discouraged in favor of launch templates. Read more in the [AWS EC2 Documentation](https://docs.aws.amazon.com/autoscaling/ec2/userguide/launch-configurations.html). > **Note** When using `aws.ec2.LaunchConfiguration` with `aws.autoscaling.Group`, it is recommended to use the `namePrefix` (Optional) instead of the `name` (Optional) attribute. This will allow Pulumi lifecycles to detect changes to the launch configuration and update the Auto Scaling group correctly. ## Example Usage
     
     package generated_program;
     
     import com.pulumi.Context;
     import com.pulumi.Pulumi;
     import com.pulumi.core.Output;
     import com.pulumi.aws.ec2.Ec2Functions;
     import com.pulumi.aws.ec2.inputs.GetAmiArgs;
     import com.pulumi.aws.ec2.inputs.GetAmiFilterArgs;
     import com.pulumi.aws.ec2.LaunchConfiguration;
     import com.pulumi.aws.ec2.LaunchConfigurationArgs;
     import java.util.ArrayList;
     import java.util.Arrays;
     import java.util.Map;
     import java.io.File;
     import java.nio.file.Files;
     import java.nio.file.Paths;
     
     public class App {
         public static void main(String[] args) {
             Pulumi.run(App::stack);
         }
     
         public static void stack(Context ctx) {
             final var ubuntu = Ec2Functions.getAmi(GetAmiArgs.builder()
                 .filters(            
                     GetAmiFilterArgs.builder()
                         .name("name")
                         .values("ubuntu/images/hvm-ssd/ubuntu-trusty-14.04-amd64-server-*")
                         .build(),
                     GetAmiFilterArgs.builder()
                         .name("virtualization-type")
                         .values("hvm")
                         .build())
                 .mostRecent(true)
                 .owners("099720109477")
                 .build());
     
             var asConf = new LaunchConfiguration("asConf", LaunchConfigurationArgs.builder()
                 .name("web_config")
                 .imageId(ubuntu.id())
                 .instanceType("t2.micro")
                 .build());
     
         }
     }
     
     
    #### Optional * `accountId` (String) AWS Account where this resource is managed. * `region` (String) Region where this resource is managed. Using `pulumi import`, import launch configurations using the `name`. For example: ```sh $ pulumi import aws:ec2/launchConfiguration:LaunchConfiguration example example ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Detail

      • LaunchConfiguration

        public LaunchConfiguration​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • LaunchConfiguration

        public LaunchConfiguration​(java.lang.String name,
                                   LaunchConfigurationArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • LaunchConfiguration

        public LaunchConfiguration​(java.lang.String name,
                                   LaunchConfigurationArgs args,
                                   @Nullable
                                   com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • arn

        public com.pulumi.core.Output<java.lang.String> arn()
        Returns:
        ARN of the launch configuration.
      • associatePublicIpAddress

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> associatePublicIpAddress()
        Returns:
        Associate a public IP address with an instance in a VPC.
      • ebsBlockDevices

        public com.pulumi.core.Output<java.util.List<LaunchConfigurationEbsBlockDevice>> ebsBlockDevices()
        Returns:
        Additional EBS block devices to attach to the instance. See Block Devices below for details.
      • ebsOptimized

        public com.pulumi.core.Output<java.lang.Boolean> ebsOptimized()
        Returns:
        If true, the launched EC2 instance will be EBS-optimized.
      • enableMonitoring

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> enableMonitoring()
        Returns:
        Enables/disables detailed monitoring. This is enabled by default.
      • ephemeralBlockDevices

        public com.pulumi.core.Output<java.util.Optional<java.util.List<LaunchConfigurationEphemeralBlockDevice>>> ephemeralBlockDevices()
        Returns:
        Customize Ephemeral (also known as "Instance Store") volumes on the instance. See Block Devices below for details.
      • iamInstanceProfile

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> iamInstanceProfile()
        Returns:
        The name attribute of the IAM instance profile to associate with launched instances.
      • imageId

        public com.pulumi.core.Output<java.lang.String> imageId()
        Returns:
        The EC2 image ID to launch.
      • instanceType

        public com.pulumi.core.Output<java.lang.String> instanceType()
        Returns:
        The size of instance to launch. The following arguments are optional:
      • keyName

        public com.pulumi.core.Output<java.lang.String> keyName()
        Returns:
        The key name that should be used for the instance.
      • name

        public com.pulumi.core.Output<java.lang.String> name()
        Returns:
        The name of the launch configuration. If you leave this blank, this provider will auto-generate a unique name. Conflicts with `namePrefix`.
      • namePrefix

        public com.pulumi.core.Output<java.lang.String> namePrefix()
        Returns:
        Creates a unique name beginning with the specified prefix. Conflicts with `name`.
      • placementTenancy

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> placementTenancy()
        Returns:
        The tenancy of the instance. Valid values are `default` or `dedicated`, see [AWS's Create Launch Configuration](http://docs.aws.amazon.com/AutoScaling/latest/APIReference/API_CreateLaunchConfiguration.html) for more details.
      • region

        public com.pulumi.core.Output<java.lang.String> region()
        Returns:
        Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
      • rootBlockDevice

        public com.pulumi.core.Output<LaunchConfigurationRootBlockDevice> rootBlockDevice()
        Returns:
        Customize details about the root block device of the instance. See Block Devices below for details.
      • securityGroups

        public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> securityGroups()
        Returns:
        A list of associated security group IDs.
      • spotPrice

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> spotPrice()
        Returns:
        The maximum price to use for reserving spot instances.
      • userData

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> userData()
        Returns:
        The user data to provide when launching the instance. Do not pass gzip-compressed data via this argument; see `userDataBase64` instead.
      • userDataBase64

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> userDataBase64()
        Returns:
        Can be used instead of `userData` to pass base64-encoded binary data directly. Use this instead of `userData` whenever the value is not a valid UTF-8 string. For example, gzip-encoded user data must be base64-encoded and passed via this argument to avoid corruption.
      • get

        public static LaunchConfiguration get​(java.lang.String name,
                                              com.pulumi.core.Output<java.lang.String> id,
                                              @Nullable
                                              LaunchConfigurationState state,
                                              @Nullable
                                              com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.