diff --git a/docs/cloudformation/geocore-stack.yml b/docs/cloudformation/geocore-stack.yml index 9a86ee7..c4fb0a8 100644 --- a/docs/cloudformation/geocore-stack.yml +++ b/docs/cloudformation/geocore-stack.yml @@ -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 @@ -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: @@ -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: diff --git a/docs/lambda/viewer-config-service/viewer-config-service-20231218-0800.zip b/docs/lambda/viewer-config-service/viewer-config-service-20231218-0800.zip new file mode 100644 index 0000000..7b645e6 Binary files /dev/null and b/docs/lambda/viewer-config-service/viewer-config-service-20231218-0800.zip differ diff --git a/docs/lambda/viewer-config-service/viewer-config-service-20231218-1200.zip b/docs/lambda/viewer-config-service/viewer-config-service-20231218-1200.zip new file mode 100644 index 0000000..8403f07 Binary files /dev/null and b/docs/lambda/viewer-config-service/viewer-config-service-20231218-1200.zip differ