Interface InitServiceOptions
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
InitServiceOptions.Jsii$Proxy
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 ClassesModifier and TypeInterfaceDescriptionstatic final classA builder forInitServiceOptionsstatic final classAn implementation forInitServiceOptions -
Method Summary
Modifier and TypeMethodDescriptionstatic InitServiceOptions.Builderbuilder()default BooleanEnable or disable this service.default BooleanMake sure this service is running or not running after cfn-init finishes.default ServiceManagerWhat service manager to use.default InitServiceRestartHandleRestart service when the actions registered into the restartHandle have been performed.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
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
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
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
Restart service when the actions registered into the restartHandle have been performed.Register actions into the restartHandle by passing it to
InitFile,InitCommand,InitPackageandInitSourceobjects.Default: - No files trigger restart
-
builder
- Returns:
- a
InitServiceOptions.BuilderofInitServiceOptions
-