terraform-cdk icon indicating copy to clipboard operation
terraform-cdk copied to clipboard

aliyun/alicloud: some compile error with resource alicloud_alb_listener

Open shanye997 opened this issue 10 months ago • 1 comments

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

  • [ ] I'm interested in contributing a fix myself

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

shanye997 avatar Apr 22 '24 14:04 shanye997

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

shanye997 avatar Apr 22 '24 14:04 shanye997