Skip to content

Commit

Permalink
tested
Browse files Browse the repository at this point in the history
  • Loading branch information
watany-dev committed Oct 15, 2024
1 parent fce4e73 commit 3475884
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ class FunctionUrlOriginWithOAC extends cloudfront.OriginBase {

if (!this.isCheckAuthType()) {
cdk.Annotations.of(scope).addWarning(
'FunctionUrlOriginWithOAC: When the origin access control signing method is SIGV4_ALWAYS, it is recommended to set the authType of the Function URL to AWS_IAM.'
'FunctionUrlOriginWithOAC: When the origin access control signing method is SIGV4_ALWAYS, it is recommended to set the authType of the Function URL to AWS_IAM.',
);
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Template, Match } from '../../assertions';
import { Annotations, Template, Match } from '../../assertions';
import * as cloudfront from '../../aws-cloudfront';
import * as lambda from '../../aws-lambda';
import { Stack } from '../../core';
Expand Down Expand Up @@ -162,6 +162,11 @@ describe('FunctionUrlOriginAccessControl', () => {
},
});

// Check that the warning is added
Annotations.fromStack(stack).hasWarning('*',
'FunctionUrlOriginWithOAC: When the origin access control signing method is SIGV4_ALWAYS, it is recommended to set the authType of the Function URL to AWS_IAM.',
);

const template = Template.fromStack(stack);

template.hasResourceProperties('AWS::CloudFront::Distribution', {
Expand Down

0 comments on commit 3475884

Please sign in to comment.