-
Notifications
You must be signed in to change notification settings - Fork 822
feat: analytics category refactor #14337
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
base: gen2-migration
Are you sure you want to change the base?
Conversation
| ['auth', AUTH_RESOURCES_TO_REFACTOR], | ||
| ['auth-user-pool-group', AUTH_USER_POOL_GROUP_RESOURCES_TO_REFACTOR], | ||
| ['storage', [CFN_S3_TYPE.Bucket]], | ||
| ['analytics', ANALYTICS_RESOURCES_TO_REFACTOR], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Used for rollback, not used yet.
| const GEN2_AMPLIFY_AUTH_LOGICAL_ID_PREFIX = 'amplifyAuth'; | ||
|
|
||
| const CATEGORIES: CATEGORY[] = ['auth', 'storage']; | ||
| const CATEGORIES: CATEGORY[] = ['auth', 'storage', 'analytics']; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Strings in this array are used to check against the prefix of category stacks in both Gen1 and Gen2. In Gen1, the analytics stack always starts with "analyticsamplify", but in Gen2, it can be any name. Codegen will need to handle the naming accordingly.
| } | ||
|
|
||
| export enum CFN_ANALYTICS_TYPE { | ||
| Stream = 'AWS::Kinesis::Stream', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the only stateful resource for Kinesis-based analytics. The rest are IAM roles and policies.
| // output is already in ARN format | ||
| Arn: resourceIdentifier, | ||
| }; | ||
| default: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should probably default to resourceIdentifier instead of undefined... but we will take a deeper look at this later.
| AUTH = 'auth', | ||
| STORAGE = 'storage', | ||
| AUTH_USER_POOL_GROUP = 'auth-user-pool-group', | ||
| ANALYTICS = 'analytics', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Included this here so that the custom resource flow is not triggered.
Description of changes
Enables refactor of the
analyticscategory (for Kinesis).Requires a Gen1 application with analytics configured using Kinesis, and a Gen2 application that deploys an analytics CFn stack that matches the Gen1 structure.
Description of how you validated changes
Create a Gen1 app with analytics, deploy the backend.
Create a Gen2 app with analytics, deploy the backend. This is more difficult because we don't have codegen for it, so we need to align the CFn resource configuration with the Gen1 app, within the analytics stack we create though CDK.
The Kinesis stream was successfully moved from a Gen1 stack to a Gen2 stack.
Checklist
yarn testpassesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.