LaunchConfiguration

class LaunchConfiguration : KotlinCustomResource

Provides a resource to create a new launch configuration, used for autoscaling groups. !>WARNING: The use of launch configurations is discouraged in favor of launch templates. Read more in the AWS EC2 Documentation.

Note When using aws.ec2.LaunchConfiguration with aws.autoscaling.Group, it is recommended to use the name_prefix (Optional) instead of the name (Optional) attribute.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const ubuntu = aws.ec2.getAmi({
mostRecent: true,
filters: [
{
name: "name",
values: ["ubuntu/images/hvm-ssd/ubuntu-trusty-14.04-amd64-server-*"],
},
{
name: "virtualization-type",
values: ["hvm"],
},
],
owners: ["099720109477"],
});
const asConf = new aws.ec2.LaunchConfiguration("as_conf", {
name: "web_config",
imageId: ubuntu.then(ubuntu => ubuntu.id),
instanceType: "t2.micro",
});
import pulumi
import pulumi_aws as aws
ubuntu = aws.ec2.get_ami(most_recent=True,
filters=[
{
"name": "name",
"values": ["ubuntu/images/hvm-ssd/ubuntu-trusty-14.04-amd64-server-*"],
},
{
"name": "virtualization-type",
"values": ["hvm"],
},
],
owners=["099720109477"])
as_conf = aws.ec2.LaunchConfiguration("as_conf",
name="web_config",
image_id=ubuntu.id,
instance_type="t2.micro")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() =>
{
var ubuntu = Aws.Ec2.GetAmi.Invoke(new()
{
MostRecent = true,
Filters = new[]
{
new Aws.Ec2.Inputs.GetAmiFilterInputArgs
{
Name = "name",
Values = new[]
{
"ubuntu/images/hvm-ssd/ubuntu-trusty-14.04-amd64-server-*",
},
},
new Aws.Ec2.Inputs.GetAmiFilterInputArgs
{
Name = "virtualization-type",
Values = new[]
{
"hvm",
},
},
},
Owners = new[]
{
"099720109477",
},
});
var asConf = new Aws.Ec2.LaunchConfiguration("as_conf", new()
{
Name = "web_config",
ImageId = ubuntu.Apply(getAmiResult => getAmiResult.Id),
InstanceType = "t2.micro",
});
});
package main
import (
"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
ubuntu, err := ec2.LookupAmi(ctx, &ec2.LookupAmiArgs{
MostRecent: pulumi.BoolRef(true),
Filters: []ec2.GetAmiFilter{
{
Name: "name",
Values: []string{
"ubuntu/images/hvm-ssd/ubuntu-trusty-14.04-amd64-server-*",
},
},
{
Name: "virtualization-type",
Values: []string{
"hvm",
},
},
},
Owners: []string{
"099720109477",
},
}, nil)
if err != nil {
return err
}
_, err = ec2.NewLaunchConfiguration(ctx, "as_conf", &ec2.LaunchConfigurationArgs{
Name: pulumi.String("web_config"),
ImageId: pulumi.String(ubuntu.Id),
InstanceType: pulumi.String("t2.micro"),
})
if err != nil {
return err
}
return nil
})
}
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.LaunchConfiguration;
import com.pulumi.aws.ec2.LaunchConfigurationArgs;
import java.util.List;
import java.util.ArrayList;
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()
.mostRecent(true)
.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())
.owners("099720109477")
.build());
var asConf = new LaunchConfiguration("asConf", LaunchConfigurationArgs.builder()
.name("web_config")
.imageId(ubuntu.id())
.instanceType("t2.micro")
.build());
}
}
resources:
asConf:
type: aws:ec2:LaunchConfiguration
name: as_conf
properties:
name: web_config
imageId: ${ubuntu.id}
instanceType: t2.micro
variables:
ubuntu:
fn::invoke:
function: aws:ec2:getAmi
arguments:
mostRecent: true
filters:
- name: name
values:
- ubuntu/images/hvm-ssd/ubuntu-trusty-14.04-amd64-server-*
- name: virtualization-type
values:
- hvm
owners:
- '099720109477'

Import

Using pulumi import, import launch configurations using the name. For example:

$ pulumi import aws:ec2/launchConfiguration:LaunchConfiguration as_conf pulumi-lg-123456

Properties

Link copied to clipboard
val arn: Output<String>

The Amazon Resource Name of the launch configuration.

Link copied to clipboard

Associate a public ip address with an instance in a VPC.

Link copied to clipboard

Additional EBS block devices to attach to the instance. See Block Devices below for details.

Link copied to clipboard
val ebsOptimized: Output<Boolean>

If true, the launched EC2 instance will be EBS-optimized.

Link copied to clipboard

Enables/disables detailed monitoring. This is enabled by default.

Link copied to clipboard

Customize Ephemeral (also known as "Instance Store") volumes on the instance. See Block Devices below for details.

Link copied to clipboard

The name attribute of the IAM instance profile to associate with launched instances.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val imageId: Output<String>

The EC2 image ID to launch.

Link copied to clipboard
val instanceType: Output<String>

The size of instance to launch. The following arguments are optional:

Link copied to clipboard
val keyName: Output<String>

The key name that should be used for the instance.

Link copied to clipboard

The metadata options for the instance.

Link copied to clipboard
val name: Output<String>

The name of the launch configuration. If you leave this blank, this provider will auto-generate a unique name. Conflicts with name_prefix.

Link copied to clipboard
val namePrefix: Output<String>

Creates a unique name beginning with the specified prefix. Conflicts with name.

Link copied to clipboard
val placementTenancy: Output<String>?

The tenancy of the instance. Valid values are default or dedicated, see AWS's Create Launch Configuration for more details.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Customize details about the root block device of the instance. See Block Devices below for details.

Link copied to clipboard
val securityGroups: Output<List<String>>?

A list of associated security group IDS.

Link copied to clipboard
val spotPrice: Output<String>?

The maximum price to use for reserving spot instances.

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val userData: Output<String>?

The user data to provide when launching the instance. Do not pass gzip-compressed data via this argument; see user_data_base64 instead.

Link copied to clipboard
val userDataBase64: Output<String>?

Can be used instead of user_data to pass base64-encoded binary data directly. Use this instead of user_data 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.