Interface InitServiceOptions

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

@Generated(value="jsii-pacmak/1.98.0 (build 00b106d)", date="2024-05-08T21:35:06.159Z") @Stability(Stable) public interface InitServiceOptions extends software.amazon.jsii.JsiiSerializable
Options for an InitService.

Example:

 Bucket myBucket;
 InitServiceRestartHandle handle = new InitServiceRestartHandle();
 CloudFormationInit.fromElements(InitFile.fromString("/etc/nginx/nginx.conf", "...", InitFileOptions.builder().serviceRestartHandles(List.of(handle)).build()), InitSource.fromS3Object("/var/www/html", myBucket, "html.zip", InitSourceOptions.builder().serviceRestartHandles(List.of(handle)).build()), InitService.enable("nginx", InitServiceOptions.builder()
         .serviceRestartHandle(handle)
         .build()));
 
  • Method Details

    • getEnabled

      @Stability(Stable) @Nullable default Boolean getEnabled()
      Enable or disable this service.

      Set to true to ensure that the service will be started automatically upon boot.

      Set to false to ensure that the service will not be started automatically upon boot.

      Default: - true if used in `InitService.enable()`, no change to service state if used in `InitService.fromOptions()`.

    • getEnsureRunning

      @Stability(Stable) @Nullable default Boolean getEnsureRunning()
      Make sure this service is running or not running after cfn-init finishes.

      Set to true to ensure that the service is running after cfn-init finishes.

      Set to false to ensure that the service is not running after cfn-init finishes.

      Default: - same value as `enabled`.

    • getServiceManager

      @Stability(Stable) @Nullable default ServiceManager getServiceManager()
      What service manager to use.

      This needs to match the actual service manager on your Operating System. For example, Amazon Linux 1 uses SysVinit, but Amazon Linux 2 uses Systemd.

      Default: ServiceManager.SYSVINIT for Linux images, ServiceManager.WINDOWS for Windows images

    • getServiceRestartHandle

      @Stability(Stable) @Nullable default InitServiceRestartHandle getServiceRestartHandle()
      Restart service when the actions registered into the restartHandle have been performed.

      Register actions into the restartHandle by passing it to InitFile, InitCommand, InitPackage and InitSource objects.

      Default: - No files trigger restart

    • builder

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