@Generated(value="jsii-pacmak/1.70.0 (build 03c2f6f)", date="2022-11-01T13:16:46.956Z") @Stability(value=Experimental) public class InitServiceRestartHandle extends software.amazon.jsii.JsiiObject
Pass an instance of this object to the InitFile, InitCommand,
InitSource and InitPackage objects, and finally to an InitService
itself to cause the actions (files, commands, sources, and packages)
to trigger a restart of the service.
For example, the following will run a custom command to install Nginx, and trigger the nginx service to be restarted after the command has run.
InitServiceRestartHandle handle = new InitServiceRestartHandle();
CloudFormationInit.fromElements(InitCommand.shellCommand("/usr/bin/custom-nginx-install.sh", InitCommandOptions.builder().serviceRestartHandles(List.of(handle)).build()), InitService.enable("nginx", InitServiceOptions.builder().serviceRestartHandle(handle).build()));
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()));
| Modifier | Constructor and Description |
|---|---|
|
InitServiceRestartHandle() |
protected |
InitServiceRestartHandle(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
InitServiceRestartHandle(software.amazon.jsii.JsiiObjectRef objRef) |
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetprotected InitServiceRestartHandle(software.amazon.jsii.JsiiObjectRef objRef)
protected InitServiceRestartHandle(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Experimental) public InitServiceRestartHandle()
Copyright © 2022. All rights reserved.