Show / Hide Table of Contents

Class ConfigSetProps

Options for CloudFormationInit.withConfigSets.

Inheritance
object
ConfigSetProps
Implements
IConfigSetProps
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class ConfigSetProps : IConfigSetProps
Syntax (vb)
Public Class ConfigSetProps Implements IConfigSetProps
Remarks

ExampleMetadata: infused

Examples
Vpc vpc;
            InstanceType instanceType;
            IMachineImage machineImage;


            new Instance(this, "Instance", new InstanceProps {
                Vpc = vpc,
                InstanceType = instanceType,
                MachineImage = machineImage,

                // Showing the most complex setup, if you have simpler requirements
                // you can use `CloudFormationInit.fromElements()`.
                Init = CloudFormationInit.FromConfigSets(new ConfigSetProps {
                    ConfigSets = new Dictionary<string, string[]> {
                        // Applies the configs below in this order
                        { "default", new [] { "yumPreinstall", "config" } }
                    },
                    Configs = new Dictionary<string, InitConfig> {
                        { "yumPreinstall", new InitConfig(new [] { InitPackage.Yum("git") }) },
                        { "config", new InitConfig(new [] { InitFile.FromObject("/etc/stack.json", new Dictionary<string, object> {
                            { "stackId", Stack.Of(this).StackId },
                            { "stackName", Stack.Of(this).StackName },
                            { "region", Stack.Of(this).Region }
                        }), InitGroup.FromName("my-group"), InitUser.FromName("my-user"), InitPackage.Rpm("http://mirrors.ukfast.co.uk/sites/dl.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/r/rubygem-git-1.5.0-2.el8.noarch.rpm") }) }
                    }
                }),
                InitOptions = new ApplyCloudFormationInitOptions {
                    // Optional, which configsets to activate (['default'] by default)
                    ConfigSets = new [] { "default" },

                    // Optional, how long the installation is expected to take (5 minutes by default)
                    Timeout = Duration.Minutes(30),

                    // Optional, whether to include the --url argument when running cfn-init and cfn-signal commands (false by default)
                    IncludeUrl = true,

                    // Optional, whether to include the --role argument when running cfn-init and cfn-signal commands (false by default)
                    IncludeRole = true
                }
            });

Synopsis

Constructors

ConfigSetProps()

Options for CloudFormationInit.withConfigSets.

Properties

ConfigSets

The definitions of each config set.

Configs

The sets of configs to pick from.

Constructors

ConfigSetProps()

Options for CloudFormationInit.withConfigSets.

public ConfigSetProps()
Remarks

ExampleMetadata: infused

Examples
Vpc vpc;
            InstanceType instanceType;
            IMachineImage machineImage;


            new Instance(this, "Instance", new InstanceProps {
                Vpc = vpc,
                InstanceType = instanceType,
                MachineImage = machineImage,

                // Showing the most complex setup, if you have simpler requirements
                // you can use `CloudFormationInit.fromElements()`.
                Init = CloudFormationInit.FromConfigSets(new ConfigSetProps {
                    ConfigSets = new Dictionary<string, string[]> {
                        // Applies the configs below in this order
                        { "default", new [] { "yumPreinstall", "config" } }
                    },
                    Configs = new Dictionary<string, InitConfig> {
                        { "yumPreinstall", new InitConfig(new [] { InitPackage.Yum("git") }) },
                        { "config", new InitConfig(new [] { InitFile.FromObject("/etc/stack.json", new Dictionary<string, object> {
                            { "stackId", Stack.Of(this).StackId },
                            { "stackName", Stack.Of(this).StackName },
                            { "region", Stack.Of(this).Region }
                        }), InitGroup.FromName("my-group"), InitUser.FromName("my-user"), InitPackage.Rpm("http://mirrors.ukfast.co.uk/sites/dl.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/r/rubygem-git-1.5.0-2.el8.noarch.rpm") }) }
                    }
                }),
                InitOptions = new ApplyCloudFormationInitOptions {
                    // Optional, which configsets to activate (['default'] by default)
                    ConfigSets = new [] { "default" },

                    // Optional, how long the installation is expected to take (5 minutes by default)
                    Timeout = Duration.Minutes(30),

                    // Optional, whether to include the --url argument when running cfn-init and cfn-signal commands (false by default)
                    IncludeUrl = true,

                    // Optional, whether to include the --role argument when running cfn-init and cfn-signal commands (false by default)
                    IncludeRole = true
                }
            });

Properties

ConfigSets

The definitions of each config set.

public IDictionary<string, string[]> ConfigSets { get; set; }
Property Value

IDictionary<string, string[]>

Remarks

ExampleMetadata: infused

Configs

The sets of configs to pick from.

public IDictionary<string, InitConfig> Configs { get; set; }
Property Value

IDictionary<string, InitConfig>

Remarks

ExampleMetadata: infused

Implements

IConfigSetProps
Back to top Generated by DocFX