Skip to content

Commit

Permalink
Merge branch 'feature/24704-add-missing-synthetic-runtime' of https:/…
Browse files Browse the repository at this point in the history
…/github.com/frichtarik/aws-cdk into feature/24704-add-missing-synthetic-runtime
  • Loading branch information
kaizencc committed Oct 20, 2023
2 parents 80c044c + cf817dc commit 1d5c443
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 2 deletions.
1 change: 1 addition & 0 deletions packages/@aws-cdk-testing/cli-integ/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
"npm": "^8.19.4",
"p-queue": "^6.6.2",
"semver": "^7.5.4",
"sinon": "^9.2.4",
"ts-mock-imports": "^1.3.8",
"yaml": "1.10.2",
"yargs": "^17.7.2"
Expand Down
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 @@ -39,7 +39,7 @@ export class AlbTarget extends AlbArnTarget {
* @param alb The application load balancer to load balance to
* @param port The port on which the target is listening
*/
constructor(alb: elbv2.ApplicationLoadBalancer, port: number) {
constructor(alb: elbv2.IApplicationLoadBalancer, port: number) {
super(alb.loadBalancerArn, port);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ export interface RotationScheduleOptions {
* Specifies the number of days after the previous rotation before
* Secrets Manager triggers the next automatic rotation.
*
* A value of zero will disable automatic rotation - `Duration.days(0)`.
* 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 1d5c443

Please sign in to comment.