Class InitServiceOptions.Builder

java.lang.Object
software.amazon.awscdk.services.ec2.InitServiceOptions.Builder
All Implemented Interfaces:
software.amazon.jsii.Builder<InitServiceOptions>
Enclosing interface:
InitServiceOptions

@Stability(Stable) public static final class InitServiceOptions.Builder extends Object implements software.amazon.jsii.Builder<InitServiceOptions>
A builder for InitServiceOptions
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • enabled

      @Stability(Stable) public InitServiceOptions.Builder enabled(Boolean enabled)
      Parameters:
      enabled - 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.

      Returns:
      this
    • ensureRunning

      @Stability(Stable) public InitServiceOptions.Builder ensureRunning(Boolean ensureRunning)
      Parameters:
      ensureRunning - 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.

      Returns:
      this
    • serviceRestartHandle

      @Stability(Stable) public InitServiceOptions.Builder serviceRestartHandle(InitServiceRestartHandle serviceRestartHandle)
      Parameters:
      serviceRestartHandle - 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.
      Returns:
      this
    • build

      @Stability(Stable) public InitServiceOptions build()
      Builds the configured instance.
      Specified by:
      build in interface software.amazon.jsii.Builder<InitServiceOptions>
      Returns:
      a new instance of InitServiceOptions
      Throws:
      NullPointerException - if any required attribute was not provided