@Generated(value="jsii-pacmak/1.73.0 (build 6faeda3)", date="2023-01-31T18:36:53.360Z") public class InitCommand extends InitElement
Example:
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()));
Modifier | Constructor and Description |
---|---|
protected |
InitCommand(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
InitCommand(software.amazon.jsii.JsiiObjectRef objRef) |
Modifier and Type | Method and Description |
---|---|
static InitCommand |
argvCommand(java.util.List<java.lang.String> argv)
Run a command from an argv array.
|
static InitCommand |
argvCommand(java.util.List<java.lang.String> argv,
InitCommandOptions options)
Run a command from an argv array.
|
java.lang.String |
getElementType()
Returns the init element type for this element.
|
static InitCommand |
shellCommand(java.lang.String shellCommand)
Run a shell command.
|
static InitCommand |
shellCommand(java.lang.String shellCommand,
InitCommandOptions options)
Run a shell command.
|
protected InitCommand(software.amazon.jsii.JsiiObjectRef objRef)
protected InitCommand(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
public static InitCommand argvCommand(java.util.List<java.lang.String> argv, InitCommandOptions options)
You do not need to escape space characters or enclose command parameters in quotes.
argv
- This parameter is required.options
- public static InitCommand argvCommand(java.util.List<java.lang.String> argv)
You do not need to escape space characters or enclose command parameters in quotes.
argv
- This parameter is required.public static InitCommand shellCommand(java.lang.String shellCommand, InitCommandOptions options)
Remember that some characters like &
, |
, ;
, >
etc. have special meaning in a shell and
need to be preceded by a \
if you want to treat them as part of a filename.
shellCommand
- This parameter is required.options
- public static InitCommand shellCommand(java.lang.String shellCommand)
Remember that some characters like &
, |
, ;
, >
etc. have special meaning in a shell and
need to be preceded by a \
if you want to treat them as part of a filename.
shellCommand
- This parameter is required.public java.lang.String getElementType()
getElementType
in class InitElement