Skip to content
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

feat(cli): cdk rollback #31684

Merged
merged 4 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions packages/aws-cdk-lib/cx-api/FEATURE_FLAGS.md
Original file line number Diff line number Diff line change
Expand Up @@ -1143,7 +1143,7 @@ shipped as part of the runtime environment.

*When enabled, will always use the arn for identifiers for CfnSourceApiAssociation in the GraphqlApi construct rather than id.* (fix)

When this feature flag is enabled, we use the IGraphqlApi ARN rather than ID when creating or updating CfnSourceApiAssociation in
When this feature flag is enabled, we use the IGraphqlApi ARN rather than ID when creating or updating CfnSourceApiAssociation in
the GraphqlApi construct. Using the ARN allows the association to support an association with a source api or merged api in another account.
Note that for existing source api associations created with this flag disabled, enabling the flag will lead to a resource replacement.

Expand Down Expand Up @@ -1200,7 +1200,7 @@ database cluster from a snapshot.

*When enabled, the CodeCommit source action is using the default branch name 'main'.* (fix)

When setting up a CodeCommit source action for the source stage of a pipeline, please note that the
When setting up a CodeCommit source action for the source stage of a pipeline, please note that the
default branch is 'master'.
However, with the activation of this feature flag, the default branch is updated to 'main'.

Expand Down Expand Up @@ -1378,7 +1378,7 @@ Other notifications that are not managed by this stack will be kept.
Currently, 'inputPath' and 'outputPath' from the TaskStateBase Props is being used under BedrockInvokeModelProps to define S3URI under 'input' and 'output' fields
of State Machine Task definition.

When this feature flag is enabled, specify newly introduced props 's3InputUri' and
When this feature flag is enabled, specify newly introduced props 's3InputUri' and
's3OutputUri' to populate S3 uri under input and output fields in state machine task definition for Bedrock invoke model.


Expand Down Expand Up @@ -1413,7 +1413,7 @@ When this feature flag is enabled, we will only grant the necessary permissions
*When enabled, initOptions.timeout and resourceSignalTimeout values will be summed together.* (fix)

Currently is both initOptions.timeout and resourceSignalTimeout are both specified in the options for creating an EC2 Instance,
only the value from 'resourceSignalTimeout' will be used.
only the value from 'resourceSignalTimeout' will be used.

When this feature flag is enabled, if both initOptions.timeout and resourceSignalTimeout are specified, the values will to be summed together.

Expand All @@ -1428,11 +1428,11 @@ When this feature flag is enabled, if both initOptions.timeout and resourceSigna

*When enabled, a Lambda authorizer Permission created when using GraphqlApi will be properly scoped with a SourceArn.* (fix)

Currently, when using a Lambda authorizer with an AppSync GraphQL API, the AWS CDK automatically generates the necessary AWS::Lambda::Permission
to allow the AppSync API to invoke the Lambda authorizer. This permission is overly permissive because it lacks a SourceArn, meaning
Currently, when using a Lambda authorizer with an AppSync GraphQL API, the AWS CDK automatically generates the necessary AWS::Lambda::Permission
to allow the AppSync API to invoke the Lambda authorizer. This permission is overly permissive because it lacks a SourceArn, meaning
it allows invocations from any source.

When this feature flag is enabled, the AWS::Lambda::Permission will be properly scoped with the SourceArn corresponding to the
When this feature flag is enabled, the AWS::Lambda::Permission will be properly scoped with the SourceArn corresponding to the
specific AppSync GraphQL API.


Expand All @@ -1446,7 +1446,7 @@ specific AppSync GraphQL API.

*When enabled, both `@aws-sdk` and `@smithy` packages will be excluded from the Lambda Node.js 18.x runtime to prevent version mismatches in bundled applications.* (fix)

Currently, when bundling Lambda functions with the non-latest runtime that supports AWS SDK JavaScript (v3), only the '@aws-sdk/*' packages are excluded by default.
Currently, when bundling Lambda functions with the non-latest runtime that supports AWS SDK JavaScript (v3), only the '@aws-sdk/*' packages are excluded by default.
However, this can cause version mismatches between the '@aws-sdk/*' and '@smithy/*' packages, as they are tightly coupled dependencies in AWS SDK v3.

When this feature flag is enabled, both '@aws-sdk/*' and '@smithy/*' packages will be excluded during the bundling process. This ensures that no mismatches
Expand Down
14 changes: 12 additions & 2 deletions packages/aws-cdk/lib/api/util/cloudformation/stack-event-poller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,20 @@ export class StackEventPoller {
* On the CREATE_IN_PROGRESS, UPDATE_IN_PROGRESS, DELETE_IN_PROGRESS event of a nested stack, poll the nested stack updates
*/
private trackNestedStack(event: aws.CloudFormation.StackEvent, parentStackLogicalIds: string[]) {
const logicalId = event.LogicalResourceId ?? '';
const logicalId = event.LogicalResourceId;
const physicalResourceId = event.PhysicalResourceId;

// The CREATE_IN_PROGRESS event for a Nested Stack is emitted twice; first without a PhysicalResourceId
// and then with. Ignore this event if we don't have that property yet.
//
// (At this point, I also don't trust that logicalId is always going to be there so validate that as well)
if (!logicalId || !physicalResourceId) {
return;
}

if (!this.nestedStackPollers[logicalId]) {
this.nestedStackPollers[logicalId] = new StackEventPoller(this.cfn, {
stackName: event.PhysicalResourceId ?? '',
stackName: physicalResourceId,
parentStackLogicalIds: parentStackLogicalIds,
startTime: event.Timestamp.valueOf(),
});
Expand Down
4 changes: 3 additions & 1 deletion packages/aws-cdk/test/util/stack-monitor.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ describe('stack monitor, collecting errors from events', () => {
physicalResourceId: '',
resourceType: 'AWS::CloudFormation::Stack',
resourceStatusReason: 'nested stack failed',
resourceStatus: 'CREATE_IN_PROGRESS',
},
),
],
Expand All @@ -196,7 +197,8 @@ describe('stack monitor, collecting errors from events', () => {
},
]);

expect(monitor.errors).toStrictEqual(['nested stack failed', 'some failure']);
expect(monitor.errors).not.toContain('nested stack failed');
expect(monitor.errors).toContain('some failure');
});

test('does not check for nested stacks that have already completed successfully', async () => {
Expand Down
Loading