java.lang.Object
software.amazon.jsii.JsiiObject
software.amazon.awscdk.services.imagebuilder.alpha.ComponentData
All Implemented Interfaces:
software.amazon.jsii.JsiiSerializable
Direct Known Subclasses:
S3ComponentData

@Generated(value="jsii-pacmak/1.125.0 (build fdbe357)", date="2026-01-09T10:20:30.329Z") @Stability(Experimental) public abstract class ComponentData extends software.amazon.jsii.JsiiObject
(experimental) Helper class for referencing and uploading component data.

Example:

 Component component = Component.Builder.create(this, "EncryptedComponent")
         .platform(Platform.LINUX)
         .kmsKey(new Key(this, "ComponentKey"))
         .data(ComponentData.fromJsonObject(Map.of(
                 "schemaVersion", ComponentSchemaVersion.V1_0,
                 "phases", List.of(Map.of(
                         "name", ComponentPhaseName.BUILD,
                         "steps", List.of(Map.of(
                                 "name", "secure-setup",
                                 "action", ComponentAction.EXECUTE_BASH,
                                 "inputs", Map.of(
                                         "commands", List.of("echo \"This component data is encrypted with KMS\"")))))))))
         .build();
 
  • Nested Class Summary

    Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject

    software.amazon.jsii.JsiiObject.InitializationMode
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
    protected
    ComponentData(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
     
    protected
    ComponentData(software.amazon.jsii.JsiiObjectRef objRef)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    fromAsset(software.constructs.Construct scope, String id, String path)
    (experimental) Uploads component data from a local file to S3 to use as the component data.
    fromAsset(software.constructs.Construct scope, String id, String path, AssetOptions options)
    (experimental) Uploads component data from a local file to S3 to use as the component data.
    (experimental) Uses an inline JSON object as the component data, using the ComponentDocument interface.
    (experimental) Uses an inline JSON/YAML string as the component data.
    fromJsonObject(Map<String,? extends Object> data)
    (experimental) Uses an inline JSON object as the component data.
    fromS3(IBucket bucket, String key)
    (experimental) References component data from a pre-existing S3 object.
    (experimental) The rendered component data value, for use in CloudFormation.

    Methods inherited from class software.amazon.jsii.JsiiObject

    jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface software.amazon.jsii.JsiiSerializable

    $jsii$toJson
  • Constructor Details

    • ComponentData

      protected ComponentData(software.amazon.jsii.JsiiObjectRef objRef)
    • ComponentData

      protected ComponentData(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
    • ComponentData

      @Stability(Experimental) protected ComponentData()
  • Method Details

    • fromAsset

      @Stability(Experimental) @NotNull public static S3ComponentData fromAsset(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String path, @Nullable AssetOptions options)
      (experimental) Uploads component data from a local file to S3 to use as the component data.

      Parameters:
      scope - The construct scope. This parameter is required.
      id - Identifier of the construct. This parameter is required.
      path - The local path to the component data file. This parameter is required.
      options - S3 asset upload options.
    • fromAsset

      @Stability(Experimental) @NotNull public static S3ComponentData fromAsset(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String path)
      (experimental) Uploads component data from a local file to S3 to use as the component data.

      Parameters:
      scope - The construct scope. This parameter is required.
      id - Identifier of the construct. This parameter is required.
      path - The local path to the component data file. This parameter is required.
    • fromComponentDocumentJsonObject

      @Stability(Experimental) @NotNull public static ComponentData fromComponentDocumentJsonObject(@NotNull ComponentDocument data)
      (experimental) Uses an inline JSON object as the component data, using the ComponentDocument interface.

      Parameters:
      data - An inline JSON object representing the component data. This parameter is required.
    • fromInline

      @Stability(Experimental) @NotNull public static ComponentData fromInline(@NotNull String data)
      (experimental) Uses an inline JSON/YAML string as the component data.

      Parameters:
      data - An inline JSON/YAML string representing the component data. This parameter is required.
    • fromJsonObject

      @Stability(Experimental) @NotNull public static ComponentData fromJsonObject(@NotNull Map<String,? extends Object> data)
      (experimental) Uses an inline JSON object as the component data.

      Parameters:
      data - An inline JSON object representing the component data. This parameter is required.
    • fromS3

      @Stability(Experimental) @NotNull public static S3ComponentData fromS3(@NotNull IBucket bucket, @NotNull String key)
      (experimental) References component data from a pre-existing S3 object.

      Parameters:
      bucket - The S3 bucket where the component data is stored. This parameter is required.
      key - The S3 key of the component data file. This parameter is required.
    • render

      @Stability(Experimental) @NotNull public abstract ComponentDataConfig render()
      (experimental) The rendered component data value, for use in CloudFormation.

      • For inline components, data is the component text
      • For S3-backed components, uri is the S3 URL