question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

(aws-imagebuilder): "The value supplied for parameter 'distributions[0]' is not valid" deploying a distribution configuration

See original GitHub issue

I 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:closed
  • Created 3 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
roebiuscommented, Feb 8, 2021

it’s not marked correctly as such in the model…?

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.

0reactions
github-actions[bot]commented, Feb 8, 2021

⚠️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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

CreateDistributionConfiguration - EC2 Image Builder
Creates a new distribution configuration. Distribution configurations define and configure the outputs of your pipeline.
Read more >
The value supplied for parameter 'instanceProfileName' is not ...
If I remove the CfninfrastructureConfiguration creation part, deployment runs successfully:, but takes at least 2 minutes to complete.
Read more >
Ensure AWS Image Builder Distribution Configuration is ...
Ensure AWS Image Builder Distribution Configuration is encrypting AMI by Key Management Service (KMS) using a Customer Managed Key (CMK).
Read more >
Building AMIs: Packer and Image Builder - EuropeClouds
Cloud Computing - Two tools which are used to build golden images are reviewed using practical examples: AWS Image Builder and Packer.
Read more >
update-distribution-configuration — AWS CLI 2.9.5 Command ...
If provided with no value or the value input , prints a sample input JSON that can be used as an argument for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found