Skip to content

feat(imagebuilder-alpha): add support for Component Construct#36006

Merged
mergify[bot] merged 8 commits intoaws:mainfrom
tarunb12:imagebuilder-component
Nov 17, 2025
Merged

feat(imagebuilder-alpha): add support for Component Construct#36006
mergify[bot] merged 8 commits intoaws:mainfrom
tarunb12:imagebuilder-component

Conversation

@tarunb12
Copy link
Copy Markdown
Contributor

Issue

aws/aws-cdk-rfcs#789

Reason for this change

This change adds a new alpha module for EC2 Image Builder L2 Constructs (@aws-cdk/aws-imagebuilder-alpha), as outlined in aws/aws-cdk-rfcs#789. This PR specifically implements the Component construct.

Description of changes

This change implements the Component construct, which is a higher-level construct of CfnComponent.

Example

const component = new imagebuilder.Component(this, 'Component', {
  componentName: 'build-and-test-component',
  componentVersion: '1.0.0',
  description: 'A build and test component',
  changeDescription: 'Initial version',
  // Encrypt component data with a KMS key
  kmsKey: kms.Key.fromKeyArn(
    this,
    'ComponentKey',
    this.formatArn({ service: 'kms', resource: 'key', resourceName: '1234abcd-12ab-34cd-56ef-1234567890ab' })
  ),
  platform: imagebuilder.Platform.LINUX,
  // Include the OS versions this component supports
  supportedOsVersions: [
    imagebuilder.OSVersion.AMAZON_LINUX,
    imagebuilder.OSVersion.RHEL_10,
    imagebuilder.OSVersion.SLES_15,
    imagebuilder.OSVersion.UBUNTU
  ],
  // Hello world component data
  data: imagebuilder.ComponentData.fromJsonObject({
    name: 'build-and-test-component',
    schemaVersion: imagebuilder.ComponentSchemaVersion.V1_0,
    phases: [
      {
        name: imagebuilder.ComponentPhaseName.BUILD,
        steps: [
          {
            action: imagebuilder.ComponentAction.EXECUTE_BASH,
            name: 'hello-world-build',
            inputs: {
              commands: ['echo "Hello build!"']
            }
          }
        ]
      },
      {
        name: imagebuilder.ComponentPhaseName.VALIDATE,
        steps: [
          {
            action: imagebuilder.ComponentAction.EXECUTE_BASH,
            name: 'hello-world-validate',
            inputs: {
              commands: ['echo "Hello validate!"']
            }
          }
        ]
      },
      {
        name: imagebuilder.ComponentPhaseName.TEST,
        steps: [
          {
            action: imagebuilder.ComponentAction.EXECUTE_BASH,
            name: 'hello-world-test',
            inputs: {
              commands: ['echo "Hello test!"']
            }
          }
        ]
      }
    ]
  })
});

Describe any new or updated permissions being added

N/A - new L2 construct in alpha module

Description of how you validated changes

Validated with unit tests and integration tests. Manually verified generated CFN templates as well.

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@github-actions github-actions bot added the beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK label Nov 11, 2025
@aws-cdk-automation aws-cdk-automation requested a review from a team November 11, 2025 08:18
@github-actions github-actions bot added the p2 label Nov 11, 2025
@aws-cdk-automation aws-cdk-automation added the pr/needs-further-review PR requires additional review from our team specialists due to the scope or complexity of changes. label Nov 11, 2025
@tarunb12 tarunb12 force-pushed the imagebuilder-component branch from 2b1ee8a to b9d17a0 Compare November 11, 2025 09:23
@tarunb12 tarunb12 marked this pull request as ready for review November 11, 2025 09:30
@ozelalisen ozelalisen self-assigned this Nov 11, 2025
Copy link
Copy Markdown
Member

@ozelalisen ozelalisen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments as first part of the review, I am not fully completed

Copy link
Copy Markdown
Member

@ozelalisen ozelalisen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Publishing second round of comments

@ozelalisen ozelalisen changed the title feat(imagebuilder): add support for EC2 Image Builder L2 Constructs - Component feat(imagebuilder-alpha): add support for Component Construct Nov 13, 2025
@ozelalisen
Copy link
Copy Markdown
Member

Just reminder for next PRs that title should include alpha suffix to be appeared in the CHANGELOG correctly

@tarunb12 tarunb12 force-pushed the imagebuilder-component branch from b9d17a0 to 5667d1a Compare November 14, 2025 09:46
@mergify mergify bot dismissed ozelalisen’s stale review November 14, 2025 09:46

Pull request has been modified.

@mergify mergify bot dismissed ozelalisen’s stale review November 14, 2025 16:05

Pull request has been modified.

@tarunb12 tarunb12 force-pushed the imagebuilder-component branch from 33fb075 to 0d7a7d4 Compare November 14, 2025 19:01
@aws-cdk-automation aws-cdk-automation removed the pr/needs-further-review PR requires additional review from our team specialists due to the scope or complexity of changes. label Nov 14, 2025
@tarunb12 tarunb12 force-pushed the imagebuilder-component branch from c913c97 to ac32fa8 Compare November 14, 2025 22:48
@aws-cdk-automation aws-cdk-automation added the pr/needs-further-review PR requires additional review from our team specialists due to the scope or complexity of changes. label Nov 14, 2025
@tarunb12 tarunb12 force-pushed the imagebuilder-component branch 2 times, most recently from 19c626e to ae6e5fe Compare November 16, 2025 18:24
@tarunb12 tarunb12 force-pushed the imagebuilder-component branch from ae6e5fe to 543dea7 Compare November 16, 2025 20:34
@tarunb12 tarunb12 force-pushed the imagebuilder-component branch from eaabce9 to ee7672a Compare November 17, 2025 04:55
@aws-cdk-automation aws-cdk-automation removed the pr/needs-further-review PR requires additional review from our team specialists due to the scope or complexity of changes. label Nov 17, 2025
@ozelalisen ozelalisen added the pr/needs-integration-tests-deployment Requires the PR to deploy the integration test snapshots. label Nov 17, 2025
@ozelalisen ozelalisen had a problem deploying to deployment-integ-test November 17, 2025 10:47 — with GitHub Actions Failure
@ozelalisen ozelalisen had a problem deploying to deployment-integ-test November 17, 2025 12:12 — with GitHub Actions Failure
@ozelalisen ozelalisen removed the pr/needs-integration-tests-deployment Requires the PR to deploy the integration test snapshots. label Nov 17, 2025
Copy link
Copy Markdown
Member

@ozelalisen ozelalisen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for addressing all comments, I have last two comments, rest is looking good.

@mergify mergify bot dismissed ozelalisen’s stale review November 17, 2025 15:42

Pull request has been modified.

Copy link
Copy Markdown
Member

@ozelalisen ozelalisen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you again for addressing all comments, ready to merge now

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Nov 17, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@aws-cdk-automation aws-cdk-automation added the pr/needs-further-review PR requires additional review from our team specialists due to the scope or complexity of changes. label Nov 17, 2025
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Nov 17, 2025

Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork).

@mergify mergify bot merged commit 5ebf07d into aws:main Nov 17, 2025
25 of 27 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 17, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

beginning-contributor [Pilot] contributed between 0-2 PRs to the CDK p2 pr/needs-further-review PR requires additional review from our team specialists due to the scope or complexity of changes.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants