diff --git a/.projenrc.ts b/.projenrc.ts index 9d981a0d3..1dfff60c6 100644 --- a/.projenrc.ts +++ b/.projenrc.ts @@ -1265,7 +1265,8 @@ toolkitLib.package.addField('exports', { './package.json': './package.json', }); -toolkitLib.postCompileTask.exec('ts-node --prefer-ts-exts scripts/gen-code-registry.ts'); +const registryTask = toolkitLib.addTask('registry', { exec: 'tsx scripts/gen-code-registry.ts' }); +toolkitLib.postCompileTask.spawn(registryTask); toolkitLib.postCompileTask.exec('node build-tools/bundle.mjs'); // Smoke test built JS files toolkitLib.postCompileTask.exec('node ./lib/index.js >/dev/null 2>/dev/null /dev/null 2>/dev/nu toolkitLib.npmignore?.addPatterns( 'assets', 'docs', + 'docs_html', 'typedoc.json', '*.d.ts.map', // Explicitly allow all required files @@ -1293,7 +1295,7 @@ toolkitLib.npmignore?.addPatterns( toolkitLib.gitignore.addPatterns( ...ADDITIONAL_CLI_IGNORE_PATTERNS, - 'docs', + 'docs_html', 'build-info.json', 'lib/**/*.wasm', 'lib/**/*.yaml', diff --git a/packages/@aws-cdk/toolkit-lib/.gitignore b/packages/@aws-cdk/toolkit-lib/.gitignore index 99773b22a..1eb7f0c72 100644 --- a/packages/@aws-cdk/toolkit-lib/.gitignore +++ b/packages/@aws-cdk/toolkit-lib/.gitignore @@ -49,7 +49,7 @@ db.json.gz .init-version.json index_bg.wasm .recommended-feature-flags.json -docs +docs_html build-info.json lib/**/*.wasm lib/**/*.yaml diff --git a/packages/@aws-cdk/toolkit-lib/.npmignore b/packages/@aws-cdk/toolkit-lib/.npmignore index ccb176b46..49daa54d0 100644 --- a/packages/@aws-cdk/toolkit-lib/.npmignore +++ b/packages/@aws-cdk/toolkit-lib/.npmignore @@ -25,6 +25,7 @@ tsconfig.tsbuildinfo build-tools assets docs +docs_html typedoc.json *.d.ts.map !build-info.json diff --git a/packages/@aws-cdk/toolkit-lib/.projen/tasks.json b/packages/@aws-cdk/toolkit-lib/.projen/tasks.json index 46c25133f..48e87c385 100644 --- a/packages/@aws-cdk/toolkit-lib/.projen/tasks.json +++ b/packages/@aws-cdk/toolkit-lib/.projen/tasks.json @@ -171,7 +171,7 @@ "description": "Runs after successful compilation", "steps": [ { - "exec": "ts-node --prefer-ts-exts scripts/gen-code-registry.ts" + "spawn": "registry" }, { "exec": "node build-tools/bundle.mjs" @@ -208,6 +208,14 @@ } ] }, + "registry": { + "name": "registry", + "steps": [ + { + "exec": "tsx scripts/gen-code-registry.ts" + } + ] + }, "test": { "name": "test", "description": "Run tests", diff --git a/packages/@aws-cdk/toolkit-lib/CODE_REGISTRY.md b/packages/@aws-cdk/toolkit-lib/CODE_REGISTRY.md deleted file mode 100644 index fa3ecb256..000000000 --- a/packages/@aws-cdk/toolkit-lib/CODE_REGISTRY.md +++ /dev/null @@ -1,64 +0,0 @@ -## Toolkit Code Registry - -| Code | Description | Level | Data Interface | -|------|-------------|-------|----------------| -| CDK_TOOLKIT_I0000 | Default info messages emitted from the Toolkit | info | n/a | -| CDK_TOOLKIT_I0000 | Default debug messages emitted from the Toolkit | debug | n/a | -| CDK_TOOLKIT_W0000 | Default warning messages emitted from the Toolkit | warn | n/a | -| CDK_TOOLKIT_I1000 | Provides synthesis times. | info | [Duration](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/Duration.html) | -| CDK_TOOLKIT_I1901 | Provides stack data | result | [StackAndAssemblyData](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/StackAndAssemblyData.html) | -| CDK_TOOLKIT_I1902 | Successfully deployed stacks | result | [AssemblyData](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/AssemblyData.html) | -| CDK_TOOLKIT_I2901 | Provides details on the selected stacks and their dependencies | result | [StackDetailsPayload](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/StackDetailsPayload.html) | -| CDK_TOOLKIT_E3900 | Resource import failed | error | n/a | -| CDK_TOOLKIT_I5000 | Provides deployment times | info | [Duration](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/Duration.html) | -| CDK_TOOLKIT_I5001 | Provides total time in deploy action, including synth and rollback | info | [Duration](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/Duration.html) | -| CDK_TOOLKIT_I5002 | Provides time for resource migration | info | n/a | -| CDK_TOOLKIT_W5021 | Empty non-existent stack, deployment is skipped | warn | n/a | -| CDK_TOOLKIT_W5022 | Empty existing stack, stack will be destroyed | warn | n/a | -| CDK_TOOLKIT_I5031 | Informs about any log groups that are traced as part of the deployment | info | n/a | -| CDK_TOOLKIT_I5050 | Confirm rollback during deployment | info | [ConfirmationRequest](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/ConfirmationRequest.html) | -| CDK_TOOLKIT_I5060 | Confirm deploy security sensitive changes | info | [DeployConfirmationRequest](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/DeployConfirmationRequest.html) | -| CDK_TOOLKIT_I5100 | Stack deploy progress | info | [StackDeployProgress](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/StackDeployProgress.html) | -| CDK_TOOLKIT_I5310 | The computed settings used for file watching | debug | [WatchSettings](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/WatchSettings.html) | -| CDK_TOOLKIT_I5311 | File watching started | info | [FileWatchEvent](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/FileWatchEvent.html) | -| CDK_TOOLKIT_I5312 | File event detected, starting deployment | info | [FileWatchEvent](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/FileWatchEvent.html) | -| CDK_TOOLKIT_I5313 | File event detected during active deployment, changes are queued | info | [FileWatchEvent](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/FileWatchEvent.html) | -| CDK_TOOLKIT_I5314 | Initial watch deployment started | info | n/a | -| CDK_TOOLKIT_I5315 | Queued watch deployment started | info | n/a | -| CDK_TOOLKIT_I5501 | Stack Monitoring: Start monitoring of a single stack | info | [StackMonitoringControlEvent](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/StackMonitoringControlEvent.html) | -| CDK_TOOLKIT_I5502 | Stack Monitoring: Activity event for a single stack | info | [StackActivity](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/StackActivity.html) | -| CDK_TOOLKIT_I5503 | Stack Monitoring: Finished monitoring of a single stack | info | [StackMonitoringControlEvent](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/StackMonitoringControlEvent.html) | -| CDK_TOOLKIT_I5900 | Deployment results on success | result | [SuccessfulDeployStackResult](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/SuccessfulDeployStackResult.html) | -| CDK_TOOLKIT_I5901 | Generic deployment success messages | info | n/a | -| CDK_TOOLKIT_W5400 | Hotswap disclosure message | warn | n/a | -| CDK_TOOLKIT_E5001 | No stacks found | error | n/a | -| CDK_TOOLKIT_E5500 | Stack Monitoring error | error | [ErrorPayload](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/ErrorPayload.html) | -| CDK_TOOLKIT_I6000 | Provides rollback times | info | [Duration](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/Duration.html) | -| CDK_TOOLKIT_I6100 | Stack rollback progress | info | [StackRollbackProgress](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/StackRollbackProgress.html) | -| CDK_TOOLKIT_E6001 | No stacks found | error | n/a | -| CDK_TOOLKIT_E6900 | Rollback failed | error | [ErrorPayload](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/ErrorPayload.html) | -| CDK_TOOLKIT_I7000 | Provides destroy times | info | [Duration](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/Duration.html) | -| CDK_TOOLKIT_I7010 | Confirm destroy stacks | info | [ConfirmationRequest](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/ConfirmationRequest.html) | -| CDK_TOOLKIT_I7100 | Stack destroy progress | info | [StackDestroyProgress](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/StackDestroyProgress.html) | -| CDK_TOOLKIT_I7900 | Stack deletion succeeded | result | [cxapi.CloudFormationStackArtifact](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/cxapi.CloudFormationStackArtifact.html) | -| CDK_TOOLKIT_E7010 | Action was aborted due to negative confirmation of request | error | n/a | -| CDK_TOOLKIT_E7900 | Stack deletion failed | error | [ErrorPayload](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/ErrorPayload.html) | -| CDK_TOOLKIT_I9000 | Provides bootstrap times | info | [Duration](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/Duration.html) | -| CDK_TOOLKIT_I9100 | Bootstrap progress | info | [BootstrapEnvironmentProgress](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/BootstrapEnvironmentProgress.html) | -| CDK_TOOLKIT_I9900 | Bootstrap results on success | result | [cxapi.Environment](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/cxapi.Environment.html) | -| CDK_TOOLKIT_E9900 | Bootstrap failed | error | [ErrorPayload](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/ErrorPayload.html) | -| CDK_ASSEMBLY_I0010 | Generic environment preparation debug messages | debug | n/a | -| CDK_ASSEMBLY_W0010 | Emitted if the found framework version does not support context overflow | warn | n/a | -| CDK_ASSEMBLY_I0042 | Writing updated context | debug | [UpdatedContext](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/UpdatedContext.html) | -| CDK_ASSEMBLY_I0240 | Context lookup was stopped as no further progress was made. | debug | [MissingContext](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/MissingContext.html) | -| CDK_ASSEMBLY_I0241 | Fetching missing context. This is an iterative message that may appear multiple times with different missing keys. | debug | [MissingContext](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/MissingContext.html) | -| CDK_ASSEMBLY_I1000 | Cloud assembly output starts | debug | n/a | -| CDK_ASSEMBLY_I1001 | Output lines emitted by the cloud assembly to stdout | info | n/a | -| CDK_ASSEMBLY_E1002 | Output lines emitted by the cloud assembly to stderr | error | n/a | -| CDK_ASSEMBLY_I1003 | Cloud assembly output finished | info | n/a | -| CDK_ASSEMBLY_E1111 | Incompatible CDK CLI version. Upgrade needed. | error | [ErrorPayload](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/ErrorPayload.html) | -| CDK_ASSEMBLY_I0150 | Indicates the use of a pre-synthesized cloud assembly directory | debug | n/a | -| CDK_ASSEMBLY_I9999 | Annotations emitted by the cloud assembly | info | [cxapi.SynthesisMessage](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/cxapi.SynthesisMessage.html) | -| CDK_ASSEMBLY_W9999 | Warnings emitted by the cloud assembly | warn | [cxapi.SynthesisMessage](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/cxapi.SynthesisMessage.html) | -| CDK_ASSEMBLY_E9999 | Errors emitted by the cloud assembly | error | [cxapi.SynthesisMessage](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/cxapi.SynthesisMessage.html) | -| CDK_SDK_I0100 | An SDK trace. SDK traces are emitted as traces to the IoHost, but contain the original SDK logging level. | trace | [SdkTrace](https://docs.aws.amazon.com/cdk/api/toolkit-lib/interfaces/SdkTrace.html) | diff --git a/packages/@aws-cdk/toolkit-lib/docs/message-registry.md b/packages/@aws-cdk/toolkit-lib/docs/message-registry.md new file mode 100644 index 000000000..51f118f49 --- /dev/null +++ b/packages/@aws-cdk/toolkit-lib/docs/message-registry.md @@ -0,0 +1,68 @@ +--- +title: IoMessages Registry +group: Documents +--- +# IoMessages Registry + +| Code | Description | Level | Data Interface | +|------|-------------|-------|----------------| +| `CDK_TOOLKIT_I0000` | Default info messages emitted from the Toolkit | `info` | n/a | +| `CDK_TOOLKIT_I0000` | Default debug messages emitted from the Toolkit | `debug` | n/a | +| `CDK_TOOLKIT_W0000` | Default warning messages emitted from the Toolkit | `warn` | n/a | +| `CDK_TOOLKIT_I1000` | Provides synthesis times. | `info` | {@link Duration} | +| `CDK_TOOLKIT_I1901` | Provides stack data | `result` | {@link StackAndAssemblyData} | +| `CDK_TOOLKIT_I1902` | Successfully deployed stacks | `result` | {@link AssemblyData} | +| `CDK_TOOLKIT_I2901` | Provides details on the selected stacks and their dependencies | `result` | {@link StackDetailsPayload} | +| `CDK_TOOLKIT_E3900` | Resource import failed | `error` | n/a | +| `CDK_TOOLKIT_I5000` | Provides deployment times | `info` | {@link Duration} | +| `CDK_TOOLKIT_I5001` | Provides total time in deploy action, including synth and rollback | `info` | {@link Duration} | +| `CDK_TOOLKIT_I5002` | Provides time for resource migration | `info` | n/a | +| `CDK_TOOLKIT_W5021` | Empty non-existent stack, deployment is skipped | `warn` | n/a | +| `CDK_TOOLKIT_W5022` | Empty existing stack, stack will be destroyed | `warn` | n/a | +| `CDK_TOOLKIT_I5031` | Informs about any log groups that are traced as part of the deployment | `info` | n/a | +| `CDK_TOOLKIT_I5050` | Confirm rollback during deployment | `info` | {@link ConfirmationRequest} | +| `CDK_TOOLKIT_I5060` | Confirm deploy security sensitive changes | `info` | {@link DeployConfirmationRequest} | +| `CDK_TOOLKIT_I5100` | Stack deploy progress | `info` | {@link StackDeployProgress} | +| `CDK_TOOLKIT_I5310` | The computed settings used for file watching | `debug` | {@link WatchSettings} | +| `CDK_TOOLKIT_I5311` | File watching started | `info` | {@link FileWatchEvent} | +| `CDK_TOOLKIT_I5312` | File event detected, starting deployment | `info` | {@link FileWatchEvent} | +| `CDK_TOOLKIT_I5313` | File event detected during active deployment, changes are queued | `info` | {@link FileWatchEvent} | +| `CDK_TOOLKIT_I5314` | Initial watch deployment started | `info` | n/a | +| `CDK_TOOLKIT_I5315` | Queued watch deployment started | `info` | n/a | +| `CDK_TOOLKIT_I5501` | Stack Monitoring: Start monitoring of a single stack | `info` | {@link StackMonitoringControlEvent} | +| `CDK_TOOLKIT_I5502` | Stack Monitoring: Activity event for a single stack | `info` | {@link StackActivity} | +| `CDK_TOOLKIT_I5503` | Stack Monitoring: Finished monitoring of a single stack | `info` | {@link StackMonitoringControlEvent} | +| `CDK_TOOLKIT_I5900` | Deployment results on success | `result` | {@link SuccessfulDeployStackResult} | +| `CDK_TOOLKIT_I5901` | Generic deployment success messages | `info` | n/a | +| `CDK_TOOLKIT_W5400` | Hotswap disclosure message | `warn` | n/a | +| `CDK_TOOLKIT_E5001` | No stacks found | `error` | n/a | +| `CDK_TOOLKIT_E5500` | Stack Monitoring error | `error` | {@link ErrorPayload} | +| `CDK_TOOLKIT_I6000` | Provides rollback times | `info` | {@link Duration} | +| `CDK_TOOLKIT_I6100` | Stack rollback progress | `info` | {@link StackRollbackProgress} | +| `CDK_TOOLKIT_E6001` | No stacks found | `error` | n/a | +| `CDK_TOOLKIT_E6900` | Rollback failed | `error` | {@link ErrorPayload} | +| `CDK_TOOLKIT_I7000` | Provides destroy times | `info` | {@link Duration} | +| `CDK_TOOLKIT_I7010` | Confirm destroy stacks | `info` | {@link ConfirmationRequest} | +| `CDK_TOOLKIT_I7100` | Stack destroy progress | `info` | {@link StackDestroyProgress} | +| `CDK_TOOLKIT_I7900` | Stack deletion succeeded | `result` | [cxapi.CloudFormationStackArtifact](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_cx-api.CloudFormationStackArtifact.html) | +| `CDK_TOOLKIT_E7010` | Action was aborted due to negative confirmation of request | `error` | n/a | +| `CDK_TOOLKIT_E7900` | Stack deletion failed | `error` | {@link ErrorPayload} | +| `CDK_TOOLKIT_I9000` | Provides bootstrap times | `info` | {@link Duration} | +| `CDK_TOOLKIT_I9100` | Bootstrap progress | `info` | {@link BootstrapEnvironmentProgress} | +| `CDK_TOOLKIT_I9900` | Bootstrap results on success | `result` | [cxapi.Environment](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_cx-api.Environment.html) | +| `CDK_TOOLKIT_E9900` | Bootstrap failed | `error` | {@link ErrorPayload} | +| `CDK_ASSEMBLY_I0010` | Generic environment preparation debug messages | `debug` | n/a | +| `CDK_ASSEMBLY_W0010` | Emitted if the found framework version does not support context overflow | `warn` | n/a | +| `CDK_ASSEMBLY_I0042` | Writing updated context | `debug` | {@link UpdatedContext} | +| `CDK_ASSEMBLY_I0240` | Context lookup was stopped as no further progress was made. | `debug` | {@link MissingContext} | +| `CDK_ASSEMBLY_I0241` | Fetching missing context. This is an iterative message that may appear multiple times with different missing keys. | `debug` | {@link MissingContext} | +| `CDK_ASSEMBLY_I1000` | Cloud assembly output starts | `debug` | n/a | +| `CDK_ASSEMBLY_I1001` | Output lines emitted by the cloud assembly to stdout | `info` | n/a | +| `CDK_ASSEMBLY_E1002` | Output lines emitted by the cloud assembly to stderr | `error` | n/a | +| `CDK_ASSEMBLY_I1003` | Cloud assembly output finished | `info` | n/a | +| `CDK_ASSEMBLY_E1111` | Incompatible CDK CLI version. Upgrade needed. | `error` | {@link ErrorPayload} | +| `CDK_ASSEMBLY_I0150` | Indicates the use of a pre-synthesized cloud assembly directory | `debug` | n/a | +| `CDK_ASSEMBLY_I9999` | Annotations emitted by the cloud assembly | `info` | [cxapi.SynthesisMessage](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_cx-api.SynthesisMessage.html) | +| `CDK_ASSEMBLY_W9999` | Warnings emitted by the cloud assembly | `warn` | [cxapi.SynthesisMessage](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_cx-api.SynthesisMessage.html) | +| `CDK_ASSEMBLY_E9999` | Errors emitted by the cloud assembly | `error` | [cxapi.SynthesisMessage](https://docs.aws.amazon.com/cdk/api/v2/docs/@aws-cdk_cx-api.SynthesisMessage.html) | +| `CDK_SDK_I0100` | An SDK trace. SDK traces are emitted as traces to the IoHost, but contain the original SDK logging level. | `trace` | {@link SdkTrace} | diff --git a/packages/@aws-cdk/toolkit-lib/lib/actions/deploy/index.ts b/packages/@aws-cdk/toolkit-lib/lib/actions/deploy/index.ts index 8b865c6f1..ad278d47f 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/actions/deploy/index.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/actions/deploy/index.ts @@ -2,7 +2,9 @@ import type { CloudFormationStackArtifact } from '@aws-cdk/cx-api'; import type { BaseDeployOptions } from './private/deploy-options'; import type { Tag } from '../../api/aws-cdk'; import type { ConfirmationRequest } from '../../toolkit/types'; -import type { PermissionChangeType } from '../diff/private/helpers'; +import type { PermissionChangeType } from '../diff'; + +export type { StackMonitoringControlEvent, StackActivity } from '../../api/aws-cdk'; export type DeploymentMethod = DirectDeploymentMethod | ChangeSetDeploymentMethod; @@ -51,6 +53,9 @@ export enum AssetBuildTime { JUST_IN_TIME = 'just-in-time', } +/** + * @deprecated + */ export enum RequireApproval { /** * Never require any security approvals @@ -238,5 +243,5 @@ export interface DeployConfirmationRequest extends ConfirmationRequest { /** * The type of change being made to the IAM permissions. */ - readonly permissionChangeType?: PermissionChangeType; + readonly permissionChangeType: PermissionChangeType; } diff --git a/packages/@aws-cdk/toolkit-lib/lib/actions/diff/index.ts b/packages/@aws-cdk/toolkit-lib/lib/actions/diff/index.ts index 327a200ec..bbe1e7261 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/actions/diff/index.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/actions/diff/index.ts @@ -115,3 +115,23 @@ export interface DiffOptions { */ readonly securityOnly?: boolean; } + +/** + * Different types of permission related changes in a diff + */ +export enum PermissionChangeType { + /** + * No permission changes + */ + NONE = 'none', + + /** + * Permissions are broadening + */ + BROADENING = 'broadening', + + /** + * Permissions are changed but not broadening + */ + NON_BROADENING = 'non-broadening', +} diff --git a/packages/@aws-cdk/toolkit-lib/lib/actions/diff/private/helpers.ts b/packages/@aws-cdk/toolkit-lib/lib/actions/diff/private/helpers.ts index 011793c97..790d9a171 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/actions/diff/private/helpers.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/actions/diff/private/helpers.ts @@ -1,26 +1,7 @@ import type { DescribeChangeSetOutput } from '@aws-cdk/cloudformation-diff'; import { fullDiff } from '@aws-cdk/cloudformation-diff'; import type * as cxapi from '@aws-cdk/cx-api'; - -/** - * Different types of permissioning changes in a diff - */ -export enum PermissionChangeType { - /** - * No permission changes - */ - NONE = 'none', - - /** - * Permissions are broadening - */ - BROADENING = 'broadening', - - /** - * Permissions are changed but not broadening - */ - NON_BROADENING = 'non-broadening', -} +import { PermissionChangeType } from '..'; /** * Return whether the diff has security-impacting changes that need confirmation. diff --git a/packages/@aws-cdk/toolkit-lib/lib/actions/index.ts b/packages/@aws-cdk/toolkit-lib/lib/actions/index.ts index add78a1be..1e86ec265 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/actions/index.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/actions/index.ts @@ -1,6 +1,7 @@ export * from './bootstrap'; export * from './deploy'; export * from './destroy'; +export { PermissionChangeType } from './diff'; export * from './list'; export * from './rollback'; export * from './synth'; diff --git a/packages/@aws-cdk/toolkit-lib/lib/api/cloud-assembly/index.ts b/packages/@aws-cdk/toolkit-lib/lib/api/cloud-assembly/index.ts index b7aa1c094..412137fd7 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/api/cloud-assembly/index.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/api/cloud-assembly/index.ts @@ -1,3 +1,4 @@ +export * from './context'; export * from './source-builder'; export * from './stack-selector'; export * from './types'; diff --git a/packages/@aws-cdk/toolkit-lib/lib/api/io/index.ts b/packages/@aws-cdk/toolkit-lib/lib/api/io/index.ts index 00239c196..78ea7527a 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/api/io/index.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/api/io/index.ts @@ -1 +1,23 @@ export type { IoMessageLevel, IoMessageCode, IIoHost, IoMessage, IoRequest } from '../shared-public'; + +/** + * An SDK logging trace. + * + * Only info, warn and error level messages are emitted. + * SDK traces are emitted as traces to the IoHost, but contain the original SDK logging level. + */ +export interface SdkTrace { + /** + * The level the SDK has emitted the original message with + */ + readonly sdkLevel: 'info' | 'warn' | 'error'; + + /** + * The content of the SDK trace + * + * This will include the request and response data for API calls, including potentially sensitive information. + * + * @see https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/logging-sdk-calls.html + */ + readonly content: any; +} diff --git a/packages/@aws-cdk/toolkit-lib/lib/api/io/private/messages.ts b/packages/@aws-cdk/toolkit-lib/lib/api/io/private/messages.ts index a455e9188..caca8d5ea 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/api/io/private/messages.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/api/io/private/messages.ts @@ -1,5 +1,5 @@ import type * as cxapi from '@aws-cdk/cx-api'; -import type { SdkTrace } from './sdk-logger'; +import type { SdkTrace } from '../'; import type { BootstrapEnvironmentProgress } from '../../../actions/bootstrap'; import type { DeployConfirmationRequest, StackDeployProgress } from '../../../actions/deploy'; import type { StackDestroyProgress } from '../../../actions/destroy'; diff --git a/packages/@aws-cdk/toolkit-lib/lib/api/io/private/sdk-logger.ts b/packages/@aws-cdk/toolkit-lib/lib/api/io/private/sdk-logger.ts index 529305dd7..d96a81e99 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/api/io/private/sdk-logger.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/api/io/private/sdk-logger.ts @@ -5,28 +5,6 @@ import { IO } from './messages'; import { replacerBufferWithInfo } from '../../../private/util'; import type { IoHelper } from '../../shared-private'; -/** - * An SDK logging trace. - * - * Only info, warn and error level messages are emitted. - * SDK traces are emitted as traces to the IoHost, but contain the original SDK logging level. - */ -export interface SdkTrace { - /** - * The level the SDK has emitted the original message with - */ - readonly sdkLevel: 'info' | 'warn' | 'error'; - - /** - * The content of the SDK trace - * - * This will include the request and response data for API calls, including potentially sensitive information. - * - * @see https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/logging-sdk-calls.html - */ - readonly content: any; -} - export function asSdkLogger(ioHost: IoHelper): Logger { return new class implements Logger { // This is too much detail for our logs diff --git a/packages/@aws-cdk/toolkit-lib/lib/index.ts b/packages/@aws-cdk/toolkit-lib/lib/index.ts index 86a648ea3..66b68cbe1 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/index.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/index.ts @@ -1,3 +1,7 @@ +/** + * @module toolkit-lib + */ + // The main show export * from './toolkit'; export * from './actions'; diff --git a/packages/@aws-cdk/toolkit-lib/lib/toolkit/toolkit.ts b/packages/@aws-cdk/toolkit-lib/lib/toolkit/toolkit.ts index 5438922c9..096fdc34b 100644 --- a/packages/@aws-cdk/toolkit-lib/lib/toolkit/toolkit.ts +++ b/packages/@aws-cdk/toolkit-lib/lib/toolkit/toolkit.ts @@ -78,8 +78,6 @@ export interface ToolkitOptions { /** * The AWS CDK Programmatic Toolkit - * - * @document ../../CODE_REGISTRY.md */ export class Toolkit extends CloudAssemblySourceBuilder implements AsyncDisposable { /** @@ -359,7 +357,7 @@ export class Toolkit extends CloudAssemblySourceBuilder implements AsyncDisposab const deployConfirmed = await ioHelper.requestResponse(IO.CDK_TOOLKIT_I5060.req(deployQuestion, { motivation: deployMotivation, concurrency, - permissionChangeType: permissionChangeType, + permissionChangeType, })); if (!deployConfirmed) { throw new ToolkitError('Aborted by user'); diff --git a/packages/@aws-cdk/toolkit-lib/package.json b/packages/@aws-cdk/toolkit-lib/package.json index 93a28eb12..1ec6692ad 100644 --- a/packages/@aws-cdk/toolkit-lib/package.json +++ b/packages/@aws-cdk/toolkit-lib/package.json @@ -21,6 +21,7 @@ "post-compile": "npx projen post-compile", "pre-compile": "npx projen pre-compile", "publish-local": "npx projen publish-local", + "registry": "npx projen registry", "test": "npx projen test", "test:watch": "npx projen test:watch", "unbump": "npx projen unbump", diff --git a/packages/@aws-cdk/toolkit-lib/scripts/gen-code-registry.ts b/packages/@aws-cdk/toolkit-lib/scripts/gen-code-registry.ts index d41d0ebfb..ed00fbbdb 100644 --- a/packages/@aws-cdk/toolkit-lib/scripts/gen-code-registry.ts +++ b/packages/@aws-cdk/toolkit-lib/scripts/gen-code-registry.ts @@ -1,4 +1,5 @@ import * as fs from 'fs'; +import * as util from 'util'; import { IO } from '../lib/api/io/private/messages'; function codesToMarkdownTable(codes: Record Privacy | Site terms | © 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved." + "headings": { + "readme": false, + "document": false + }, + "customFooterHtml": "" }