Hello,
I am having issue while accessing an Object variable type using Terraform Cloud and CDKTF.
In my code, I have
this._githubCreds = new TerraformVariable(this, `github-creds`, {
type: VariableType.object({
github_url: VariableType.STRING,
github_username: VariableType.STRING,
}),
sensitive: false,
description: "Github Creds",
nullable: false,
});
new Manifest(this, "git-config", {
manifest: {
apiVersion: "v1",
kind: "ConfigMap",
metadata:{
name: this._githubCreds.value.github_url
},
spec:{
username: this._githubCreds.value.github_username
}
},
});
However, in my cdktf.json
. Its coming as blank. I would expect something like
var.github-creds.github_url
, but after synth
its just blank. and also while planning.
CDKTF.json
"kubernetes_manifest": {
"git-config": {
"//": {
"metadata": {
"path": "test-gitops/git-config",
"uniqueId": "git-config"
}
},
"manifest": {
"apiVersion": "v1",
"kind": "ConfigMap",
"metadata": {
},
"spec": {
}
}
}
}
In Terraform Cloud,
FYI, I also tried adding default values, like
this._githubCreds = new TerraformVariable(this, `github-creds`, {
type: VariableType.object({
github_url: VariableType.STRING,
github_username: VariableType.STRING,
}),
sensitive: false,
description: "Github Creds",
nullable: false,
default: {
github_url: 'test',
github_username: 'test1'
}
});
Also tried, _this.githubCreds.value["github_username"]