Interface InitCommandOptions

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
InitCommandOptions.Jsii$Proxy

@Generated(value="jsii-pacmak/1.101.0 (build b95fe5d)", date="2024-08-02T00:29:09.870Z") @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()));
 
  • 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()
      Returns:
      a InitCommandOptions.Builder of InitCommandOptions