Registry /
aws / aws-cdk-aws-imagebuilder
Install & Compatibility
Where this runs
tested against v1.204.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 28.9MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.5s · import 0.000s · 29MB
28MB installed
● package 28MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
CfnImageRecipe
✓ from aws_cdk.aws_imagebuilder import CfnImageRecipe
✗ from aws_cdk.aws_imagebuilder.CfnImageRecipe import *
CfnImageRecipe is a class, not a module. Import the class directly from the aws_imagebuilder module.
CfnInfrastructureConfiguration
✓ from aws_cdk.aws_imagebuilder import CfnInfrastructureConfiguration
Correct import path for infrastructure configuration.
Creates a minimal CDK stack with an EC2 Image Builder image recipe, infrastructure configuration, and pipeline.
import aws_cdk as cdk
from aws_cdk import aws_imagebuilder as imagebuilder
app = cdk.App()
stack = cdk.Stack(app, "ImageBuilderStack")
# Create an Image Pipeline
image_recipe = imagebuilder.CfnImageRecipe(
stack,
"MyRecipe",
name="my-recipe",
version="1.0.0",
parent_image="amazonlinux-2-x86_64",
components=[
imagebuilder.CfnImageRecipe.ComponentConfigurationProperty(
component_arn="arn:aws:imagebuilder:us-east-1:aws:component/amazon-cloudwatch-agent/x.x.x"
)
],
working_directory="/tmp"
)
infra_config = imagebuilder.CfnInfrastructureConfiguration(
stack,
"MyInfraConfig",
name="my-infra-config",
instance_types=["t3.micro"],
subnet_id="subnet-12345678"
)
pipeline = imagebuilder.CfnImagePipeline(
stack,
"MyPipeline",
name="my-pipeline",
image_recipe_arn=image_recipe.ref,
infrastructure_configuration_arn=infra_config.ref,
schedule=imagebuilder.CfnImagePipeline.ScheduleProperty(
schedule_expression="cron(0 0 * * *)"
)
)
app.synth()
cdk --version
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'aws_cdk.aws_imagebuilder'
Using CDK v2 import path with v1 package installed.
fixEither install CDK v2 (aws-cdk-lib) or use import path 'from aws_cdk.aws_imagebuilder import ...' in v1.
AttributeError: module 'aws_cdk.aws_imagebuilder' has no attribute 'CfnImageRecipe'
Importing incorrectly, e.g., 'from aws_cdk.aws_imagebuilder.CfnImageRecipe import *'.
fixUse correct import: 'from aws_cdk.aws_imagebuilder import CfnImageRecipe'.
jsii.errors.JSIIError: .../aws-cdk-lib.aws-imagebuilder is not available
Mixing CDK v1 and v2 dependencies.
fixUse only one version of CDK. For v1 use 'aws-cdk-aws-imagebuilder', for v2 use 'aws-cdk-lib' and remove v1 packages.
Upgrade
Version history
1.204.0latest on PyPI · released Jun 19, 2023
Audit
Dependencies
aws-cdk-librequiredRequired for CDK constructs and resources
constructsrequiredRequired for construct base class
jsiirequiredRequired for language bindings
publicationrequiredRequired for publishing
typeguardrequiredRequired for type checking