Enum ServiceManager

java.lang.Object
java.lang.Enum<ServiceManager>
software.amazon.awscdk.services.ec2.ServiceManager
All Implemented Interfaces:
Serializable, Comparable<ServiceManager>, java.lang.constant.Constable

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-02T15:58:24.875Z") @Stability(Stable) public enum ServiceManager extends Enum<ServiceManager>
The service manager that will be used by InitServices.

The value needs to match the service manager used by your operating system.

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();
 
  • Enum Constant Details

    • SYSVINIT

      @Stability(Stable) public static final ServiceManager SYSVINIT
      Use SysVinit.

      This is the default for Linux systems.

    • WINDOWS

      @Stability(Stable) public static final ServiceManager WINDOWS
      Use Windows.

      This is the default for Windows systems.

    • SYSTEMD

      @Stability(Stable) public static final ServiceManager SYSTEMD
      Use systemd.
  • Method Details

    • values

      public static ServiceManager[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      Returns:
      an array containing the constants of this enum type, in the order they are declared
    • valueOf

      public static ServiceManager valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum type has no constant with the specified name
      NullPointerException - if the argument is null