question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[apigateway] Allow customizing the name of the CfnOutput containing the API endpoint

See original GitHub issue

Note: for support questions, please first reference our documentation, then use Stackoverflow. This repository’s issues are intended for feature requests and bug reports.

  • I’m submitting a …

    • 🪲 bug report
    • 🚀 feature request
    • 📚 construct library gap
    • ☎️ security issue or vulnerability => Please see policy
    • ❓ support request => Please see note at the top of this template.
  • What is the current behavior? If the current behavior is a 🪲bug🪲: Please provide the steps to reproduce Currently rest api creation automatically creates an Output value. But it does not create an export for this output. Also, there does not seem to be any way to export this output by overriding the output property to add an export in any way. If I add something like -

core.CfnOutput(self, id="Test", value=topic.topic_arn, export_name="Test")

This will add a duplicate output

  • What is the expected behavior (or behavior of feature suggested)? I expect that if there is an output for this, then it should also support in some way to add an export for it.

  • What is the motivation / use case for changing the behavior or adding this feature? If we are still doing an auto-output for rest api, then why not even add auto-exporting?

  • Please tell us about your environment:

    • CDK CLI Version: 1.3.0
    • Module Version: xx.xx.xx
    • OS: [all | Windows 10 | OSX Mojave | Ubuntu | etc… ]
    • Language: Python
  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. associated pull-request, stackoverflow, gitter, etc)

https://github.com/aws/aws-cdk/issues/1611 disabled exports by default. But output is still added by default for REST API. How/Why can’t I add an export to it too?

And by the sense of it, why is output still added by default too? What if I had a resource count of 61 and all of them are rest api, wouldn’t it exceed the limit?

Also, any example to address cross stack reference by using export import using python would really help since this is something that i was not able to find in the documentation.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
RomainMullercommented, Aug 14, 2019

Yup - I think the RestApi construct should just not provision a CfnOutput at all. Let the user decide whether they want an output or not (it’s trivial for them to create one if they need it), and decide whether it’s exported or not.

0reactions
whimzyLivecommented, Oct 24, 2019

@eladb can you help me understand this better. Not sure what you mean by “even if you specify an exportName, you will only be able to control the relative construct ID o the Output and not the full ID”, because CfnOutput does except exportName in props, so when I pass exportName as a prop like: new CfnOutput(this, 'Endpoint', { exportName: ''my-export-name", value: some-value }); it should create output with my-export-name right?

Read more comments on GitHub >

github_iconTop Results From Across the Web

aws-cdk/aws-apigateway module - AWS Documentation
The construct sets up an API endpoint and maps the ANY HTTP method and any calls to the API endpoint starts an express...
Read more >
API Gateway REST API to Lambda using mutual TLS
This pattern creates an Amazon API Gateway HTTP API authenticated by mutual TLS ... description="The custom domain name for AWS REST API Gateway")...
Read more >
REST API (API Gateway v1) - Serverless Framework
HTTP Endpoints with Custom Authorizers. Custom Authorizers allow you to run an AWS Lambda Function before your targeted AWS Lambda Function. This is...
Read more >
AWS CDK v2 Tutorial – How to Create a Three-Tier Serverless ...
new CfnOutput(this, 'HttpApiUrl', { value: api.apiEndpoint });. Now let's deploy it again with npx cdk deploy . We'll be ...
Read more >
How to use AWS CDK to look up existing ApiGateway
Lets take a simple Api with one resource const restApi = new apigw.RestApi(this, "my-api", { restApiName: `my-api`, }); ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found