(aws-imagebuilder): "The value supplied for parameter 'distributions[0]' is not valid" deploying a distribution configuration
See original GitHub issueI have an EC2 Image Builder image pipeline stack that works fine when I deploy it without a distribution configuration. When I add a distribution configuration the stack deployment fails during the distribution step.
Reproduction Steps
The following simplified stack, extracted from my complete pipeline stack, is reproducing the same issue:
#!/usr/bin/env python3
from aws_cdk import core, aws_imagebuilder as imagebuilder
class DistrConfigStack(core.Stack):
def __init__(self, scope: core.Construct, construct_id: str, **kwargs) -> None:
super().__init__(scope, construct_id, **kwargs)
# Image distribution configuration
distrconfig = imagebuilder.CfnDistributionConfiguration(
self,
'DistrConfig',
name='DistrConfigTest',
distributions=[
imagebuilder.CfnDistributionConfiguration.DistributionProperty(region='eu-west-1'),
imagebuilder.CfnDistributionConfiguration.DistributionProperty(region='eu-central-1')
]
)
# Outputs
core.CfnOutput(self, 'DistrConfigCfnOutput0', value=distrconfig.distributions[0].region)
core.CfnOutput(self, 'DistrConfigCfnOutput1', value=distrconfig.distributions[1].region)
app = core.App()
config_ami = DistrConfigStack(app, "Distrconfig", env=core.Environment(region='eu-west-1'))
app.synth()
What did you expect to happen?
My goal is to deploy an Image Builder pipeline stack that includes distribution of the EC2 image to a number of AWS regions.
What actually happened?
When I add the distribution configuration in my pipeline stack, however, the deployment fails.
When the stack deployment fails the following error is shown:
The value supplied for parameter 'distributions[0]' is not valid. One or more outputs should be provided for each region in a distribution configuration. (Service: Imagebuilder, Status Code: 400, Request ID: 7d5036b5-e982-476b-9694-5eab88737efe, Extended Request ID: null)
Environment
- CDK CLI Version : 1.88.0 (and same version also for all the Python CDK packages)
- Framework Version:
- Node.js Version: v10.19.0
- OS : Ubuntu 20.04
- Language (Version): Python (3.8.5)
Other
In case it helps, this is the output of cdk synth
:
Resources:
DistrConfig:
Type: AWS::ImageBuilder::DistributionConfiguration
Properties:
Distributions:
- Region: eu-west-1
- Region: eu-central-1
Name: DistrConfigTest
Metadata:
aws:cdk:path: Distrconfig/DistrConfig
CDKMetadata:
Type: AWS::CDK::Metadata
Properties:
Modules: aws-cdk=1.88.0,@aws-cdk/aws-imagebuilder=1.88.0,@aws-cdk/cloud-assembly-schema=1.88.0,@aws-cdk/core=1.88.0,@aws-cdk/cx-api=1.88.0,@aws-cdk/region-info=1.88.0,jsii-runtime=Python/3.8.5
Metadata:
aws:cdk:path: Distrconfig/CDKMetadata/Default
Outputs:
DistrConfigCfnOutput0:
Value: eu-west-1
DistrConfigCfnOutput1:
Value: eu-central-1
For CDK Image Builder I could not find any examples of image pipeline stacks including distributions: it would definitely help seeing one.
This is 🐛 Bug Report
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (4 by maintainers)
Top GitHub Comments
I think that could be the case, anyway at the moment the issue for me is solved and I do not need additional support. Again, thanks for your help.
⚠️COMMENT VISIBILITY WARNING⚠️
Comments on closed issues are hard for our team to see. If you need more assistance, please either tag a team member or open a new issue that references this one. If you wish to keep having a conversation with other community members under this issue feel free to do so.