aws / aws/aws-cdk

appsync: support adding auth provider for AppSync Events after creating an api

Open
#33,714 3 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-appsync effort/medium feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
1d 19h
Merged PRs (30d)
74

Description

### Describe the feature

It'd be great if [`EventApi`](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.EventApi.html) has a public method to add auth provider. (e.g. `EventApi.addAuthProvider`.)

### Use Case

Sometimes we want to create resources required for auth (e.g. Cognito UserPool) after the creation of event API. For example, `constrcutA` contains an AppSync Events API and `constructB` contains a cognito user pool, and `constructB` has depdendency on `constructA`. Currently it is difficult to achieve because EventApi expects all the resources to configure auth provider is available when it is defined by [the authorizationConfig construct prop](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_appsync.EventApi.html#authorizationconfig).

### Proposed Solution

add `EventApi.addAuthProvider(AppSyncAuthProvider)` method.

### Other Information

_No response_

### Acknowledgements

- [ ] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### CDK version used

2.181.0

### Environment details (OS name and version, etc.)

macOS

Contributor guide

Open the contributing guide

Research direction

Start with the EventApi entry point and its authorizationConfig prop, then trace how AppSyncAuthProvider values are configured during API creation. Add a public EventApi.addAuthProvider(AppSyncAuthProvider) path that works when auth resources are created later, and verify that the provider is applied to the existing AppSync Events API.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
api, cloud
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.