MDAA TS Docs
    Preparing search index...

    Command execution configuration for CloudFormation Init. Provide either shellCommand or argvs. Commands run in lexicographical order of their key.

    interface CommandProps {
        argvs?: string[];
        env?: NamedEnvProps;
        ignoreErrors?: boolean;
        restartRequired?: boolean;
        shellCommand?: string;
        testCommand?: string;
        waitAfterCompletion?: number;
        waitForever?: boolean;
        waitNone?: boolean;
        workingDir?: string;
    }
    Index

    Properties

    argvs?: string[]

    Command as an argument vector. Provide either argvs or shellCommand, not both.

    Use cases: Commands with complex quoting; Explicit argument passing

    AWS: CloudFormation::Init commands (argv form)

    Validation: Optional; array of strings; mutually exclusive with shellCommand

    Environment variables for the command. Overwrites (not appends) the existing environment.

    Use cases: Injecting config values; Isolated command environments

    AWS: CloudFormation::Init command env

    Validation: Optional; map of variable name to value

    ignoreErrors?: boolean

    Continue running subsequent commands if this one fails.

    Use cases: Non-critical setup steps; Best-effort commands

    AWS: CloudFormation::Init command ignoreErrors

    Validation: Optional; boolean

    false
    
    restartRequired?: boolean

    When true, restarts associated services after this command runs.

    Use cases: Config changes requiring service reload

    AWS: CloudFormation::Init restart handle

    Validation: Optional; boolean

    false
    
    shellCommand?: string

    Shell command string to execute. Provide either shellCommand or argvs, not both.

    Use cases: Inline shell scripts; One-liner setup commands

    AWS: CloudFormation::Init commands (shell form)

    Validation: Optional; string; mutually exclusive with argvs

    testCommand?: string

    Test command run before the main command. If the test exits with code 0, the main command is skipped (test success = already done).

    Use cases: Idempotent commands; Conditional execution

    AWS: CloudFormation::Init command test

    Validation: Optional; shell command string

    waitAfterCompletion?: number

    Minutes to wait after command completion (Windows only). Use waitForever or waitNone for reboot-aware alternatives.

    Use cases: Post-reboot wait on Windows; Timed command completion

    AWS: CloudFormation::Init command waitAfterCompletion

    Validation: Optional; number (minutes)

    1
    
    waitForever?: boolean

    Wait indefinitely for the instance to reboot and resume cfn-init. Mutually exclusive with waitAfterCompletion and waitNone.

    Use cases: Commands that trigger a reboot (e.g. Windows updates)

    AWS: CloudFormation::Init command waitAfterCompletion=forever

    Validation: Optional; boolean

    waitNone?: boolean

    Do not wait after this command completes. Mutually exclusive with waitAfterCompletion and waitForever.

    Use cases: Fire-and-forget commands; Fast sequential execution

    AWS: CloudFormation::Init command waitAfterCompletion=none

    Validation: Optional; boolean

    workingDir?: string

    Working directory for command execution.

    Use cases: Running commands in application directories

    AWS: CloudFormation::Init command cwd

    Validation: Optional; valid directory path