-
Notifications
You must be signed in to change notification settings - Fork 450
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
Resource id mismatch after updating cdktf
& cdktf-cli
from v0.16.3
to v0.17.0
#2954
Comments
Hi @ApexCaptain 👋 Could you share your How many resources are affected? |
Thanks for your response @ansgarm This is my {
"output": "cdktf.out",
"codeMakerOutput": "src/generated",
"app": "yarn ts-node -r tsconfig-paths/register src/main.ts",
"language": "typescript",
"projectId": "6d8affb3-b3ac-48a3-a593-680005e6eb3a",
"sendCrashReports": false,
"terraformProviders": [
{
"name": "aws",
"source": "hashicorp/aws",
"version": "~> 4.0"
},
{
"name": "cloudinit",
"source": "hashicorp/cloudinit",
"version": "~> 2.3"
},
{
"name": "local",
"source": "hashicorp/local",
"version": "~> 2.3"
},
{
"name": "oci",
"source": "oracle/oci",
"version": "~> 4.122"
},
{
"name": "tls",
"source": "hashicorp/tls",
"version": "~> 4.0"
},
{
"name": "null",
"source": "hashicorp/null",
"version": "~> 3.2"
},
{
"name": "kubernetes",
"source": "hashicorp/kubernetes",
"version": "~> 2.20"
},
{
"name": "github",
"source": "integrations/github",
"version": "~> 5.0"
},
{
"name": "external",
"source": "hashicorp/external",
"version": "~> 2.3"
}
],
"terraformModules": [],
} I think this feature affects only the resources that are generated by terraform and |
Hey, it seems like you have been using cdktf without the feature flags. We deprecated them in 0.15 and removed them in 0.17. The result is that the resource ids change the way you are experiencing right now. This feature was introduced over 2 years ago to make them more readable and e.g. variables or outputs more accessible. To move forward you can either move your state (see the refactoring guide) or you can use |
It should also be possible to override allocateLogicalId on the stack to replicate the old behavior |
I'm going to lock this issue because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Expected Behavior
I want all ids of resources generated from previous version(
v0.16.3
) ofcdktf
&cdktf-cli
matches after updating to
v0.17.0
.This is
cdktf diff
output when the version ofcdktf/cdtkf-cli
isv0.16.3
Actual Behavior
After updating
cdktf
&cdktf-cli
version,cdktf diff
output has changed as followThis is cdktf.output file from
cdktf
v0.16.3
And this is cdktf.output file from
cdktf
v0.17.0
One thing I can say is that
unique id
of the resourcemaster-key
has changed from
keysstack_masterkey_280F69D3
to just simply,master-key
, which isfar more intuitive, however, does not equal to remote state.
That is why
cdktf
is trying to destroy and recreate all my precious resources.Noy only just simple tls key but also other resources such as EC2 instances,
databases, k8s clusters, etc.
Did I do something terribly wrong?
Are there any additional steps when updating cdktf?
If so, plz let me know.
Thank you 😊
Steps to Reproduce
cdktf
versionv0.16.3
cdktf
&cdktf-cli
tov0.17.0
Versions
language: typescript
cdktf-cli: 0.17.0
cdktf: 0.17.0
node: v18.16.0
constructs: 10.2.52
terraform: 1.5.0
arch: amd64
os: Debian GNU/Linux 5.15.90.1-microsoft-standard-WSL2
Providers
No response
Gist
No response
Possible Solutions
No response
Workarounds
No response
Anything Else?
No response
References
No response
Help Wanted
Community Note
The text was updated successfully, but these errors were encountered: