Interface InitCommandOptions
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
InitCommandOptions.Jsii$Proxy
@Generated(value="jsii-pacmak/1.109.0 (build c221850)",
date="2025-03-14T03:24:57.252Z")
@Stability(Stable)
public interface InitCommandOptions
extends software.amazon.jsii.JsiiSerializable
Options for InitCommand.
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()));
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final class
A builder forInitCommandOptions
static final class
An implementation forInitCommandOptions
-
Method Summary
Modifier and TypeMethodDescriptionstatic InitCommandOptions.Builder
builder()
default String
getCwd()
The working directory.getEnv()
Sets environment variables for the command.default Boolean
Continue running if this command fails.default String
getKey()
Identifier key for this command.default List<InitServiceRestartHandle>
Restart the given service(s) after this command has run.default String
Command to determine whether this command should be run.default InitCommandWaitDuration
The duration to wait after a command has finished in case the command causes a reboot.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getCwd
The working directory.Default: - Use default working directory
-
getEnv
Sets environment variables for the command.This property overwrites, rather than appends, the existing environment.
Default: - Use current environment
-
getIgnoreErrors
Continue running if this command fails.Default: false
-
getKey
Identifier key for this command.Commands are executed in lexicographical order of their key names.
Default: - Automatically generated based on index
-
getServiceRestartHandles
Restart the given service(s) after this command has run.Default: - Do not restart any service
-
getTestCmd
Command to determine whether this command should be run.If the test passes (exits with error code of 0), the command is run.
Default: - Always run the command
-
getWaitAfterCompletion
The duration to wait after a command has finished in case the command causes a reboot.Set this value to
InitCommandWaitDuration.none()
if you do not want to wait for every command;InitCommandWaitDuration.forever()
directs cfn-init to exit and resume only after the reboot is complete.For Windows systems only.
Default: - 60 seconds
-
builder
- Returns:
- a
InitCommandOptions.Builder
ofInitCommandOptions
-