-
Notifications
You must be signed in to change notification settings - Fork 4k
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
apigateway: support custom domains #3103
apigateway: support custom domains #3103
Comments
WIP |
Adds support for custom domain names in API Gateway and using route53 aliases. Fixes #3103 Misc: change the awslint rule that verifies resource attributes to use CloudFormation attribute names.
Adds support for custom domain names in API Gateway and using route53 aliases. Fixes #3103 Misc: change the awslint rule that verifies resource attributes to use CloudFormation attribute names.
I'm trying to map my RestApi to existing domain name (created earlier and mapped to multiple rest APIs) with following code:
and I am getting following error (when compiling cdk code):
or when I retype
Are there any plans to address such case? I am using CDK version 0.36.2 |
It seems odd that the default endpoint type is REGIONAL. It seems that most users that are making a public API with custom domain name would benefit from choosing EDGE instead, which is the default selection when using the console. |
Thanks for this feedback. This makes sense to me. I'll open an issue |
I am also running into the issue referenced above but not responded to. I can import an existing custom domain mapping with the from_domain_name_attributes, but there is no add_base_path_mapping method on IDomainNames for some reason, so I can do nothing with it. Any solution? |
I'm not really sure what fromDomainNameAttributes is for, but I was able to add a base path mapping this way:
Hope that helps somehow! |
FromDomainNameAttributes should be like the other "fromxx" functions that exist in most constructs in that, it is for referencing a resource that already exists. Rather than deleting a preexisting resource and recreating it, I would like to be able to reference the domain name using FromDomainNameAttributes, then add a base path mapping to it. Hope this gives more context. |
We need to add new api to existing custom domain. This will create new domain. Is there a way to do that? |
I believe if you follow a similar pattern but instead of using const domain = apigw.DomainName.fromDomainNameAttributes(...) then you should be able to use a domain which already exists. |
@JoshM1994 read the comments above, fromDomainNameAttributes returns the interface |
@mbsimonovic yes, it is possible. Instead of using Example below, I hope it helps:
|
What is domainNameAliasTarget in domain name attributes? |
@roitman-g I found the answer to to your question here |
@roitman-g and for anyone else out there trying to figure out how to get The answer here is correct, but unless I'm mistaken, it doesn't seem there's a way to grab it as a property from any other resource construct (except after you create the custom domain in CDK like There may be a good reason for this under the hood, but not sure. Best alternative I found is saving as an SSM parameter in CDK when I create the custom domain and importing it thereafter. If @eladb you know of (or if anyone finds one) a better way, please let me know. |
Missing capability in API gateway (#723)
The text was updated successfully, but these errors were encountered: