Class InitService

java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.ec2.InitElement
software.amazon.awscdk.services.ec2.InitService
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:39.382Z") @Stability(Stable) public class InitService extends InitElement
A services that be enabled, disabled or restarted when the instance is launched.

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()));
 
  • Nested Class Summary

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    InitService(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    InitService(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    disable(String serviceName)
    Disable and stop the given service.
    enable(String serviceName)
    Enable and start the given service, optionally restarting it.
    enable(String serviceName, InitServiceOptions options)
    Enable and start the given service, optionally restarting it.
    Returns the init element type for this element.

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Constructor Details

    • InitService

      protected InitService(software.amazon.jsii.JsiiObjectRef objRef)
    • InitService

      protected InitService(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
  • Method Details

    • disable

      @Stability(Stable) @NotNull public static InitService disable(@NotNull String serviceName)
      Disable and stop the given service.

      Parameters:
      serviceName - This parameter is required.
    • enable

      @Stability(Stable) @NotNull public static InitService enable(@NotNull String serviceName, @Nullable InitServiceOptions options)
      Enable and start the given service, optionally restarting it.

      Parameters:
      serviceName - This parameter is required.
      options -
    • enable

      @Stability(Stable) @NotNull public static InitService enable(@NotNull String serviceName)
      Enable and start the given service, optionally restarting it.

      Parameters:
      serviceName - This parameter is required.
    • getElementType

      @Stability(Stable) @NotNull public String getElementType()
      Returns the init element type for this element.
      Specified by:
      getElementType in class InitElement