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

(core): No ability to explicitly set OutputKey for CfnOutput #21432

Closed
1 of 2 tasks
SamStephens opened this issue Aug 3, 2022 · 3 comments
Closed
1 of 2 tasks

(core): No ability to explicitly set OutputKey for CfnOutput #21432

SamStephens opened this issue Aug 3, 2022 · 3 comments
Assignees
Labels
@aws-cdk/core Related to core CDK functionality feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.

Comments

@SamStephens
Copy link
Contributor

SamStephens commented Aug 3, 2022

Describe the feature

I would expect [https://docs.aws.amazon.com/cdk/api/v2/python/aws_cdk/CfnOutput.html](CfnOutput] to provide a key or output_key parameter, that would allow me to override the automatically generated OutputKey with one I explicitly provide.

This would parallel many other constructs, such as aws_lambda.LambdaFunction which provides a function_name parameter to allow you to override the automatically generated FunctionName.

Use Case

In order to programmatically work with stack outputs, I need a well known identifier for each output.

At the moment I'm being forced to provide an ExportName name for the output, even though I don't use the output in any other stack. This means I have to worry about the account wide (or is it region wide?) namespace of export names, rather than the stack wide namespace of stack output names.

Proposed Solution

No response

Other Information

This issue is touched upon by #1773

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CDK version used

2.35.0, Python

Environment details (OS name and version, etc.)

Ubuntu 20.04 on WSL 2 within Windows 10.0.19044

@SamStephens SamStephens added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Aug 3, 2022
@github-actions github-actions bot added the @aws-cdk/core Related to core CDK functionality label Aug 3, 2022
@rix0rrr
Copy link
Contributor

rix0rrr commented Sep 2, 2022

const  output = new CfnOutput(this, 'Output', ...);
output.overrideLogicalId('xyz');

@rix0rrr rix0rrr closed this as completed Sep 2, 2022
@github-actions
Copy link

github-actions bot commented Sep 2, 2022

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@SamStephens
Copy link
Contributor Author

@rix0rrr I'd have appreciated an opportunity to comment before this was closed.

It's great that overrideLogicalId provides this capability, but the documentation does not make that clear at all.

Could you please consider reopening this issue, and using it as an umbrella for updating the documentation of the overrideLogicalId method of CfnOutput to make it clear the logicalId is what drives the name of the Output?

Or is the problem here actually because this is a Level 1 construct, and that the best way to address this confusion is to add a Level 2 Output construct that provides a clearer interface to the Level 1 construct?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/core Related to core CDK functionality feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged.
Projects
None yet
Development

No branches or pull requests

2 participants