Skip to content

Commit

Permalink
Merge branch 'main' into merge-back/2.102.0
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] committed Oct 19, 2023
2 parents 2abc59a + 99740b3 commit 300d648
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/aws-cdk-lib/aws-appsync/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,11 @@ new appsync.SourceApiAssociation(this, 'SourceApiAssociation2', {
});
```

## Merge Source API Update Within CDK Deployment

The SourceApiAssociationMergeOperation construct available in the [awscdk-appsync-utils](https://github.com/cdklabs/awscdk-appsync-utils) package provides the ability to merge a source API to a Merged API via a custom
resource. If the merge operation fails with a conflict, the stack update will fail and rollback the changes to the source API in the stack in order to prevent merge conflicts and ensure the source API changes are always propagated to the Merged API.

## Custom Domain Names

For many use cases you may want to associate a custom domain name with your
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ export interface RotationScheduleOptions {
* Specifies the number of days after the previous rotation before
* Secrets Manager triggers the next automatic rotation.
*
* The maximum value is 1000 days.
*
* A value of zero (`Duration.days(0)`) will not create RotationRules.
*
* @default Duration.days(30)
Expand Down Expand Up @@ -125,6 +127,9 @@ export class RotationSchedule extends Resource {
}

let automaticallyAfterDays: number | undefined = undefined;
if (props.automaticallyAfter && props.automaticallyAfter.toDays() > 1000) {
throw new Error(`automaticallyAfter must not be greater than 1000 days, got ${props.automaticallyAfter.toDays()} days`);
}
if (props.automaticallyAfter?.toMilliseconds() !== 0) {
automaticallyAfterDays = props.automaticallyAfter?.toDays() || 30;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,3 +651,21 @@ test('rotation schedule should have a dependency on lambda permissions', () => {
],
});
});

test('automaticallyAfter must not be greater than 1000 days', () => {
// GIVEN
const secret = new secretsmanager.Secret(stack, 'Secret');
const rotationLambda = new lambda.Function(stack, 'Lambda', {
runtime: lambda.Runtime.NODEJS_LATEST,
code: lambda.Code.fromInline('export.handler = event => event;'),
handler: 'index.handler',
});

// WHEN
// THEN
expect(() => new secretsmanager.RotationSchedule(stack, 'RotationSchedule', {
secret,
rotationLambda,
automaticallyAfter: Duration.days(1001),
})).toThrow(/automaticallyAfter must not be greater than 1000 days, got 1001 days/);
});

0 comments on commit 300d648

Please sign in to comment.