-
Notifications
You must be signed in to change notification settings - Fork 9.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: aws_imagebuilder_workflow allows invalid value "DISTRIBUTION" for 'type' argument #39785
Comments
Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
Hello @clarkhathawayaltview! I had a brief look into the relevant provider code section and it seems to be the case that we verify the input against the types defined in the AWS SDK for Go. I checked out the behavior of the AWS CLI and it also dislikes the type DISTRIBUTION. ❯ aws --version
aws-cli/2.17.5 Python/3.11.8 Linux/6.11.0-8-generic exe/x86_64.ubuntu.24
❯ aws imagebuilder create-workflow --name test --type DISTRIBUTION --semantic-version 0.0.1 --data "workflow"
An error occurred (InvalidParameterValueException) when calling the CreateWorkflow operation: The value supplied for parameter 'type' is not valid. Custom distribution workflows are not supported. even as its listed a supported input On our end we could potentially exclude DISTRIBUTION from the validation checks, e.g. by below code change names.AttrType: {
Type: schema.TypeString,
Required: true,
ForceNew: true,
// ValidateDiagFunc: enum.Validate[awstypes.WorkflowType](),
ValidateFunc: validation.StringInSlice([]string{string(awstypes.WorkflowTypeBuild), string(awstypes.WorkflowTypeTest)}, false),
}, |
Your explanation was roughly what I had imagined the problem was. It is frustrating that their API is designed in this way but I'm pleased to see a quick response on this issue. |
### Description The documentation of the resource [`ami_imagebuilder_workflow`](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/imagebuilder_workflow) mentions for the argument `type` > Valid values: BUILD, TEST, DISTRIBUTION. Image Builder handles the workflow type DISTRIBUTION, it cannot be configured by users. When trying to do so, for example using the code snippet provided as part of hashicorp#39785 ```hcl resource aws_imagebuilder_workflow codebuild-projects { name = "CodeBuildProjectsDistributionWorkflow" version = "1.0.0" type = "DISTRIBUTION" data = file("${path.module}/codebuild-projects-distribution.workflow.yaml") } ``` the API returns the error ` The value supplied for parameter 'type' is not valid. Custom distribution workflows are not supported.` This pull request is to update the documentation for the resource. ### Relations Closes hashicorp#39785 ### References [Here](hashicorp#39785 (comment)) I explained the current situation. ### Output from Acceptance Testing Not required. Only documentation changed.
Warning This issue has been closed, meaning that any additional comments are hard for our team to see. Please assume that the maintainers will not see them. Ongoing conversations amongst community members are welcome, however, the issue will be locked after 30 days. Moving conversations to another venue, such as the AWS Provider forum, is recommended. If you have additional concerns, please open a new issue, referencing this one where needed. |
Terraform Core Version
1.9.7
AWS Provider Version
5.72.0
Affected Resource(s)
aws_imagebuilder_workflow
Expected Behavior
The argument
type
should only allow the values "BUILD" and "TEST" per the Image Builder workflow documentationActual Behavior
The documentation and implementation allow for the value "DISTRIBUTION" to be passed
Relevant Error/Panic Output Snippet
Terraform Configuration Files
Steps to Reproduce
Standard plan & apply.
Debug Output
No response
Panic Output
No response
Important Factoids
No response
References
No response
Would you like to implement a fix?
None
The text was updated successfully, but these errors were encountered: