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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forceable Static Name for Outputs #247

Closed
skorfmann opened this issue Jul 25, 2020 · 5 comments 路 Fixed by #1213
Closed

Forceable Static Name for Outputs #247

skorfmann opened this issue Jul 25, 2020 · 5 comments 路 Fixed by #1213
Assignees
Labels
enhancement New feature or request priority/important-longterm Medium priority, to be worked on within the following 1-2 business quarters.
Milestone

Comments

@skorfmann
Copy link
Contributor

Community Note

  • Please vote on this issue by adding a 馃憤 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Description

When aiming to build a Terraform module with cdktf, or reference the remote state in a non automated environment, it would be good to be able to force a static name.

Given this output:

new TerraformOutput(this, 'arn', {
      value: custom.instance.arn
    })

This generates a name like this cdktfhybridmodule_arn_788D4ED0.

A new option could be:

new TerraformOutput(this, 'arn', {
      value: custom.instance.arn,
      staticName: "arn"
    })

Which wouldn't generate a name but use the input and would be referenceable as arn.

@skorfmann skorfmann added the enhancement New feature or request label Jul 25, 2020
@skorfmann
Copy link
Contributor Author

Or perhaps just use the construct id?

new TerraformOutput(this, 'arn', {
      value: custom.instance.arn,
      static: true
    })

=> arn

@jsteinich
Copy link
Collaborator

I think the construct id would work well.

@skorfmann
Copy link
Contributor Author

This can already be achieved by using a feature flag (default for new apps) - It was implemented in #329

This applies to all root level resources. Since it's not really granular manageable, I'll leave this issue open for now.

@jsteinich
Copy link
Collaborator

#329 also added overrideLogicalId which can control the name for individual resources.

@danieldreier danieldreier added the needs-priority Issue has not yet been prioritized; this will prompt team review label Jul 2, 2021
@danieldreier danieldreier added priority/important-longterm Medium priority, to be worked on within the following 1-2 business quarters. and removed needs-priority Issue has not yet been prioritized; this will prompt team review labels Jul 20, 2021
@github-actions
Copy link
Contributor

github-actions bot commented Dec 1, 2022

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request priority/important-longterm Medium priority, to be worked on within the following 1-2 business quarters.
Projects
None yet
4 participants