Interface InitCommandOptions
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
InitCommandOptions.Jsii$Proxy
@Generated(value="jsii-pacmak/1.118.0 (build 02eec31)",
date="2025-11-04T09:27:40.346Z")
@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 classA builder forInitCommandOptionsstatic final classAn implementation forInitCommandOptions -
Method Summary
Modifier and TypeMethodDescriptionstatic InitCommandOptions.Builderbuilder()default StringgetCwd()The working directory.getEnv()Sets environment variables for the command.default BooleanContinue running if this command fails.default StringgetKey()Identifier key for this command.default List<InitServiceRestartHandle> Restart the given service(s) after this command has run.default StringCommand to determine whether this command should be run.default InitCommandWaitDurationThe 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.BuilderofInitCommandOptions
-