class ComponentData
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.ImageBuilder.Alpha.ComponentData |
Go | github.com/aws/aws-cdk-go/awsimagebuilderalpha/v2#ComponentData |
Java | software.amazon.awscdk.services.imagebuilder.alpha.ComponentData |
Python | aws_cdk.aws_imagebuilder_alpha.ComponentData |
TypeScript (source) | @aws-cdk/aws-imagebuilder-alpha ยป ComponentData |
Helper class for referencing and uploading component data.
Example
const component = new imagebuilder.Component(this, 'MyComponent', {
platform: imagebuilder.Platform.LINUX,
data: imagebuilder.ComponentData.fromJsonObject({
schemaVersion: imagebuilder.ComponentSchemaVersion.V1_0,
phases: [
{
name: imagebuilder.ComponentPhaseName.BUILD,
steps: [
{
name: 'install-app',
action: imagebuilder.ComponentAction.EXECUTE_BASH,
inputs: {
commands: ['echo "Installing my application..."', 'yum update -y'],
},
},
],
},
],
}),
});
Initializer (protected)
super(value: string)
Parameters
- value
string
Properties
| Name | Type | Description |
|---|---|---|
| is | boolean | Indicates that the provided component data is an S3 reference. |
| value | string | The resulting inline string or S3 URL which references the component data. |
isS3Reference
Type:
boolean
Indicates that the provided component data is an S3 reference.
value
Type:
string
The resulting inline string or S3 URL which references the component data.
Methods
| Name | Description |
|---|---|
| static from | Uploads component data from a local file to S3 to use as the component data. |
| static from | Uses an inline JSON object as the component data, using the ComponentDocument interface. |
| static from | Uses an inline JSON/YAML string as the component data. |
| static from | Uses an inline JSON object as the component data. |
| static from | References component data from a pre-existing S3 object. |
static fromAsset(scope, id, path, options?)
public static fromAsset(scope: Construct, id: string, path: string, options?: AssetOptions): S3ComponentData
Parameters
- scope
Constructโ The construct scope. - id
stringโ Identifier of the construct. - path
stringโ The local path to the component data file. - options
Assetโ S3 asset upload options.Options
Returns
Uploads component data from a local file to S3 to use as the component data.
static fromComponentDocumentJsonObject(data)
public static fromComponentDocumentJsonObject(data: ComponentDocument): ComponentData
Parameters
- data
Componentโ An inline JSON object representing the component data.Document
Returns
Uses an inline JSON object as the component data, using the ComponentDocument interface.
static fromInline(data)
public static fromInline(data: string): ComponentData
Parameters
- data
stringโ An inline JSON/YAML string representing the component data.
Returns
Uses an inline JSON/YAML string as the component data.
static fromJsonObject(data)
public static fromJsonObject(data: { [string]: any }): ComponentData
Parameters
- data
{ [string]: any }โ An inline JSON object representing the component data.
Returns
Uses an inline JSON object as the component data.
static fromS3(bucket, key)
public static fromS3(bucket: IBucket, key: string): S3ComponentData
Parameters
- bucket
IBucketโ The S3 bucket where the component data is stored. - key
stringโ The S3 key of the component data file.
Returns
References component data from a pre-existing S3 object.

.NET
Go
Java
Python
TypeScript (