aws-cdk
aws-cdk copied to clipboard
aws_eks: containerPort and apiVersion should not be in snake_case (i.e. container_port and api_version)
link to reference doc page
https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_eks/README.html#quick-start
Describe your issue?
When going through the aws_eks quickstart as-written in Python, the deploy fails with errors like this:
4:41:19 PM | CREATE_FAILED | Custom::AWSCDK-EKS-KubernetesResource | helloeksmanifestmypodC48C8B9D
Received response status [FAILED] from custom resource. Message returned: Error: b'error: error validating "/tmp/manifest.yaml": error validating data: [ValidationError(Pod.spec.containers[0].ports[0]): unknown field "container_port" in io.k8s.api.core.v1.ContainerPort,
ValidationError(Pod.spec.containers[0].ports[0]): missing required field "containerPort" in io.k8s.api.core.v1.ContainerPort]; if you choose to ignore these errors, turn validation off with --validate=false\n'
(The specifics vary slightly for the apiVersion and containerPort cases. That's from the containerPort issue.)
I'm guessing that these are converted to snake_case somewhere in the documentation build process (e.g. whatever converts addManifest to add_manifest), but these particular keys should be the same as in the TS version.
@rix0rrr, @kaizen3031593 you might have more context on what's the cause of this.
Just ran into this for both apiVersion and containerPort. I guess not the highest priority but definitely a waste of time if you blindly follow the quick start, wait for CF to provision the EKS cluster, have it fail at applying the manifest, wait for CF to destroy the cluster, repeat, etc.
Same problem at https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk.aws_eks/README.html#dependencies with api_version vs (the correct) apiVersion
Python seems to be a second class language in CDK.