Skip to content
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

Is the module compatible with CDKTF? #64

Closed
akhileshnirapure opened this issue Jul 19, 2021 · 2 comments
Closed

Is the module compatible with CDKTF? #64

akhileshnirapure opened this issue Jul 19, 2021 · 2 comments

Comments

@akhileshnirapure
Copy link

Hi,

I'm trying to leverage the module using CDKTF and c#, but it seems the names are not generated or I'm missing something?

Error: Incorrect attribute value type

│ on cdk.tf.json line 62, in resource.azurerm_resource_group.CoreResourceGroup:
│ 62: "name": "${module.stacknaming.resource_group}",
│ ├────────────────
│ │ module.stacknaming.resource_group is object with 8 attributes

│ Inappropriate value for attribute "name": string required.

usage
var projectNaming = new Naming(this,"stack naming",new NamingOptions {
Suffix = new string[] {"myapp"}
});

projectNaming.ResourceGroupOutput

I do not see 'name' property as described here

https://github.com/Azure/terraform-azurerm-naming#usage

my CDKTF.json

"terraformModules": [{
"name": "naming",
"source": "Azure/naming/azurerm",
"version": "0.1.0"
}],

@waxb
Copy link

waxb commented Nov 8, 2021

putting a [\"name\"] at the module output lines in the cdk.tf.json makes the plan run successfully. I don't know whether this issue is coming from the module or cdktf itself

e.g.:

  "resource": {
    "azurerm_resource_group": {
      "cdktfazurego_testrg_095361DF": {
        "location": "westeurope",
        "name": "${module.cdktfazurego_resourcenaming_96D23509.resource_group[\"name\"]}",
        "//": {
          "metadata": {
            "path": "cdktf-azure-go/test_rg",
            "uniqueId": "cdktfazurego_testrg_095361DF"
          }
        }
      }
    },

@Nepomuceno
Copy link
Member

Thx @waxb for pointing this out.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants