Skip to content
This repository has been archived by the owner on Jul 9, 2024. It is now read-only.

Commit

Permalink
fix: remove unless api key of graphql which will break deployment by cfn
Browse files Browse the repository at this point in the history
  • Loading branch information
zxkane committed Oct 28, 2021
1 parent ec3fa6e commit 0b94049
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 14 deletions.
9 changes: 0 additions & 9 deletions src/lib/dashboard-stack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ import {
CustomResource,
CfnMapping,
Aws,
Expiration,
Fn,
Resource,
Stack,
Expand Down Expand Up @@ -365,14 +364,6 @@ export class TransactionDashboardStack extends NestedStack {
defaultAuthorization: {
authorizationType: AuthorizationType.IAM,
},
additionalAuthorizationModes: [
{
authorizationType: AuthorizationType.API_KEY,
apiKeyConfig: {
expires: Expiration.after(Duration.days(30)),
},
},
],
},
xrayEnabled: true,
});
Expand Down
9 changes: 4 additions & 5 deletions test/dashboard-stack.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -295,11 +295,6 @@ describe('dashboard stack test suite', () => {

expect(stack).toHaveResourceLike('AWS::AppSync::GraphQLApi', {
AuthenticationType: 'AWS_IAM',
AdditionalAuthenticationProviders: [
{
AuthenticationType: 'API_KEY',
},
],
LogConfig: {
CloudWatchLogsRoleArn: {
'Fn::GetAtt': [
Expand Down Expand Up @@ -378,6 +373,10 @@ describe('dashboard stack test suite', () => {
});
});

test('no ApiKey of dashboard graphql is created', () => {
expect(stack).toCountResources('AWS::AppSync::ApiKey', 0);
});

test('transaction generator is created', () => {
expect(stack).toHaveResourceLike('AWS::Lambda::Function', {
Environment: {
Expand Down

0 comments on commit 0b94049

Please sign in to comment.