@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:38.449Z") @Stability(value=Stable) 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.
// Example automatically generated from non-compiling source. May contain errors.
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:
// Example automatically generated from non-compiling source. May contain errors.
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=Stable) public InitServiceRestartHandle()
Copyright © 2022. All rights reserved.