Experimental
@aws-cdk/aws-imagebuilder-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.
ComponentDocumentPhase Struct
The phase to run in a specific workflow in an image build, which define the steps to execute to customize or test the instance.
Example
ts
const phase: imagebuilder.ComponentDocumentPhase = {
name: imagebuilder.ComponentPhaseName.BUILD,
steps: [
{
name: 'configure-app',
action: imagebuilder.ComponentAction.CREATE_FILE,
inputs: imagebuilder.ComponentStepInputs.fromObject({
path: '/etc/myapp/config.json',
content: '{"env": "production"}'
})
}
]
};
python
phase = imagebuilder.ComponentDocumentPhase(
name=imagebuilder.ComponentPhaseName.BUILD,
steps=[imagebuilder.ComponentDocumentStep(
name="configure-app",
action=imagebuilder.ComponentAction.CREATE_FILE,
inputs=imagebuilder.ComponentStepInputs.from_object({
"path": "/etc/myapp/config.json",
"content": "{\"env\": \"production\"}"
})
)
]
)
java
ComponentDocumentPhase phase = ComponentDocumentPhase.builder()
.name(ComponentPhaseName.BUILD)
.steps(List.of(ComponentDocumentStep.builder()
.name("configure-app")
.action(ComponentAction.CREATE_FILE)
.inputs(ComponentStepInputs.fromObject(Map.of(
"path", "/etc/myapp/config.json",
"content", "{\"env\": \"production\"}")))
.build()))
.build();
csharp
// Install: dotnet add package Amazon.CDK.AWS.ImageBuilder.Alpha
var phase = new ComponentDocumentPhase {
Name = ComponentPhaseName.BUILD,
Steps = new [] { 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
phase := &ComponentDocumentPhase{
Name: imagebuilder.ComponentPhaseName_BUILD,
Steps: []ComponentDocumentStep{
&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
nameComponentPhaseNamenameComponentPhaseNamenameComponentPhaseNameNameComponentPhaseNameNameComponentPhaseNamerequired#The name of the phase.
stepsComponentDocumentStep[]stepstyping.List[ComponentDocumentStep]stepsList<ComponentDocumentStep>StepsComponentDocumentStep[]Steps*[]ComponentDocumentSteprequired#The list of steps to execute to modify or test the build/test instance.