Class ConfigSetProps
Options for CloudFormationInit.withConfigSets.
Inheritance
System.Object
ConfigSetProps
Implements
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class ConfigSetProps : Object, IConfigSetProps
Syntax (vb)
Public Class ConfigSetProps
Inherits Object
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() |
Properties
Configs | The sets of configs to pick from. |
ConfigSets | The definitions of each config set. |
Constructors
ConfigSetProps()
public ConfigSetProps()
Properties
Configs
The sets of configs to pick from.
public IDictionary<string, InitConfig> Configs { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, InitConfig>
ConfigSets
The definitions of each config set.
public IDictionary<string, string[]> ConfigSets { get; set; }
Property Value
System.Collections.Generic.IDictionary<System.String, System.String[]>