Show / Hide Table of Contents

Interface IConfigSetProps

Options for CloudFormationInit.withConfigSets.

Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IConfigSetProps
Syntax (vb)
Public Interface 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

Properties

ConfigSets

The definitions of each config set.

Configs

The sets of configs to pick from.

Properties

ConfigSets

The definitions of each config set.

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

IDictionary<string, string[]>

Remarks

ExampleMetadata: infused

Configs

The sets of configs to pick from.

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

IDictionary<string, InitConfig>

Remarks

ExampleMetadata: infused

Back to top Generated by DocFX