AWS Image Builder Component

Hello, I am trying to create a aws_imagebuilder_component but I am stuck. There is always an error for “parameters” in the data argument.

As you can see, the KernelVersion is required in the ExecuteBash. No error is thrown when I try “terraform plan” but when I do “terraform apply”, this error is thrown: error creating Image Builder Component: InvalidParameterValueException: The value supplied for parameter ‘data’ is not valid. Failed to parse document. Error: line 1: field parameter not found in type Document.

Any fix pls?

Hello @sinyeekw,

This isn’t an issue with Terraform. The error message is being thrown back by the Image Builder API.

I believe the structure of your parameter block is incorrect. Take a look at the AWS docs again.

Another approach to this would be to try writing the component directly in the AWS console, then trying to convert into the format that TF’s yamlencode() function likes.