Interface InitCommandOptions

All Superinterfaces:
All Known Implementing Classes:

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:39.366Z") @Stability(Stable) public interface InitCommandOptions extends
Options for InitCommand.


 InitServiceRestartHandle handle = new InitServiceRestartHandle();
 CloudFormationInit.fromElements(InitCommand.shellCommand("/usr/bin/", InitCommandOptions.builder().serviceRestartHandles(List.of(handle)).build()), InitService.enable("nginx", InitServiceOptions.builder().serviceRestartHandle(handle).build()));
  • Method Details

    • getCwd

      @Stability(Stable) @Nullable default String getCwd()
      The working directory.

      Default: - Use default working directory

    • getEnv

      @Stability(Stable) @Nullable default Map<String,String> getEnv()
      Sets environment variables for the command.

      This property overwrites, rather than appends, the existing environment.

      Default: - Use current environment

    • getIgnoreErrors

      @Stability(Stable) @Nullable default Boolean getIgnoreErrors()
      Continue running if this command fails.

      Default: false

    • getKey

      @Stability(Stable) @Nullable default String getKey()
      Identifier key for this command.

      Commands are executed in lexicographical order of their key names.

      Default: - Automatically generated based on index

    • getServiceRestartHandles

      @Stability(Stable) @Nullable default List<InitServiceRestartHandle> getServiceRestartHandles()
      Restart the given service(s) after this command has run.

      Default: - Do not restart any service

    • getTestCmd

      @Stability(Stable) @Nullable default String 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

      @Stability(Stable) @Nullable default InitCommandWaitDuration 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

      @Stability(Stable) static InitCommandOptions.Builder builder()
      a InitCommandOptions.Builder of InitCommandOptions