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

The step to run in a specific phase of the image build, which defines the step to execute to customize or test the instance.

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

## Example

TypeScript:

```ts
const step: imagebuilder.ComponentDocumentStep = {
  name: 'configure-app',
  action: imagebuilder.ComponentAction.CREATE_FILE,
  inputs: imagebuilder.ComponentStepInputs.fromObject({
    path: '/etc/myapp/config.json',
    content: '{"env": "production"}'
  })
};
```

Python:

```python
step = imagebuilder.ComponentDocumentStep(
    name="configure-app",
    action=imagebuilder.ComponentAction.CREATE_FILE,
    inputs=imagebuilder.ComponentStepInputs.from_object({
        "path": "/etc/myapp/config.json",
        "content": "{\"env\": \"production\"}"
    })
)
```

Java:

```java
ComponentDocumentStep step = ComponentDocumentStep.builder()
        .name("configure-app")
        .action(ComponentAction.CREATE_FILE)
        .inputs(ComponentStepInputs.fromObject(Map.of(
                "path", "/etc/myapp/config.json",
                "content", "{\"env\": \"production\"}")))
        .build();
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.AWS.ImageBuilder.Alpha
var step = new ComponentDocumentStep {
    Name = "configure-app",
    Action = ComponentAction.CREATE_FILE,
    Inputs = ComponentStepInputs.FromObject(new Dictionary<string, object> {
        { "path", "/etc/myapp/config.json" },
        { "content", "{\"env\": \"production\"}" }
    })
};
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awsimagebuilderalpha/v2
step := &ComponentDocumentStep{
	Name: jsii.String("configure-app"),
	Action: imagebuilder.ComponentAction_CREATE_FILE,
	Inputs: imagebuilder.ComponentStepInputs_FromObject(map[string]interface{}{
		"path": jsii.String("/etc/myapp/config.json"),
		"content": jsii.String("{\"env\": \"production\"}"),
	}),
}
```

## Properties

- `action`: [ComponentAction](/cdk/api/v2/docs/@aws-cdk_aws-imagebuilder-alpha.ComponentAction.html) (required) — The action to perform in the step.

- `if`: [ComponentStepIfCondition](/cdk/api/v2/docs/@aws-cdk_aws-imagebuilder-alpha.ComponentStepIfCondition.html) — The condition to apply to the step.

  **Default:** no condition is applied to the step and it gets executed

  If the condition is false, then the step is skipped

- `inputs`: [ComponentStepInputs](/cdk/api/v2/docs/@aws-cdk_aws-imagebuilder-alpha.ComponentStepInputs.html) (required) — Contains parameters required by the action to run the step.

- `loop`: [ComponentDocumentLoop](/cdk/api/v2/docs/@aws-cdk_aws-imagebuilder-alpha.ComponentDocumentLoop.html) = None — A looping construct defining a repeated sequence of instructions.

- `name`: string (required) — The name of the step.

- `onFailure`: [ComponentOnFailure](/cdk/api/v2/docs/@aws-cdk_aws-imagebuilder-alpha.ComponentOnFailure.html) = ComponentOnFailure.ABORT — Specifies what the step should do in case of failure.

- `timeout`: [Duration](/cdk/api/v2/docs/aws-cdk-lib.Duration.html) — The timeout of the step.

  **Default:** 120 minutes
