Registry / aws / aws-cdk-aws-imagebuilder

aws-cdk-aws-imagebuilder

JSON →
library1.204.0pypypi✓ verified 85d ago

The CDK Construct Library for AWS::ImageBuilder provides high-level, object-oriented abstractions for defining and deploying EC2 Image Builder resources in AWS. The current version is 1.204.0, released as part of the AWS CDK v1, which is in maintenance mode. New development should use AWS CDK v2 and the @aws-cdk/aws-imagebuilder module.

pip install aws-cdk-aws-imagebuilder==1.204.0
INSTALL
IMPORT
SIG · AWS-CDK-AWS-IMAGEB
A
aws-cdk-aws-imagebuilder
awspythonv1.204.0
Install
3.5s avg
Import
Disk
28MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
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
musl
py 3.103.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 28.9MB
glibc
py 3.103.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
Debug
Known issues
deprecatedThis is the CDK v1 package. CDK v1 entered maintenance mode on June 1, 2022 and will end support on June 1, 2023. Users should migrate to CDK v2 and use the @aws-cdk/aws-imagebuilder module instead.
fix
Use 'aws-cdk-lib' and 'import aws_cdk.aws_imagebuilder as imagebuilder' in CDK v2.
affects: >=1.0.0
breakingThe CDK v1 and v2 packages have different names. In v1 it's 'aws-cdk-aws-imagebuilder', in v2 it's part of 'aws-cdk-lib' with imports from 'aws_cdk.aws_imagebuilder'.
fix
Upgrade to CDK v2 and remove 'aws-cdk-aws-imagebuilder' from requirements. Use 'from aws_cdk import aws_imagebuilder as imagebuilder'.
affects: >=2.0.0
gotchaMany Image Builder resources require ARNs of existing AWS resources (e.g., components, AMIs). Using dummy ARNs may cause deployment failures. Always reference valid ARNs or use tokens.
fix
Ensure ARNs are valid. For components, use 'aws-cdk.aws_imagebuilder.CfnComponent' to create custom components or reference existing ones.
affects: all
gotchaThe property 'schedule' expects a ScheduleProperty object, not a cron expression string. Commonly mistaken.
fix
Always wrap the schedule expression in a ScheduleProperty object as shown in the quickstart.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'aws_cdk.aws_imagebuilder'
Using CDK v2 import path with v1 package installed.
fix
Either 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 *'.
fix
Use 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.
fix
Use 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
Agent activity
25 hits · last 30 days
node
20
OpenAI (training)
2
Resources
aws-cdk-aws-imagebuilder — pip install aws-cdk-aws-imagebuilder · libregistry