Skip to content

Commit

Permalink
Initial release for GET responses for GCS and RCS configurations
Browse files Browse the repository at this point in the history
  • Loading branch information
bo-lu committed Dec 19, 2023
1 parent 9224572 commit c835636
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 1 deletion.
110 changes: 109 additions & 1 deletion docs/cloudformation/geocore-stack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,24 @@ Resources:
KeyType: HASH
-
AttributeName: popularity
KeyType: RANGE
KeyType: RANGE

DynamoDbGeoviewConfigService:
Type: AWS::DynamoDB::Table
Condition: CreateDynamoDb
Properties:
TableName: geoview_config_service
BillingMode: PAY_PER_REQUEST
PointInTimeRecoverySpecification:
PointInTimeRecoveryEnabled: true
AttributeDefinitions:
-
AttributeName: uuid
AttributeType: S
KeySchema:
-
AttributeName: uuid
KeyType: HASH

GeoCoreDatabase:
Type: AWS::Glue::Database
Expand Down Expand Up @@ -1712,6 +1729,39 @@ Resources:
Layers:
- arn:aws:lambda:ca-central-1:336392948345:layer:AWSSDKPandas-Python38:4
LambdaViewerConfigService:
Type: AWS::Serverless::Function
Properties:
Runtime: python3.9
Role: !GetAtt LambdaExecutionRole.Arn
CodeUri:
Bucket: !Ref DeploymentBucket
Key:
Fn::If:
- IsProd
- cloudformation-templates/lambda/viewer-config-service/viewer-config-service-20231218-1200.zip
- Fn::If:
- IsStage
- cloudformation-templates/lambda/viewer-config-service/viewer-config-service-20231218-1200.zip
- cloudformation-templates/lambda/viewer-config-service/viewer-config-service-20231218-1200.zip
MemorySize: 3009
Handler: app.lambda_handler
Timeout: 15
Environment:
Variables:
GCS_TABLE: 'geoview_config_service'
GEOCORE_ID_API: 'https://geocore.api.geo.ca/id/v2'
RCS_CONFIG_PATH: 'https://maps.canada.ca/geonetwork/srv/api/v2/docs/'
Events:
ApiEvent:
Type: Api
Properties:
RestApiId: !Ref RestApi
Path: /vcs
Method: any
Layers:
- arn:aws:lambda:ca-central-1:336392948345:layer:AWSSDKPandas-Python39:11
LambdaExecutionRole:
Type: AWS::IAM::Role
Properties:
Expand Down Expand Up @@ -4283,6 +4333,64 @@ Resources:
requestTemplates:
application/json: "{\"statusCode\": 200}"
passthroughBehavior: "when_no_match"
/vcs:
get:
consumes:
- "application/json"
produces:
- "application/json"
responses:
"200":
description: "200 response"
schema:
$ref: "#/definitions/Empty"
headers:
Access-Control-Allow-Origin:
type: "string"
x-amazon-apigateway-integration:
type: "aws"
httpMethod: "POST"
uri: !Sub "arn:aws:apigateway:ca-central-1:lambda:path/2015-03-31/functions/arn:aws:lambda:ca-central-1:${AWS::AccountId}:function:${LambdaViewerConfigService}/invocations"
responses:
default:
statusCode: "200"
responseParameters:
method.response.header.Access-Control-Allow-Origin: "'*'"
requestTemplates:
application/json: "{\r\n \"lang\" : \"$input.params('lang')\",\r\n \
\ \"metadata\" : \"$input.params('metadata')\",\r\n \
\ \"id\" : \"$input.params('id')\"\r\n}"
passthroughBehavior: "when_no_templates"
contentHandling: "CONVERT_TO_TEXT"
options:
consumes:
- "application/json"
produces:
- "application/json"
responses:
"200":
description: "200 response"
schema:
$ref: "#/definitions/Empty"
headers:
Access-Control-Allow-Origin:
type: "string"
Access-Control-Allow-Methods:
type: "string"
Access-Control-Allow-Headers:
type: "string"
x-amazon-apigateway-integration:
type: "mock"
responses:
default:
statusCode: "200"
responseParameters:
method.response.header.Access-Control-Allow-Methods: "'GET,OPTIONS'"
method.response.header.Access-Control-Allow-Headers: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'"
method.response.header.Access-Control-Allow-Origin: "'*'"
requestTemplates:
application/json: "{\"statusCode\": 200}"
passthroughBehavior: "when_no_match"
/saved_records/add:
post:
produces:
Expand Down
Binary file not shown.
Binary file not shown.

0 comments on commit c835636

Please sign in to comment.