Access network_interface generates an error
See original GitHub issuecdktf & Language Versions
cdktf version: 0.10.1 language: python
Affected Resource(s)
Access instance details
#Query a GCP Image filtered by Family
gcp_image = DataGoogleComputeImage(self, id = "windows_image", family = "windows-2019", project="windows-cloud" )
#Get the network interface
net_int = ComputeInstanceNetworkInterface(subnetwork ="<SUBNETWORK>",subnetwork_project = "<SHARED-PROJECT>")
#Create a new vm
instance = ComputeInstance(self,id = "sample-vm", machine_type="e2-standard-4", name="cdktf-instance-1",
boot_disk= ComputeInstanceBootDisk(initialize_params=ComputeInstanceBootDiskInitializeParams(image=gcp_image.name)),
network_interface=[net_int], zone= "us-east4-a"
)
#Output
TerraformOutput(self, "instance_ip", instance.network_interface[0].network_ip)
Debug Output
Traceback (most recent call last):
File "/Users/user/terraform-learning/cdktf-gcp/gcp/main.py", line 37, in <module>
GcpBasicVmStack(app, "gcp")
File "/Users/user/.local/share/virtualenvs/gcp-XHqyQSdy/lib/python3.9/site-packages/jsii/_runtime.py", line 86, in __call__
inst = super().__call__(*args, **kwargs)
File "/Users/user/terraform-learning/cdktf-gcp/gcp/main.py", line 34, in __init__
TerraformOutput(self, "instance_ip", instance.network_interface[0].network_ip)
TypeError: 'InterfaceDynamicProxy' object is not subscriptable
Expected Behavior
Should be able to retrieve the instance ip in the output
Actual Behavior
Exception
Steps to Reproduce
Important Factoids
References
Issue Analytics
- State:
- Created a year ago
- Comments:7 (2 by maintainers)
Top Results From Across the Web
Resolve network interface provision errors for Amazon ECS ...
I want to resolve network interface provision errors for Amazon Elastic Container Service (Amazon ECS) on AWS Fargate.
Read more >NetworkInterface.GetAllNetworkInterfaces() causes System ...
GetAllNetworkInterfaces() . The above line causes System.Security Exception. The complete exception message says: [Request for the permission of ...
Read more >Wireshark 'no interfaces found' error explained - Comparitech
Interface error caused by access permissions When Wireshark reports that it cannot find any “interfaces”, it means that it could not detect any ......
Read more >An error has occurred while trying to create a virtualbox host ...
If it still does not work, make sure that all the Host-only interface are enabled: · Go to Settings > Network & Internet...
Read more >Method: instances.updateNetworkInterface | Compute Engine ...
The reason of the error. This is a constant value that identifies the proximate cause of the error. Error reasons are unique within...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
#25 or #1610 should cover it.
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.