provider-aws
provider-aws copied to clipboard
ec2-instance: imageId and launchtemplateId required even if launchtemplateName set
I am trying to spawn an Instance using a LaunchTemplate which has imageId
set. I have set launchTemplate.launchTemplateName
to reference said template. I expect that I only need to set imageId
on the Instance CRD if I want to override the value from the launchTemplate. Furthermore, based on the documentation, I expect that I must not also set launchTemplate.launchTemplateId
since I have already set launchTemplateName
What happened?
When trying to create the Instance Resource, I get two validation Errors, telling me that both Instance.spec.forProvider.imageId
and Instance.spec.forProvider.launchTemplate.launchTemplateId
are required fields
How can we reproduce it?
The crd has the fields set as required (here, and here)
What environment did it happen in?
Crossplane version:
- aws-provider v0.24.1
I ran into this issue too. Here is the workaround
I found and it works well for me:
- Manually edit the instance CRD and remove
imageId
andlaunchTemplateName
from required section.
$ kubectl edit crd instances.ec2.aws.crossplane.io
...
623 launchTemplate:
624 description: The launch template to use to launch the instances.
625 Any parameters that you specify in RunInstances override the
626 same parameters in the launch template. You can specify either
627 the name or ID of a launch template, but not both.
628 properties:
629 launchTemplateId:
630 description: The ID of the launch template.
631 type: string
632 launchTemplateName:
633 description: The name of the launch template.
634 type: string
635 version:
636 description: "The version number of the launch template. \n
637 Default: The default version for the launch template."
638 type: string
639 required:
640 - launchTemplateId
-641 - launchTemplateName
- Re-apply the xr/xrc.
Crossplane does not currently have enough maintainers to address every issue and pull request. This issue has been automatically marked as stale
because it has had no activity in the last 90 days. It will be closed in 14 days if no further activity occurs. Leaving a comment starting with /fresh
will mark this issue as not stale.
This is still relevant and doesn't allow proper usage of Launch templates.
/fresh
/open