Skip to content

Commit

Permalink
Try to add usageplan back in
Browse files Browse the repository at this point in the history
  • Loading branch information
fredex42 committed Mar 15, 2024
1 parent 9a86573 commit 065ae08
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 15 deletions.
44 changes: 44 additions & 0 deletions cdk/lib/__snapshots__/concierge-graphql.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,50 @@ exports[`The ConciergeGraphql stack matches the snapshot 1`] = `
},
"Type": "AWS::ApiGatewayV2::VpcLink",
},
"GWGQLUsagePlanDDFEB42C": {
"DependsOn": [
"GWApiGWDefaultRouteDefaultIntegration60DE663E",
"GWApiGWDefaultRoute7E891A48",
"GWApiGWDefaultStage62BBA833",
"GWApiGW36D3A369",
],
"Properties": {
"ApiStages": [
{
"ApiId": {
"Ref": "GWApiGW36D3A369",
},
"Stage": "$default",
"Throttle": {
"$default": {
"BurstLimit": 150,
"RateLimit": 50,
},
},
},
],
"Description": "Usage plan for access to concierge-graphql",
"Tags": [
{
"Key": "gu:cdk:version",
"Value": "TEST",
},
{
"Key": "gu:repo",
"Value": "guardian/concierge-graphql",
},
{
"Key": "Stack",
"Value": "content-api",
},
{
"Key": "Stage",
"Value": "TEST",
},
],
},
"Type": "AWS::ApiGateway::UsagePlan",
},
"GetDistributablePolicyConciergegraphql510C52ED": {
"Properties": {
"PolicyDocument": {
Expand Down
31 changes: 16 additions & 15 deletions cdk/lib/gateway.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,21 +52,22 @@ export class HttpGateway extends Construct {
createDefaultStage: true,
});

// const plan = new CfnUsagePlan(this, "GQLUsagePlan", {
// apiStages: [
// {
// apiId: httpApi.apiId,
// stage: httpApi.defaultStage?.stageName,
// throttle: {
// "$default": {
// burstLimit: 150,
// rateLimit: 50
// }
// }
// }
// ],
// description: "Usage plan for access to concierge-graphql"
// });
const plan = new CfnUsagePlan(this, "GQLUsagePlan", {
apiStages: [
{
apiId: httpApi.apiId,
stage: httpApi.defaultStage?.stageName,
throttle: {
"$default": {
burstLimit: 150,
rateLimit: 50
}
}
}
],
description: "Usage plan for access to concierge-graphql"
});
plan.node.addDependency(httpApi);

}
}

0 comments on commit 065ae08

Please sign in to comment.