Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
fix(cdk): rename resources so v16.1.7 is not breaking
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbyheart committed Oct 26, 2020
1 parent 6f12245 commit 2ad08a4
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions cdk/resources/CellGeolocationApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export class CellGeolocationApi extends CloudFormation.Resource {
})
this.stage = new HttpApi.CfnStage(this, 'stage', {
apiId: this.api.ref,
stageName: 'v1',
stageName: '2020-10-26',
autoDeploy: true,
})

Expand All @@ -107,7 +107,7 @@ export class CellGeolocationApi extends CloudFormation.Resource {
`HttpApiLogGroup`,
{
removalPolicy: CloudFormation.RemovalPolicy.RETAIN,
logGroupName: `/${this.stack.stackName}/cellGeolocation/apiAccessLogs`,
logGroupName: `/${this.stack.stackName}/cell/apiAccessLogs`,
retention:
this.node.tryGetContext('isTest') === true
? CloudWatchLogs.RetentionDays.ONE_DAY
Expand Down Expand Up @@ -174,7 +174,7 @@ export class CellGeolocationApi extends CloudFormation.Resource {
sourceArn: `arn:aws:execute-api:${this.stack.region}:${this.stack.account}:${this.api.ref}/${this.stage.stageName}/GET/__health`,
})

// GET /cellgeolocation
// GET /cell

const geolocateIntegration = new HttpApi.CfnIntegration(
this,
Expand All @@ -190,16 +190,16 @@ export class CellGeolocationApi extends CloudFormation.Resource {

const geolocateRoute = new HttpApi.CfnRoute(this, 'geolocateRoute', {
apiId: this.api.ref,
routeKey: 'GET /cellgeolocation',
routeKey: 'GET /cell',
target: `integrations/${geolocateIntegration.ref}`,
})

getCell.addPermission('invokeByHttpApi', {
principal: new IAM.ServicePrincipal('apigateway.amazonaws.com'),
sourceArn: `arn:aws:execute-api:${this.stack.region}:${this.stack.account}:${this.api.ref}/${this.stage.stageName}/GET/cellgeolocation`,
sourceArn: `arn:aws:execute-api:${this.stack.region}:${this.stack.account}:${this.api.ref}/${this.stage.stageName}/GET/cell`,
})

// POST /cellgeolocation
// POST /cell

const geolocationIntegration = new HttpApi.CfnIntegration(
this,
Expand All @@ -215,13 +215,13 @@ export class CellGeolocationApi extends CloudFormation.Resource {

const geolocationRoute = new HttpApi.CfnRoute(this, 'geolocationRoute', {
apiId: this.api.ref,
routeKey: 'POST /cellgeolocation',
routeKey: 'POST /cell',
target: `integrations/${geolocationIntegration.ref}`,
})

addCell.addPermission('invokeByHttpApi', {
principal: new IAM.ServicePrincipal('apigateway.amazonaws.com'),
sourceArn: `arn:aws:execute-api:${this.stack.region}:${this.stack.account}:${this.api.ref}/${this.stage.stageName}/POST/cellgeolocation`,
sourceArn: `arn:aws:execute-api:${this.stack.region}:${this.stack.account}:${this.api.ref}/${this.stage.stageName}/POST/cell`,
})

const deployment = new HttpApi.CfnDeployment(this, 'deployment', {
Expand Down
4 changes: 2 additions & 2 deletions features/CellGeolocation.feature
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ Feature: Cell Geolocation API
available and has to be calculated, therefore the API will return 409 (Conflict)

Given I store "$millis()" into "ts"
When I GET /cellgeolocation?cell={cellId}&area=211&mccmnc=26201&ts={ts}
When I GET /cell?cell={cellId}&area=211&mccmnc=26201&ts={ts}
Then the response status code should be 409
And the response Access-Control-Allow-Origin should be "*"

Scenario: Query a cell

Given I store "$millis()" into "ts"
When I GET /cellgeolocation?cell={cellId}&area=211&mccmnc=26201&ts={ts}
When I GET /cell?cell={cellId}&area=211&mccmnc=26201&ts={ts}
Then the response status code should be 200
And the response Access-Control-Allow-Origin should be "*"
And the response Content-Type should be "application/json"
Expand Down
4 changes: 2 additions & 2 deletions features/CellGeolocationPublishApi.feature
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Feature: Cell Geolocation Publish API

Scenario: Provide cell geolocation

When I POST to /cellgeolocation with this JSON
When I POST to /cell with this JSON
"""
{
"cell": {cellId},
Expand All @@ -32,7 +32,7 @@ Feature: Cell Geolocation Publish API
Scenario: Query a cell

Given I store "$millis()" into "ts"
When I GET /cellgeolocation?cell={cellId}&area={area}&mccmnc={mccmnc}&ts={ts}
When I GET /cell?cell={cellId}&area={area}&mccmnc={mccmnc}&ts={ts}
Then the response status code should be 200
And the response Access-Control-Allow-Origin should be "*"
And the response Content-Type should be "application/json"
Expand Down

0 comments on commit 2ad08a4

Please sign in to comment.