hashicorp / terraform-cdk

Define infrastructure resources using programming constructs and provision them using HashiCorp Terraform
https://www.terraform.io/cdktf
Mozilla Public License 2.0
4.88k stars 455 forks source link

aliyun/alicloud: some compile error with resource alicloud_alb_listener #3601

Open shanye997 opened 7 months ago

shanye997 commented 7 months ago

Expected Behavior

compile successfully

Actual Behavior

image

Steps to Reproduce

  1. cdktf init --template=go --providers=aliyun/alicloud --local
  2. cdktf get

Versions

cdktf debug language: go cdktf-cli: 0.20.7 node: v20.10.0 cdktf: 0.20.6 constructs: 10.1.167 jsii: 1.95.0 terraform: 1.7.5 arch: arm64 os: darwin 23.1.0 go: go version go1.20.6 darwin/arm64 providers aliyun/alicloud@~> 1.220 (LOCAL) terraform provider version: 1.221.0

Providers

alicloud-go cdktf provider list ┌─────────────────┬──────────────────┬───────┬────────────┬──────────────┬─────────────────┐ │ Provider Name │ Provider Version │ CDKTF │ Constraint │ Package Name │ Package Version │ ├─────────────────┼──────────────────┼───────┼────────────┼──────────────┼─────────────────┤ │ aliyun/alicloud │ 1.221.0 │ │ ~> 1.220 │ │ │ └─────────────────┴──────────────────┴───────┴────────────┴──────────────┴─────────────────┘

Gist

No response

Possible Solutions

No response

Workarounds

No response

Anything Else?

No response

References

No response

Help Wanted

Community Note

shanye997 commented 7 months ago

Besides, I have some problems with cdktf convert in Go version. I need to update the name of packages, structs and attributes before I use it to manage some resources. Please give me some guidance on how I can batch convert terraform templates and use them for testing. The command I use is cat main.tf| cdktf convert --language go --provider hashicorp/alicloud > main.go The HCL code is as followings.

data "alicloud_zones" "foo" {
  available_resource_creation = "VSwitch"
}

resource "alicloud_vpc" "foo" {
  vpc_name   = "terraform-example"
  cidr_block = "172.16.0.0/12"
}

resource "alicloud_vswitch" "foo" {
  vswitch_name = "terraform-example"
  cidr_block   = "172.16.0.0/21"
  vpc_id       = alicloud_vpc.foo.id
  zone_id      = data.alicloud_zones.foo.zones.0.id
}
image