Enum ServiceManager
The service manager that will be used by InitServices.
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public enum ServiceManager
Syntax (vb)
Public Enum ServiceManager
Remarks
The value needs to match the service manager used by your operating system.
ExampleMetadata: infused
Examples
Vpc vpc;
InstanceType instanceType;
new Instance(this, "Instance", new InstanceProps {
Vpc = vpc,
InstanceType = instanceType,
MachineImage = MachineImage.LatestAmazonLinux2023(),
Init = CloudFormationInit.FromElements(InitService.SystemdConfigFile("simpleserver", new SystemdConfigFileOptions {
Command = "/usr/bin/python3 -m http.server 8080",
Cwd = "/var/www/html"
}), InitService.Enable("simpleserver", new InitServiceOptions {
ServiceManager = ServiceManager.SYSTEMD
}), InitFile.FromString("/var/www/html/index.html", "Hello! It's working!"))
});
Synopsis
Fields
SYSTEMD | Use systemd. |
SYSVINIT | Use SysVinit. |
WINDOWS | Use Windows. |
Fields
Name | Description |
---|---|
SYSTEMD | Use systemd. |
SYSVINIT | Use SysVinit. |
WINDOWS | Use Windows. |