Interface SystemdConfigFileOptions

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
SystemdConfigFileOptions.Jsii$Proxy

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-07-12T19:34:01.019Z") @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();
 
  • Method Details

    • getCommand

      @Stability(Stable) @NotNull String getCommand()
      The command to run to start this service.
    • getAfterNetwork

      @Stability(Stable) @Nullable default Boolean getAfterNetwork()
      Start the service after the networking part of the OS comes up.

      Default: true

    • getCwd

      @Stability(Stable) @Nullable default String getCwd()
      The working directory for the command.

      Default: Root directory or home directory of specified user

    • getDescription

      @Stability(Stable) @Nullable default String getDescription()
      A description of this service.

      Default: - No description

    • getEnvironmentFiles

      @Stability(Stable) @Nullable default List<String> getEnvironmentFiles()
      Loads environment variables from files when the process is running.

      Must use absolute paths.

      Default: - No environment files

    • getEnvironmentVariables

      @Stability(Stable) @Nullable default Map<String,String> getEnvironmentVariables()
      Environment variables to load when the process is running.

      Default: - No environment variables set

    • getGroup

      @Stability(Stable) @Nullable default String getGroup()
      The group to execute the process under.

      Default: root

    • getKeepRunning

      @Stability(Stable) @Nullable default Boolean 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

      @Stability(Stable) @Nullable default String getUser()
      The user to execute the process under.

      Default: root

    • builder

      @Stability(Stable) static SystemdConfigFileOptions.Builder builder()
      Returns:
      a SystemdConfigFileOptions.Builder of SystemdConfigFileOptions