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

Avoid conflicts with resource attributes called "node" #230

Merged
merged 4 commits into from
Jul 22, 2020
Merged

Conversation

skorfmann
Copy link
Contributor

The consul provider has an attribute called node, which conflicts with the function in TerraformElement.

This introduces a more specific name constructNode to avoid conflicts like this.

Fixes #125

this.stack = TerraformStack.of(this);
}

public get node(): Node {
public get constructNode(): Node {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mmm... Interesting... I am wondering if we should take this into account in constructs 10.x?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Potential naming conflicts should be a thought of, yes.

@skorfmann skorfmann merged commit 10ca786 into master Jul 22, 2020
@eladb
Copy link
Collaborator

eladb commented Jul 23, 2020

@skorfmann We discussed this in our team and unfortunately we will have to reintroduce construct.node in constructs 10.0 in order not to be break many AWS CDK apps when we remove the compatibility layer we have in 1.x.

So we are "stuck" with node (forever).

I would recommend changing your the terraform code generator to simply mangle the name node in case it appears in a resource (maybe something like consolNode (prefix the type name).

eladb pushed a commit to aws/aws-cdk that referenced this pull request Aug 10, 2020
To reduce the chance for conflicts with generated domain-specific properties in subclasses of `Construct` (see [terraform-cdk issue]), we decided that we will rename `node` to `construct`, which is less prevalent.

We plan to remove the `node` API in the next major version of the AWS CDK, and therefore recommend users to migrate their code to use `construct` instead.

Part of aws/aws-cdk-rfcs#192
[terraform-cdk issue]: hashicorp/terraform-cdk#230
mergify bot pushed a commit to aws/aws-cdk that referenced this pull request Aug 10, 2020
…ct" (#9557)

To reduce the chance for conflicts with generated domain-specific properties in subclasses of `Construct` (see [terraform-cdk issue]), we decided that we will rename `node` to `construct`, which is less prevalent.

We plan to remove the `node` API in the next major version of the AWS CDK, and therefore recommend users to migrate their code to use `construct` instead.

See discussion in the [RFC].

[terraform-cdk issue]: hashicorp/terraform-cdk#230
[RFC]: https://github.com/aws/aws-cdk-rfcs/blob/master/text/0192-remove-constructs-compat.md#10-construct-node

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
skorfmann added a commit that referenced this pull request Aug 24, 2020
There's a function in the Oracle provider which is named `nodeMetadata`. This conflicts
with function in cdktf base classes.

Hence, this PR aligins the naming with the change from `node` to `constructNode` (see #230)

Fixes #290
@skorfmann skorfmann deleted the rename-node branch February 5, 2021 14:03
@github-actions
Copy link
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Node is a reserved name in cdktf / constructs
3 participants