Experimental
@aws-cdk/aws-imagebuilder-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
ComponentDocumentStep Struct
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 |
|---|---|
| Source | lib/component.ts |
Example
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
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
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();
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\"}" }
})
};
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
actionComponentActionactionComponentActionactionComponentActionActionComponentActionActionComponentAction required #The action to perform in the step.
ifoptionalComponentStepIfConditionifoptionalComponentStepIfConditionifoptionalComponentStepIfConditionIfoptionalComponentStepIfConditionIfoptionalComponentStepIfCondition #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
inputsComponentStepInputsinputsComponentStepInputsinputsComponentStepInputsInputsComponentStepInputsInputsComponentStepInputs required #Contains parameters required by the action to run the step.
loopoptionalComponentDocumentLooploopoptionalComponentDocumentLooploopoptionalComponentDocumentLoopLoopoptionalComponentDocumentLoopLoopoptionalComponentDocumentLoop = None #A looping construct defining a repeated sequence of instructions.
The name of the step.
onFailureoptionalComponentOnFailureon_failureoptionalComponentOnFailureonFailureoptionalComponentOnFailureOnFailureoptionalComponentOnFailureOnFailureoptionalComponentOnFailure = ComponentOnFailure.ABORT #Specifies what the step should do in case of failure.