Show / Hide Table of Contents

Class CfnLaunchTemplate

Specifies the properties for creating a launch template.

Inheritance
object
CfnElement
CfnRefElement
CfnResource
CfnLaunchTemplate
Implements
IInspectable
ILaunchTemplateRef
IConstruct
IDependable
IEnvironmentAware
Inherited Members
CfnResource.IsCfnResource(object)
CfnResource.AddDeletionOverride(string)
CfnResource.AddDependency(CfnResource)
CfnResource.AddDependsOn(CfnResource)
CfnResource.AddMetadata(string, object)
CfnResource.AddOverride(string, object)
CfnResource.AddPropertyDeletionOverride(string)
CfnResource.AddPropertyOverride(string, object)
CfnResource.ApplyRemovalPolicy(RemovalPolicy?, IRemovalPolicyOptions)
CfnResource.GetAtt(string, ResolutionTypeHint?)
CfnResource.GetMetadata(string)
CfnResource.ObtainDependencies()
CfnResource.ObtainResourceDependencies()
CfnResource.RemoveDependency(CfnResource)
CfnResource.ReplaceDependency(CfnResource, CfnResource)
CfnResource.ShouldSynthesize()
CfnResource.ToString()
CfnResource.ValidateProperties(object)
CfnResource.CfnOptions
CfnResource.CfnResourceType
CfnResource.Env
CfnResource.UpdatedProperites
CfnResource.UpdatedProperties
CfnRefElement.Ref
CfnElement.IsCfnElement(object)
CfnElement.OverrideLogicalId(string)
CfnElement.CreationStack
CfnElement.LogicalId
CfnElement.Stack
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class CfnLaunchTemplate : CfnResource, IInspectable, ILaunchTemplateRef, IConstruct, IDependable, IEnvironmentAware
Syntax (vb)
Public Class CfnLaunchTemplate Inherits CfnResource Implements IInspectable, ILaunchTemplateRef, IConstruct, IDependable, IEnvironmentAware
Remarks

The minimum required properties for specifying a launch template are as follows:

    A launch template can contain some or all of the configuration information to launch an instance. When you launch an instance using a launch template, instance properties that are not specified in the launch template use default values, except the ImageId property, which has no default value. If you do not specify an AMI ID for the launch template ImageId property, you must specify an AMI ID for the instance ImageId property.

    For more information, see Launch an instance from a launch template in the Amazon EC2 User Guide .

    See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html

    CloudformationResource: AWS::EC2::LaunchTemplate

    ExampleMetadata: infused

    Examples
    Cluster cluster;
    
    
                 var userData = @"MIME-Version: 1.0
                 Content-Type: multipart/mixed; boundary=""==MYBOUNDARY==""
    
                 --==MYBOUNDARY==
                 Content-Type: text/x-shellscript; charset=""us-ascii""
    
                 #!/bin/bash
                 echo ""Running custom user data script""
    
                 --==MYBOUNDARY==--\
                 ";
                 var lt = new CfnLaunchTemplate(this, "LaunchTemplate", new CfnLaunchTemplateProps {
                     LaunchTemplateData = new LaunchTemplateDataProperty {
                         InstanceType = "t3.small",
                         UserData = Fn.Base64(userData)
                     }
                 });
    
                 cluster.AddNodegroupCapacity("extra-ng", new NodegroupOptions {
                     LaunchTemplateSpec = new LaunchTemplateSpec {
                         Id = lt.Ref,
                         Version = lt.AttrLatestVersionNumber
                     }
                 });

    Synopsis

    Constructors

    CfnLaunchTemplate(Construct, string, ICfnLaunchTemplateProps)

    Create a new AWS::EC2::LaunchTemplate.

    Properties

    AttrDefaultVersionNumber

    The default version of the launch template, such as 2.

    AttrLatestVersionNumber

    The latest version of the launch template, such as 5 .

    AttrLaunchTemplateId

    The ID of the launch template.

    CFN_RESOURCE_TYPE_NAME

    The CloudFormation resource type name for this resource class.

    CfnProperties

    Specifies the properties for creating a launch template.

    LaunchTemplateData

    The information for the launch template.

    LaunchTemplateName

    A name for the launch template.

    LaunchTemplateRef

    A reference to a LaunchTemplate resource.

    TagSpecifications

    The tags to apply to the launch template on creation.

    VersionDescription

    A description for the first version of the launch template.

    Methods

    ArnForLaunchTemplate(ILaunchTemplateRef)

    Specifies the properties for creating a launch template.

    FromLaunchTemplateId(Construct, string, string)

    Creates a new ILaunchTemplateRef from a launchTemplateId.

    Inspect(TreeInspector)

    Examines the CloudFormation resource and discloses attributes.

    IsCfnLaunchTemplate(object)

    Checks whether the given object is a CfnLaunchTemplate.

    RenderProperties(IDictionary<string, object>)

    Specifies the properties for creating a launch template.

    Constructors

    CfnLaunchTemplate(Construct, string, ICfnLaunchTemplateProps)

    Create a new AWS::EC2::LaunchTemplate.

    public CfnLaunchTemplate(Construct scope, string id, ICfnLaunchTemplateProps props)
    Parameters
    scope Construct

    Scope in which this resource is defined.

    id string

    Construct identifier for this resource (unique in its scope).

    props ICfnLaunchTemplateProps

    Resource properties.

    Remarks

    The minimum required properties for specifying a launch template are as follows:

      A launch template can contain some or all of the configuration information to launch an instance. When you launch an instance using a launch template, instance properties that are not specified in the launch template use default values, except the ImageId property, which has no default value. If you do not specify an AMI ID for the launch template ImageId property, you must specify an AMI ID for the instance ImageId property.

      For more information, see Launch an instance from a launch template in the Amazon EC2 User Guide .

      See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html

      CloudformationResource: AWS::EC2::LaunchTemplate

      ExampleMetadata: infused

      Properties

      AttrDefaultVersionNumber

      The default version of the launch template, such as 2.

      public virtual string AttrDefaultVersionNumber { get; }
      Property Value

      string

      Remarks

      The default version of a launch template cannot be specified in AWS CloudFormation . The default version can be set in the Amazon EC2 console or by using the modify-launch-template AWS CLI command.

      CloudformationAttribute: DefaultVersionNumber

      AttrLatestVersionNumber

      The latest version of the launch template, such as 5 .

      public virtual string AttrLatestVersionNumber { get; }
      Property Value

      string

      Remarks

      CloudformationAttribute: LatestVersionNumber

      AttrLaunchTemplateId

      The ID of the launch template.

      public virtual string AttrLaunchTemplateId { get; }
      Property Value

      string

      Remarks

      CloudformationAttribute: LaunchTemplateId

      CFN_RESOURCE_TYPE_NAME

      The CloudFormation resource type name for this resource class.

      public static string CFN_RESOURCE_TYPE_NAME { get; }
      Property Value

      string

      Remarks

      The minimum required properties for specifying a launch template are as follows:

        A launch template can contain some or all of the configuration information to launch an instance. When you launch an instance using a launch template, instance properties that are not specified in the launch template use default values, except the ImageId property, which has no default value. If you do not specify an AMI ID for the launch template ImageId property, you must specify an AMI ID for the instance ImageId property.

        For more information, see Launch an instance from a launch template in the Amazon EC2 User Guide .

        See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html

        CloudformationResource: AWS::EC2::LaunchTemplate

        ExampleMetadata: infused

        CfnProperties

        Specifies the properties for creating a launch template.

        protected override IDictionary<string, object> CfnProperties { get; }
        Property Value

        IDictionary<string, object>

        Overrides
        CfnResource.CfnProperties
        Remarks

        The minimum required properties for specifying a launch template are as follows:

          A launch template can contain some or all of the configuration information to launch an instance. When you launch an instance using a launch template, instance properties that are not specified in the launch template use default values, except the ImageId property, which has no default value. If you do not specify an AMI ID for the launch template ImageId property, you must specify an AMI ID for the instance ImageId property.

          For more information, see Launch an instance from a launch template in the Amazon EC2 User Guide .

          See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html

          CloudformationResource: AWS::EC2::LaunchTemplate

          ExampleMetadata: infused

          LaunchTemplateData

          The information for the launch template.

          public virtual object LaunchTemplateData { get; set; }
          Property Value

          object

          Remarks

          Type union: either IResolvable or CfnLaunchTemplate.ILaunchTemplateDataProperty

          LaunchTemplateName

          A name for the launch template.

          public virtual string? LaunchTemplateName { get; set; }
          Property Value

          string

          Remarks

          The minimum required properties for specifying a launch template are as follows:

            A launch template can contain some or all of the configuration information to launch an instance. When you launch an instance using a launch template, instance properties that are not specified in the launch template use default values, except the ImageId property, which has no default value. If you do not specify an AMI ID for the launch template ImageId property, you must specify an AMI ID for the instance ImageId property.

            For more information, see Launch an instance from a launch template in the Amazon EC2 User Guide .

            See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html

            CloudformationResource: AWS::EC2::LaunchTemplate

            ExampleMetadata: infused

            LaunchTemplateRef

            A reference to a LaunchTemplate resource.

            public virtual ILaunchTemplateReference LaunchTemplateRef { get; }
            Property Value

            ILaunchTemplateReference

            Remarks

            The minimum required properties for specifying a launch template are as follows:

              A launch template can contain some or all of the configuration information to launch an instance. When you launch an instance using a launch template, instance properties that are not specified in the launch template use default values, except the ImageId property, which has no default value. If you do not specify an AMI ID for the launch template ImageId property, you must specify an AMI ID for the instance ImageId property.

              For more information, see Launch an instance from a launch template in the Amazon EC2 User Guide .

              See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html

              CloudformationResource: AWS::EC2::LaunchTemplate

              ExampleMetadata: infused

              TagSpecifications

              The tags to apply to the launch template on creation.

              public virtual object? TagSpecifications { get; set; }
              Property Value

              object

              Remarks

              Type union: either IResolvable or (either IResolvable or CfnLaunchTemplate.ILaunchTemplateTagSpecificationProperty)[]

              VersionDescription

              A description for the first version of the launch template.

              public virtual string? VersionDescription { get; set; }
              Property Value

              string

              Remarks

              The minimum required properties for specifying a launch template are as follows:

                A launch template can contain some or all of the configuration information to launch an instance. When you launch an instance using a launch template, instance properties that are not specified in the launch template use default values, except the ImageId property, which has no default value. If you do not specify an AMI ID for the launch template ImageId property, you must specify an AMI ID for the instance ImageId property.

                For more information, see Launch an instance from a launch template in the Amazon EC2 User Guide .

                See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html

                CloudformationResource: AWS::EC2::LaunchTemplate

                ExampleMetadata: infused

                Methods

                ArnForLaunchTemplate(ILaunchTemplateRef)

                Specifies the properties for creating a launch template.

                public static string ArnForLaunchTemplate(ILaunchTemplateRef resource)
                Parameters
                resource ILaunchTemplateRef
                Returns

                string

                Remarks

                The minimum required properties for specifying a launch template are as follows:

                  A launch template can contain some or all of the configuration information to launch an instance. When you launch an instance using a launch template, instance properties that are not specified in the launch template use default values, except the ImageId property, which has no default value. If you do not specify an AMI ID for the launch template ImageId property, you must specify an AMI ID for the instance ImageId property.

                  For more information, see Launch an instance from a launch template in the Amazon EC2 User Guide .

                  See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html

                  CloudformationResource: AWS::EC2::LaunchTemplate

                  ExampleMetadata: infused

                  Examples
                  Cluster cluster;
                  
                  
                               var userData = @"MIME-Version: 1.0
                               Content-Type: multipart/mixed; boundary=""==MYBOUNDARY==""
                  
                               --==MYBOUNDARY==
                               Content-Type: text/x-shellscript; charset=""us-ascii""
                  
                               #!/bin/bash
                               echo ""Running custom user data script""
                  
                               --==MYBOUNDARY==--\
                               ";
                               var lt = new CfnLaunchTemplate(this, "LaunchTemplate", new CfnLaunchTemplateProps {
                                   LaunchTemplateData = new LaunchTemplateDataProperty {
                                       InstanceType = "t3.small",
                                       UserData = Fn.Base64(userData)
                                   }
                               });
                  
                               cluster.AddNodegroupCapacity("extra-ng", new NodegroupOptions {
                                   LaunchTemplateSpec = new LaunchTemplateSpec {
                                       Id = lt.Ref,
                                       Version = lt.AttrLatestVersionNumber
                                   }
                               });

                  FromLaunchTemplateId(Construct, string, string)

                  Creates a new ILaunchTemplateRef from a launchTemplateId.

                  public static ILaunchTemplateRef FromLaunchTemplateId(Construct scope, string id, string launchTemplateId)
                  Parameters
                  scope Construct
                  id string
                  launchTemplateId string
                  Returns

                  ILaunchTemplateRef

                  Remarks

                  The minimum required properties for specifying a launch template are as follows:

                    A launch template can contain some or all of the configuration information to launch an instance. When you launch an instance using a launch template, instance properties that are not specified in the launch template use default values, except the ImageId property, which has no default value. If you do not specify an AMI ID for the launch template ImageId property, you must specify an AMI ID for the instance ImageId property.

                    For more information, see Launch an instance from a launch template in the Amazon EC2 User Guide .

                    See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html

                    CloudformationResource: AWS::EC2::LaunchTemplate

                    ExampleMetadata: infused

                    Inspect(TreeInspector)

                    Examines the CloudFormation resource and discloses attributes.

                    public virtual void Inspect(TreeInspector inspector)
                    Parameters
                    inspector TreeInspector

                    tree inspector to collect and process attributes.

                    Remarks

                    The minimum required properties for specifying a launch template are as follows:

                      A launch template can contain some or all of the configuration information to launch an instance. When you launch an instance using a launch template, instance properties that are not specified in the launch template use default values, except the ImageId property, which has no default value. If you do not specify an AMI ID for the launch template ImageId property, you must specify an AMI ID for the instance ImageId property.

                      For more information, see Launch an instance from a launch template in the Amazon EC2 User Guide .

                      See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html

                      CloudformationResource: AWS::EC2::LaunchTemplate

                      ExampleMetadata: infused

                      IsCfnLaunchTemplate(object)

                      Checks whether the given object is a CfnLaunchTemplate.

                      public static bool IsCfnLaunchTemplate(object x)
                      Parameters
                      x object
                      Returns

                      bool

                      Remarks

                      The minimum required properties for specifying a launch template are as follows:

                        A launch template can contain some or all of the configuration information to launch an instance. When you launch an instance using a launch template, instance properties that are not specified in the launch template use default values, except the ImageId property, which has no default value. If you do not specify an AMI ID for the launch template ImageId property, you must specify an AMI ID for the instance ImageId property.

                        For more information, see Launch an instance from a launch template in the Amazon EC2 User Guide .

                        See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html

                        CloudformationResource: AWS::EC2::LaunchTemplate

                        ExampleMetadata: infused

                        RenderProperties(IDictionary<string, object>)

                        Specifies the properties for creating a launch template.

                        protected override IDictionary<string, object> RenderProperties(IDictionary<string, object> props)
                        Parameters
                        props IDictionary<string, object>
                        Returns

                        IDictionary<string, object>

                        Overrides
                        CfnResource.RenderProperties(IDictionary<string, object>)
                        Remarks

                        The minimum required properties for specifying a launch template are as follows:

                          A launch template can contain some or all of the configuration information to launch an instance. When you launch an instance using a launch template, instance properties that are not specified in the launch template use default values, except the ImageId property, which has no default value. If you do not specify an AMI ID for the launch template ImageId property, you must specify an AMI ID for the instance ImageId property.

                          For more information, see Launch an instance from a launch template in the Amazon EC2 User Guide .

                          See: http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-launchtemplate.html

                          CloudformationResource: AWS::EC2::LaunchTemplate

                          ExampleMetadata: infused

                          Implements

                          IInspectable
                          ILaunchTemplateRef
                          Constructs.IConstruct
                          Constructs.IDependable
                          IEnvironmentAware
                          Back to top Generated by DocFX