InitCommandOptions

class aws_cdk.aws_ec2.InitCommandOptions(*, cwd=None, env=None, ignore_errors=None, key=None, service_restart_handles=None, test_cmd=None, wait_after_completion=None)

Bases: object

Options for InitCommand.

Parameters
  • cwd (Optional[str]) – The working directory. Default: - Use default working directory

  • env (Optional[Mapping[str, str]]) – Sets environment variables for the command. This property overwrites, rather than appends, the existing environment. Default: - Use current environment

  • ignore_errors (Optional[bool]) – Continue running if this command fails. Default: false

  • key (Optional[str]) – Identifier key for this command. Commands are executed in lexicographical order of their key names. Default: - Automatically generated based on index

  • service_restart_handles (Optional[List[InitServiceRestartHandle]]) – Restart the given service(s) after this command has run. Default: - Do not restart any service

  • test_cmd (Optional[str]) – 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

  • wait_after_completion (Optional[InitCommandWaitDuration]) – 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

Attributes

cwd

The working directory.

Default
  • Use default working directory

Return type

Optional[str]

env

Sets environment variables for the command.

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

Default
  • Use current environment

Return type

Optional[Mapping[str, str]]

ignore_errors

Continue running if this command fails.

Default

false

Return type

Optional[bool]

key

Identifier key for this command.

Commands are executed in lexicographical order of their key names.

Default
  • Automatically generated based on index

Return type

Optional[str]

service_restart_handles

Restart the given service(s) after this command has run.

Default
  • Do not restart any service

Return type

Optional[List[InitServiceRestartHandle]]

test_cmd

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

Return type

Optional[str]

wait_after_completion

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

Return type

Optional[InitCommandWaitDuration]