-
Notifications
You must be signed in to change notification settings - Fork 459
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
Google provider basic compute_instance creation fails #934
Comments
@madeddie thank you for reporting this! If this you're blocked on this before we're able to fix it, one option is to use the escape hatch to fix the generated config. |
@danieldreier thank you, will do. |
I suspect this may be related to aws/jsii#1919. Could you try explicitly specifying type names where the properties are being omitted? |
@jsteinich yeah, replacing the
fixes it.
|
I guess this should be closed since it's an issue with jsii |
Likely, but we might be able to adjust the intermediate typescript code in a way that generates the working python code. |
I've removed this from the 0.7 milestone because that release is super full. I'm hoping we can revisit it in 0.8. |
This seems to be fixed, I tried it in from constructs import Construct
#
# Provider bindings are generated by running `cdktf get`.
# See https://cdk.tf/provider-generation for more details.
#
from imports.google.compute_instance import ComputeInstance
class MyConvertedCode(Construct):
def __init__(self, scope, name):
super().__init__(scope, name)
ComputeInstance(self, "vm_instance",
boot_disk={
"initialize_params": {
"image": "debian-cloud/debian-9"
}
},
machine_type="f1-micro",
name="terraform-instance",
network_interface=[{
"access_config": [{}],
"network": "default"
}
]
) I added the provider definition and ran synth and got {
"resource": {
"google_compute_instance": {
"vm_instance": {
"//": {
"metadata": {
"path": "tmp.678jvplfay/vm_instance",
"uniqueId": "vm_instance"
}
},
"boot_disk": {
"initialize_params": {
"image": "debian-cloud/debian-9"
}
},
"machine_type": "f1-micro",
"name": "terraform-instance",
"network_interface": [
{
"network": "default"
}
]
}
}
}
} Which seems correct to me :) |
I'm going to lock this issue because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Community Note
cdktf & Language Versions
cdktf 0.5.0 installed with Homebrew
python 3.9.5
google@~> 3.0 with
cdktf get
Aug 24Affected Resource(s)
google.ComputeInstance
Expected Behavior
Using the example from https://registry.terraform.io/providers/hashicorp/google/latest/docs/guides/getting_started
I tried to create a basic compute instance.
cdktf convert --language python
generates:Which looks fine. I was expecting cdktf synth and deploy to create this instance.
Actual Behavior
cdktf synth
generated snippet of the compute instance resource:which is missing the
initialize_params
part ofbootdisk
.Steps to Reproduce
As described in expected behavior.
The text was updated successfully, but these errors were encountered: