Skip to content

Commit

Permalink
chore: add enum-like updater (aws#33500)
Browse files Browse the repository at this point in the history
### Issue # (if applicable)

N/A

### Reason for this change

Adds metadata collector for CDK's enum-like classes.

### Description of changes

* Added `EnumLikeUpdater` to parse out the enum-like classes and write them to a separate file to be used and updated.
* Altered existing `EnumUpdater` to also write to another file, including the module name to prevent ambiguity when updating.

### Describe any new or updated permissions being added

N/A

### Description of how you validated changes

N/A

### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)

----

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
Leo10Gama authored Feb 19, 2025
1 parent ae544a1 commit 6f1aa80
Show file tree
Hide file tree
Showing 7 changed files with 9,177 additions and 100 deletions.
106 changes: 11 additions & 95 deletions packages/aws-cdk-lib/core/lib/analytics-data-source/enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,10 +224,6 @@ export const AWS_CDK_ENUMS: { [key: string]: any } = {
'objectLike',
'arrayWith'
],
'AssetBuildTime': [
'all-before-deploy',
'just-in-time'
],
'AssetHashType': [
'source',
'bundle',
Expand Down Expand Up @@ -634,31 +630,6 @@ export const AWS_CDK_ENUMS: { [key: string]: any } = {
'TEXT32K',
'ZSTD'
],
'Command': [
'ls',
'list',
'diff',
'bootstrap',
'deploy',
'destroy',
'synthesize',
'synth',
'metadata',
'init',
'version',
'watch',
'gc',
'rollback',
'import',
'acknowledge',
'ack',
'notices',
'migrate',
'context',
'docs',
'doc',
'doctor'
],
'ComparisonOperator': [
0,
1,
Expand Down Expand Up @@ -896,12 +867,6 @@ export const AWS_CDK_ENUMS: { [key: string]: any } = {
'CONTINUE',
'ABANDON'
],
'DefaultSelection': [
'none',
'single',
'main',
'all'
],
'DeleteOption': [
'SAFE_DELETE',
'FORCE_DELETE',
Expand All @@ -927,14 +892,6 @@ export const AWS_CDK_ENUMS: { [key: string]: any } = {
'CODE_DEPLOY',
'EXTERNAL'
],
'DeploymentState': [
'pending',
'queued',
'deploying',
'completed',
'failed',
'skipped'
],
'DesiredState': [
'RUNNING',
'STOPPED'
Expand Down Expand Up @@ -1067,7 +1024,6 @@ export const AWS_CDK_ENUMS: { [key: string]: any } = {
'ECS_AL2_NVIDIA'
],
'Effect': [
'Unknown',
'Allow',
'Deny'
],
Expand Down Expand Up @@ -1177,11 +1133,6 @@ export const AWS_CDK_ENUMS: { [key: string]: any } = {
'SUPERSEDED',
'PARALLEL'
],
'ExtendedStackSelection': [
'none',
'upstream',
'downstream'
],
'FailoverStatusCode': [
403,
404,
Expand Down Expand Up @@ -1236,12 +1187,6 @@ export const AWS_CDK_ENUMS: { [key: string]: any } = {
0,
1
],
'FilterType': [
'resource-identifier',
'resource-type-prefix',
'tag-key',
'tag-value'
],
'FirehoseRecordSeparator': [
'\n',
'\t',
Expand Down Expand Up @@ -1300,11 +1245,6 @@ export const AWS_CDK_ENUMS: { [key: string]: any } = {
'BIWEEKLY',
'MONTHLY'
],
'FromScan': [
0,
1,
2
],
'FunctionEventType': [
'viewer-request',
'viewer-response'
Expand Down Expand Up @@ -2863,16 +2803,6 @@ export const AWS_CDK_ENUMS: { [key: string]: any } = {
'resume-cluster',
'failover-primary-compute'
],
'ResourceImpact': [
'WILL_UPDATE',
'WILL_CREATE',
'WILL_REPLACE',
'MAY_REPLACE',
'WILL_DESTROY',
'WILL_ORPHAN',
'WILL_IMPORT',
'NO_CHANGE'
],
'RetentionDays': [
1,
3,
Expand Down Expand Up @@ -2907,12 +2837,6 @@ export const AWS_CDK_ENUMS: { [key: string]: any } = {
'StartsWith',
'NotEqual'
],
'RollbackChoice': [
0,
1,
2,
3
],
'RouterType': [
'CarrierGateway',
'EgressOnlyInternetGateway',
Expand Down Expand Up @@ -2989,11 +2913,6 @@ export const AWS_CDK_ENUMS: { [key: string]: any } = {
'AddToLoadBalancer',
'InstanceRefresh'
],
'ScanStatus': [
'IN_PROGRESS',
'COMPLETE',
'FAILED'
],
'Scope': [
'task',
'shared'
Expand Down Expand Up @@ -3138,14 +3057,6 @@ export const AWS_CDK_ENUMS: { [key: string]: any } = {
'bar',
'events'
],
'StackSelectionStrategy': [
'ALL_STACKS',
'MAIN_ASSEMBLY',
'ONLY_SINGLE',
'PATTERN_MATCH',
'PATTERN_MUST_MATCH',
'PATTERN_MUST_MATCH_SINGLE'
],
'StackSetOrganizationsAutoDeployment': [
'Enabled',
'Disabled',
Expand Down Expand Up @@ -3406,11 +3317,6 @@ export const AWS_CDK_ENUMS: { [key: string]: any } = {
'TcpRetryEvent': [
'connection-error'
],
'TemplateSourceOptions': [
'path',
'stack',
'scan'
],
'TemplateType': [
'Text',
'Object'
Expand Down Expand Up @@ -4075,7 +3981,17 @@ export const AWS_CDK_ENUMS: { [key: string]: any } = {
'Windows_Server-2022-English-Full-SQL_2022_Express',
'Windows_Server-2022-English-Full-SQL_2022_Standard',
'Windows_Server-2022-Japanese-Full-SQL_2022_Standard',
'Windows_Server-2022-Japanese-Full-SQL_2022_Enterprise'
'Windows_Server-2022-Japanese-Full-SQL_2022_Enterprise',
'Windows_Server-2025-Chinese_Simplified-Full-Base',
'Windows_Server-2025-Chinese_Traditional-Full-Base',
'Windows_Server-2025-English-Core-Base',
'Windows_Server-2025-English-Full-Base',
'Windows_Server-2025-English-Full-SQL_2022_Enterprise',
'Windows_Server-2025-English-Full-SQL_2022_Express',
'Windows_Server-2025-English-Full-SQL_2022_Standard',
'Windows_Server-2025-English-Full-SQL_2022_Web',
'Windows_Server-2025-Japanese-Full-Base',
'Windows_Server-2025-Korean-Full-Base'
],
'WorkerType': [
'Standard',
Expand Down
Loading

0 comments on commit 6f1aa80

Please sign in to comment.