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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds the configured instance.Sets the value ofInitServiceOptions.getEnabled()
ensureRunning
(Boolean ensureRunning) Sets the value ofInitServiceOptions.getEnsureRunning()
serviceRestartHandle
(InitServiceRestartHandle serviceRestartHandle) Sets the value ofInitServiceOptions.getServiceRestartHandle()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
enabled
Sets the value ofInitServiceOptions.getEnabled()
- 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
Sets the value ofInitServiceOptions.getEnsureRunning()
- 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) Sets the value ofInitServiceOptions.getServiceRestartHandle()
- Parameters:
serviceRestartHandle
- Restart service when the actions registered into the restartHandle have been performed. Register actions into the restartHandle by passing it toInitFile
,InitCommand
,InitPackage
andInitSource
objects.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<InitServiceOptions>
- Returns:
- a new instance of
InitServiceOptions
- Throws:
NullPointerException
- if any required attribute was not provided
-