terraform-cdk
terraform-cdk copied to clipboard
Convert: Golang has wrong casing (lower case letters for attributes)
resource "aws_instance" "server" {
ami = "ami-a1b2c3d4"
instance_type = "t2.micro"
}
actual
import constructs "github.com/aws/constructs-go/constructs"
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import "github.com/aws-samples/dummy/gen/providers/aws/instance"
type myConvertedCode struct {
construct
}
func newMyConvertedCode(scope construct, name *string) *myConvertedCode {
this := &myConvertedCode{}
constructs.NewConstruct_Override(this, scope, name)
instance.NewInstance(this, jsii.String("server"), &instanceConfig{
ami: jsii.String("ami-a1b2c3d4"),
instanceType: jsii.String("t2.micro"),
})
return this
}
expected
import constructs "github.com/aws/constructs-go/constructs"
/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import "github.com/aws-samples/dummy/gen/providers/aws/instance"
type myConvertedCode struct {
construct
}
func newMyConvertedCode(scope construct, name *string) *myConvertedCode {
this := &myConvertedCode{}
constructs.NewConstruct_Override(this, scope, name)
instance.NewInstance(this, jsii.String("server"), &InstanceConfig{ // <- needs to be upper-case
Ami: jsii.String("ami-a1b2c3d4"), // <- needs to be upper-case
InstanceType: jsii.String("t2.micro"), // <- needs to be upper-case
})
return this
}
Possible fix: https://github.com/aws/jsii-rosetta/pull/222/files