feat: update L1 CloudFormation resource definitions#37530
feat: update L1 CloudFormation resource definitions#37530vishaalmehrishi merged 1 commit intomainfrom
Conversation
8f06d84 to
5264a03
Compare
|
The PR build is failing due to an "uncommitted changes" error. The fix is in #37556. Once that PR is merged and this one is rebased, I will re-trigger the spec update and that should succeed. |
…37556) ### Issue Fixes the recurring build failure on L1 spec update PRs (e.g. #37530) where `git diff-index` detects uncommitted changes in `packages/@aws-cdk/cfn-property-mixins/package.json`. ### Reason for this change When `@aws-cdk/cfn-property-mixins` graduated from `mixins-preview` to a standalone package in #37215, it gained its own `gen` script that regenerates `package.json` exports from the service spec database. However, the `spec-update.yml` workflow was never updated to include it in the gen step. When new CloudFormation services are added (e.g. `AWS::NovaAct`, `AWS::SecurityAgent`), the gen script adds export entries to `cfn-property-mixins/package.json`. Since these changes aren't included in the automation commit, the PR build fails the `git diff-index` check. This is the same class of issue previously fixed in #36300 for `@aws-cdk/mixins-preview`. ### Description of changes Added `--scope @aws-cdk/cfn-property-mixins` to the gen step in `.github/workflows/spec-update.yml`, and added a comment explaining why all three scopes are required. ### Description of how you validated changes Confirmed the root cause by examining the [build logs for PR #37530](https://github.com/aws/aws-cdk/actions/runs/24179400660/job/70568296044) which show exactly `cfn-property-mixins/package.json` with 2 uncommitted insertions. ### 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*
5264a03 to
599797a
Compare
…37558) ### Issue Fixes the recurring build failure on L1 spec update PRs (e.g. #37530) where `git diff-index` detects uncommitted changes in `packages/@aws-cdk/cfn-property-mixins/package.json`. Supersedes #37556 which added `cfn-property-mixins` to the gen step but didn't fix the ordering issue. ### Root Cause: Race Condition in Parallel Gen The spec-update workflow runs `lerna run gen` for all three packages (`aws-cdk-lib`, `@aws-cdk/mixins-preview`, `@aws-cdk/cfn-property-mixins`) in a single command. Lerna executes them **in parallel**. This creates a race condition: 1. **`aws-cdk-lib` gen** writes new service entries (e.g. `aws-novaact`, `aws-securityagent`) to [`scope-map.json`](https://github.com/aws/aws-cdk/blob/main/packages/aws-cdk-lib/scripts/scope-map.json) via [`writeModuleMap()`](https://github.com/aws/aws-cdk/blob/main/tools/%40aws-cdk/spec2cdk/lib/module-topology.ts#L126) 2. **`cfn-property-mixins` gen** reads `scope-map.json` via [`loadModuleMap()`](https://github.com/aws/aws-cdk/blob/main/tools/%40aws-cdk/spec2cdk/lib/module-topology.ts#L119-L121) to determine which services to generate exports for — see the [filter at line 23](https://github.com/aws/aws-cdk/blob/main/tools/%40aws-cdk/spec2cdk/lib/cfn-prop-mixins/generate.ts#L23): `if (moduleMap[service.name])` 3. **`mixins-preview` gen** has the [same dependency](https://github.com/aws/aws-cdk/blob/main/packages/%40aws-cdk/mixins-preview/scripts/spec2logs/generate.ts#L6) on `scope-map.json` ### Evidence from workflow run [#354](https://github.com/aws/aws-cdk/actions/runs/24186251521/job/70591637015) The gen step logs show `cfn-property-mixins` finished **before** `aws-cdk-lib`: ``` 10:53:00 @aws-cdk/cfn-property-mixins: Services: 278 ← finished first, read stale scope-map.json 10:53:05 aws-cdk-lib: Services: 282 ← finished second, wrote updated scope-map.json ``` `cfn-property-mixins` generated for 278 services because it read `scope-map.json` before `aws-cdk-lib` added the 4 new service entries. During the CI build, `cdk-build` runs gen again with the updated `scope-map.json`, producing 2 new export entries in `package.json` that weren't in the commit → `git diff-index` fails. ### Description of changes Split the single `lerna run gen` command into two sequential steps: 1. **Generate L1 code** — runs gen for `aws-cdk-lib` only, which updates `scope-map.json` 2. **Generate mixins** — runs gen for `mixins-preview` and `cfn-property-mixins`, which now read the updated `scope-map.json` ### Description of how you validated changes - Traced the full dependency chain through the codebase (links above) - Confirmed the race condition from [workflow run #354 logs](https://github.com/aws/aws-cdk/actions/runs/24186251521/job/70591637015) showing 278 vs 282 services - Confirmed the [CI build failure logs](https://github.com/aws/aws-cdk/actions/runs/24186453052/job/70592307695) show the same `cfn-property-mixins/package.json | 2 ++` after the workflow re-run ### 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*
Updates the L1 CloudFormation resource definitions with the latest changes from `@aws-cdk/aws-service-spec`
599797a to
f28bb0e
Compare
|
CHANGES TO L1 RESOURCES: L1 resources are automatically generated from public CloudFormation Resource Schemas. They are built to closely reflect the real state of CloudFormation. Sometimes these updates can contain changes that are incompatible with previous types, but more accurately reflect reality. In this release we have changed: aws-appstream: AWS::AppStream::Stack: Id attribute removed. |
|
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Merge Queue Status
This pull request spent 5 minutes 20 seconds in the queue, with no time running CI. ReasonPull request #37530 has been merged manually at 117562c HintYou were too fast! |
|
Comments on closed issues and PRs are hard for our team to see. |
Updates the L1 CloudFormation resource definitions with the latest changes from
@aws-cdk/aws-service-specL1 CloudFormation resource definition changes:
CHANGES TO L1 RESOURCES: L1 resources are automatically generated from public CloudFormation Resource Schemas. They are built to closely reflect the real state of CloudFormation. Sometimes these updates can contain changes that are incompatible with previous types, but more accurately reflect reality. In this release we have changed:
aws-appstream: AWS::AppStream::Stack: Id attribute removed.
aws-appsync: AWS::AppSync::GraphQLApi: LogConfig.CloudWatchLogsRoleArn property is now required.
aws-appsync: AWS::AppSync::GraphQLApi: LogConfig.FieldLogLevel property is now required.
aws-kafkaconnect: AWS::KafkaConnect::Connector: ProvisionedCapacity.McuCount property is now required.