@Generated(value="jsii-pacmak/1.73.0 (build 6faeda3)", date="2023-01-25T18:29:03.561Z") public class InitService extends InitElement
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 |
---|---|
protected |
InitService(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
InitService(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
static InitService |
disable(java.lang.String serviceName)
Disable and stop the given service.
|
static InitService |
enable(java.lang.String serviceName)
Enable and start the given service, optionally restarting it.
|
static InitService |
enable(java.lang.String serviceName,
InitServiceOptions options)
Enable and start the given service, optionally restarting it.
|
java.lang.String |
getElementType()
Returns the init element type for this element.
|
protected InitService(software.amazon.jsii.JsiiObjectRef objRef)
protected InitService(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public static InitService disable(java.lang.String serviceName)
serviceName
- This parameter is required.public static InitService enable(java.lang.String serviceName, InitServiceOptions options)
serviceName
- This parameter is required.options
- public static InitService enable(java.lang.String serviceName)
serviceName
- This parameter is required.public java.lang.String getElementType()
getElementType
in class InitElement