aws / aws-cdk

The AWS Cloud Development Kit is a framework for defining cloud infrastructure in code
https://aws.amazon.com/cdk
Apache License 2.0
11.35k stars 3.77k forks source link

ImageBuilder: missing 'parameters' on ImageBuilder::ContainerRecipe::ComponentConfiguration #20831

Open FlorianVenturini opened 2 years ago

FlorianVenturini commented 2 years ago

Describe the bug

Hello !

We're trying to use the CDK to create a ContainerRecipe, but when we want to add parameters to the components, the property does not exist.

const cfnContainerRecipe = new imagebuilder.CfnContainerRecipe(this, 'ContainerRecipe', {
  components: [
    {
      componentArn: component1.attrArn,
      // parameters: [], // --> Missing here!
    },
    // ...
  ],
  containerType: 'DOCKER',
  name: `myContainerRecipe`,
  parentImage: `${accountID}.dkr.ecr.${awsRegion}.amazonaws.com/custom-parent-image`,
  targetRepository: {
    repositoryName: targetRepositoryName,
  },
  version: '1.0.0',
});

Also, it looks like it does exist

{
  "components": [
    {
      "componentArn": "arn:aws:imagebuilder:eu-west-1:ACCOUNT_ID:component/component1/1.0.0/1",
      "parameters": [
        {
          "name": "Parameter1",
          "value": [
            "data"
          ]
        }
      ]
    },
  ],
  "parentImage": "ACCOUNT_ID.dkr.ecr.eu-west-1.amazonaws.com/custom-parent-image:latest",
  "name": "myContainerRecipe",
  "semanticVersion": "1.2.3",
  "containerType": "DOCKER",
  // ...
}

Expected Behavior

I am expecting to be able to send parameters to my homemade components when creating a ContainerRecipe.

Current Behavior

The CDK does not allow parameters to be sent when calling CfnContainerRecipe

Reproduction Steps

(see above)

Possible Solution

From what I understand, the L1 construct code for the ContainerRecipe is automatically generated from CloudFormation, and the fact that parameters is also missing in the cloudformation docs makes me think that it's the root of this issue.

Additional Information/Context

No response

CDK CLI Version

1.160.0

Framework Version

No response

Node.js Version

14

OS

MacOS

Language

Typescript

Language Version

latest

Other information

No response

mrgrain commented 1 year ago

From what I understand, the L1 construct code for the ContainerRecipe is automatically generated from CloudFormation, and the fact that parameters is also missing in the cloudformation docs makes me think that it's the root of this issue.

This is correct. The feature appears to be missing in Cloudformation.

driverpt commented 1 year ago

I've created this bug in Cloudformation