java.lang.Object
software.amazon.jsii.JsiiObject
software.constructs.Construct
software.amazon.awscdk.Resource
software.amazon.awscdk.services.imagebuilder.alpha.Component
All Implemented Interfaces:
IEnvironmentAware, IResource, IComponent, software.amazon.jsii.JsiiSerializable, software.constructs.IConstruct, software.constructs.IDependable

@Generated(value="jsii-pacmak/1.119.0 (build 1634eac)", date="2025-11-20T23:37:34.437Z") @Stability(Experimental) public class Component extends Resource implements IComponent
(experimental) Represents an EC2 Image Builder Component.

Example:

 Component component = Component.Builder.create(this, "MyComponent")
         .platform(Platform.LINUX)
         .data(ComponentData.fromJsonObject(Map.of(
                 "schemaVersion", ComponentSchemaVersion.V1_0,
                 "phases", List.of(Map.of(
                         "name", ComponentPhaseName.BUILD,
                         "steps", List.of(Map.of(
                                 "name", "install-app",
                                 "action", ComponentAction.EXECUTE_BASH,
                                 "inputs", Map.of(
                                         "commands", List.of("echo \"Installing my application...\"", "yum update -y")))))))))
         .build();
 

See Also:
  • Field Details

    • PROPERTY_INJECTION_ID

      @Stability(Experimental) public static final String PROPERTY_INJECTION_ID
      (experimental) Uniquely identifies this class.
  • Constructor Details

    • Component

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

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

      @Stability(Experimental) public Component(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ComponentProps props)
      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • fromComponentArn

      @Stability(Experimental) @NotNull public static IComponent fromComponentArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String componentArn)
      (experimental) Import an existing component given its ARN.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      componentArn - This parameter is required.
    • fromComponentAttributes

      @Stability(Experimental) @NotNull public static IComponent fromComponentAttributes(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull ComponentAttributes attrs)
      (experimental) Import an existing component by providing its attributes.

      If the component name is provided as an attribute, it must be normalized by converting all alphabetical characters to lowercase, and replacing all spaces and underscores with hyphens.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      attrs - This parameter is required.
    • fromComponentName

      @Stability(Experimental) @NotNull public static IComponent fromComponentName(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String componentName)
      (experimental) Import an existing component given its name.

      The provided name must be normalized by converting all alphabetical characters to lowercase, and replacing all spaces and underscores with hyphens.

      Parameters:
      scope - This parameter is required.
      id - This parameter is required.
      componentName - This parameter is required.
    • isComponent

      @Stability(Experimental) @NotNull public static Boolean isComponent(@NotNull Object x)
      (experimental) Return whether the given object is a Component.

      Parameters:
      x - This parameter is required.
    • grant

      @Stability(Experimental) @NotNull public Grant grant(@NotNull IGrantable grantee, @NotNull String... actions)
      (experimental) Grant custom actions to the given grantee for the component.

      Specified by:
      grant in interface IComponent
      Parameters:
      grantee - The principal. This parameter is required.
      actions - The list of actions. This parameter is required.
    • grantRead

      @Stability(Experimental) @NotNull public Grant grantRead(@NotNull IGrantable grantee)
      (experimental) Grant read permissions to the given grantee for the component.

      Specified by:
      grantRead in interface IComponent
      Parameters:
      grantee - The principal. This parameter is required.
    • getComponentArn

      @Stability(Experimental) @NotNull public String getComponentArn()
      (experimental) The ARN of the component.
      Specified by:
      getComponentArn in interface IComponent
    • getComponentName

      @Stability(Experimental) @NotNull public String getComponentName()
      (experimental) The name of the component.
      Specified by:
      getComponentName in interface IComponent
    • getComponentType

      @Stability(Experimental) @NotNull public String getComponentType()
      (experimental) The type of the component.
    • getComponentVersion

      @Stability(Experimental) @NotNull public String getComponentVersion()
      (experimental) The version of the component.
      Specified by:
      getComponentVersion in interface IComponent
    • getEncrypted

      @Stability(Experimental) @NotNull public Boolean getEncrypted()
      (experimental) Whether the component is encrypted.
    • getKmsKey

      @Stability(Experimental) @Nullable protected IKey getKmsKey()