> **Experimental**
>
> `@aws-cdk/aws-imagebuilder-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# ComponentOnFailure

Specifies what the step should do in case of failure.

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/component.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0-alpha.0/packages/@aws-cdk/aws-imagebuilder-alpha/lib/component.ts#L548)

## Example

```ts
const component = new imagebuilder.Component(this, 'StructuredComponent', {
  platform: imagebuilder.Platform.LINUX,
  data: imagebuilder.ComponentData.fromComponentDocumentJsonObject({
    schemaVersion: imagebuilder.ComponentSchemaVersion.V1_0,
    phases: [
      {
        name: imagebuilder.ComponentPhaseName.BUILD,
        steps: [
          {
            name: 'install-with-timeout',
            action: imagebuilder.ComponentAction.EXECUTE_BASH,
            timeout: Duration.minutes(10),
            onFailure: imagebuilder.ComponentOnFailure.CONTINUE,
            inputs: imagebuilder.ComponentStepInputs.fromObject({
              commands: ['./install-script.sh']
            })
          }
        ]
      }
    ]
  })
});
```

## Members

| Member | Description |
| --- | --- |
| `ABORT` | Fails the step and document execution. |
| `CONTINUE` | Fails the step and proceeds to execute the next step in the document. |
| `IGNORE` | Ignores the step and proceeds to execute the next step in the document. |

## Referenced by

- [`ComponentDocumentStep`](/v2/docs/@aws-cdk_aws-imagebuilder-alpha.ComponentDocumentStep).onFailure
