Interface SystemdConfigFileOptions
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
SystemdConfigFileOptions.Jsii$Proxy
@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)",
date="2025-11-17T14:40:50.147Z")
@Stability(Stable)
public interface SystemdConfigFileOptions
extends software.amazon.jsii.JsiiSerializable
Options for creating a SystemD configuration file.
Example:
Vpc vpc;
InstanceType instanceType;
Instance.Builder.create(this, "Instance")
.vpc(vpc)
.instanceType(instanceType)
.machineImage(MachineImage.latestAmazonLinux2023())
.init(CloudFormationInit.fromElements(InitService.systemdConfigFile("simpleserver", SystemdConfigFileOptions.builder()
.command("/usr/bin/python3 -m http.server 8080")
.cwd("/var/www/html")
.build()), InitService.enable("simpleserver", InitServiceOptions.builder()
.serviceManager(ServiceManager.SYSTEMD)
.build()), InitFile.fromString("/var/www/html/index.html", "Hello! It's working!")))
.build();
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forSystemdConfigFileOptionsstatic final classAn implementation forSystemdConfigFileOptions -
Method Summary
Modifier and TypeMethodDescriptionbuilder()default BooleanStart the service after the networking part of the OS comes up.The command to run to start this service.default StringgetCwd()The working directory for the command.default StringA description of this service.Loads environment variables from files when the process is running.Environment variables to load when the process is running.default StringgetGroup()The group to execute the process under.default BooleanKeep the process running all the time.default StringgetUser()The user to execute the process under.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getCommand
The command to run to start this service. -
getAfterNetwork
Start the service after the networking part of the OS comes up.Default: true
-
getCwd
The working directory for the command.Default: Root directory or home directory of specified user
-
getDescription
A description of this service.Default: - No description
-
getEnvironmentFiles
Loads environment variables from files when the process is running.Must use absolute paths.
Default: - No environment files
-
getEnvironmentVariables
Environment variables to load when the process is running.Default: - No environment variables set
-
getGroup
The group to execute the process under.Default: root
-
getKeepRunning
Keep the process running all the time.Restarts the process when it exits for any reason other than the machine shutting down.
Default: true
-
getUser
The user to execute the process under.Default: root
-
builder
- Returns:
- a
SystemdConfigFileOptions.BuilderofSystemdConfigFileOptions
-