-
Notifications
You must be signed in to change notification settings - Fork 440
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
feat(lib): update attributes['//'] instead of assigning to it #1543
Conversation
That's an interesting use-case, what do you plan to use the // field for? |
Personally, I'm using this to test out a Pulumi-style Without this, I don't see any side-effect free way to 'tag' Terraform resources so I can identify which resources to import just by looking at the generated Hopefully that gives you some context-- I have no intention to alter the existing metadata that |
Ah interesting, please let us know how it went 👍 |
Could you run |
Sure, I'll make sure to run I was thinking, as a way to expand this idea; should I implement a Let me know your thoughts. |
I don't think
This sounds like something could be built into cdktf. Probably not in the context of this PR, but possibly as part of #1134. |
Seconding in on We already have support for While As Jon said, the import behavior would certainly be something that should be included as a first class citizen in the CDKTF with a clear and straight forward API.
I think we could exclude all overrides nested in To make the way of interacting with the overrides for class Imports {
protected constructor(private target: TerraformResource) {}
public static of(target: TerraformResource) {
return new Imports(target);
}
public addSomeConfig(config: any): this {
this.target.addOverride("//.__imports_config", config);
return this;
}
}
Imports.of(myS3Bucket).addSomeConfig({ todoo: 'put something here' }) |
All those who were interested in my approach on how I was automating importing resources, I wrote a detailed comment @ #1134 (comment). I can provide more details as needed and I'd be comfortable moving the discussion regarding that to another issue/PR if necessary. |
Signed-off-by: github-team-tf-cdk <github-team-tf-cdk@hashicorp.com>
I'm going to lock this pull request 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 related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Should allow end users to also write to the
"//"
attribute in Terraform resources. Currently,cdktf
overwrites this attribute with the metadata values.