Class ServiceManager
The service manager that will be used by InitServices.
Inheritance
System.Object
ServiceManager
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public sealed class ServiceManager : Enum
Syntax (vb)
Public NotInheritable Class ServiceManager
Inherits
Enum
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. |
value__ | |
WINDOWS | Use Windows. |
Fields
SYSTEMD
SYSVINIT
Use SysVinit.
public const ServiceManager SYSVINIT
Field Value
Type | Description |
---|---|
ServiceManager |
Remarks
This is the default for Linux systems.
value__
public int value__
Field Value
Type | Description |
---|---|
System.Int32 |
WINDOWS
Use Windows.
public const ServiceManager WINDOWS
Field Value
Type | Description |
---|---|
ServiceManager |
Remarks
This is the default for Windows systems.