-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
appsync: support Merged APIs #25960
Comments
Merge API is really awesome! Thank you for your feature request and all the detailed info. We welcome and appreciate your PR. |
There are two additional tasks we need to consider:
As mentioned in the contributing guide, I will create a new RFC in the RFC repo for this new L2 construct. @pahud: Please let me know if I should proceed in a different way. Thanks. |
I will bring this to the core team for discussion and get back to you here. |
Add support for [AppSync Merged API](https://aws.amazon.com/blogs/mobile/introducing-merged-apis-on-aws-appsync/) feature. At the moment, a GraphQL schema can be passed using the `schema` property. I deprecated this property because it is not used for merged APIs. Depecreated syntax: ```ts const api = new appsync.GraphqlApi(this, 'Api', { name: 'demo', schema: appsync.SchemaFile.fromAsset(path.join(__dirname, 'schema.graphql')), }); ``` Instead, I introduced a new property `apiSource` that can be used to create a AppSync GraphQL API or Merged API. GraphQL API: ```ts const api = new appsync.GraphqlApi(this, 'Api', { name: 'demo', apiSource: appsync.ApiSource.fromSchema(appsync.SchemaFile.fromAsset(path.join(__dirname, 'schema.graphql'))), // short version apiSource: appsync.ApiSource.fromFile(path.join(__dirname, 'schema.graphql')), }); ``` Merged API: ```ts const api = new appsync.GraphqlApi(this, 'Api', { name: 'demo', apiSource: appsync.ApiSource.fromSourceApis({ sourceApis: [ { sourceApi: firstApi, mergeType: appsync.MergeType.MANUAL_MERGE, }, { sourceApi: secondApi, mergeType: appsync.MergeType.AUTO_MERGE, }, ], }), }); ``` Closes #25960. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Describe the feature
Since end of May, AppSync supports Merged APIs. Multiple APIs can be combined into a single API.
At the moment, this feature is missing in AWS CDK.
Use Case
Multiple teams develop components for an application. Each team develops their AppSync APIs independently. A Merged API is necessary to provide a central AppSync API with APIs from each component.
Proposed Solution
Tasks that I already identified:
ApiType
has to be set toMERGED
.MergedApiExecutionRoleArn
.Workaround: use escape hatches (not yet tested)
Other Information
AWS Blog Post:
https://aws.amazon.com/blogs/mobile/introducing-merged-apis-on-aws-appsync/
AWS Documentation:
https://docs.aws.amazon.com/appsync/latest/devguide/merged-api.html
CoudFormation already supports this feature:
https://docs.aws.amazon.com/de_de/AWSCloudFormation/latest/UserGuide/aws-resource-appsync-graphqlapi.html#cfn-appsync-graphqlapi-apitype
I am not currently working on this feature request. Someone else is welcome to take it over. If I start working on the design/implementation myself, I'll leave a comment here again.
Acknowledgements
CDK version used
v2.83.1
Environment details (OS name and version, etc.)
macOS 13.4
The text was updated successfully, but these errors were encountered: