diff --git a/docs/cloudformation/geocore-eo-rcm-ard-harvester.yml b/docs/cloudformation/geocore-eo-rcm-ard-harvester.yml index d160b19..c63ad41 100644 --- a/docs/cloudformation/geocore-eo-rcm-ard-harvester.yml +++ b/docs/cloudformation/geocore-eo-rcm-ard-harvester.yml @@ -118,7 +118,7 @@ Resources: GEOCORE_TEMPLATE_BUCKET_NAME: !Sub 'webpresence-geocore-template-${Environment}' GEOCORE_TEMPLATE_NAME: 'geocore-format-null-template.json' ITEM_LINK_BUCKET_NAME: !Sub 'eo-sg-datacube-item-links-${Environment}' - PROCESSED_DATA_BUCKET_NAME: !Ref ProcessedDataS3Bucket + PROCESSED_DATA_BUCKET_NAME: !Sub 'eo-sg-processed-data-rcm-ard-${Environment}' API_ROOT: 'https://www.eodms-sgdot.nrcan-rncan.gc.ca/stac' ROOT_NAME: 'EODMS Datacube API / EODMS Cube de données API' SOURCE: 'eodms' @@ -175,7 +175,7 @@ Resources: Variables: GEOCORE_TEMPLATE_BUCKET_NAME: !Sub 'webpresence-geocore-template-${Environment}' GEOCORE_TEMPLATE_NAME: 'geocore-format-null-template.json' - PROCESSED_DATA_BUCKET_NAME: !Ref ProcessedDataS3Bucket + PROCESSED_DATA_BUCKET_NAME: !Sub 'eo-sg-processed-data-rcm-ard-${Environment}' API_ROOT: 'https://www.eodms-sgdot.nrcan-rncan.gc.ca/stac' ROOT_NAME: 'EODMS Datacube API / EODMS Cube de données API' SOURCE: 'eodms' @@ -405,7 +405,7 @@ Resources: Timeout: 900 Environment: Variables: - GEOJSON_BUCKET_NAME: !Ref ProcessedDataS3Bucket + GEOJSON_BUCKET_NAME: !Sub 'eo-sg-processed-data-rcm-ard-${Environment}' PARQUET_BUCKET_NAME: !Sub 'webpresence-geocore-geojson-to-parquet-${Environment}' DYNAMODB_TABLE: 'analytics_popularity' PARQUET_FILENAME: 'rcm-ard.parquet' diff --git a/docs/cloudformation/geocore-hnap-harvest-app-geo-ca-v2.yml b/docs/cloudformation/geocore-hnap-harvest-app-geo-ca-v2.yml new file mode 100644 index 0000000..1507ca5 --- /dev/null +++ b/docs/cloudformation/geocore-hnap-harvest-app-geo-ca-v2.yml @@ -0,0 +1,108 @@ +AWSTemplateFormatVersion: '2010-09-09' +Transform: 'AWS::Serverless-2016-10-31' +Description: Deploys HNAP JSON harvester solution + GeoNetwork to geocore translation + +Parameters: + Environment: + Type: AWS::SSM::Parameter::Value + Default: /webpresence/environment + Description: SSM parameter name for environment + DeploymentBucket: + Type: AWS::SSM::Parameter::Value + Default: /webpresence/deployment-bucket + Description: S3 bucket where all deployment files are stored + SvelteBucketString: + Type: String + Description: Unique string generated by the svelte app.geo.ca v2 deployment + +Conditions: + IsProd: !Equals [prod, !Ref Environment] + IsStage: !Equals [stage, !Ref Environment] + IsDev: !Equals [dev, !Ref Environment] + +Resources: + HnapJsonHarvesterAppGeoCav2: + Type: AWS::Serverless::Function + Properties: + Runtime: python3.9 + Role: !GetAtt LambdaExecutionRole.Arn + CodeUri: + Bucket: !Ref DeploymentBucket + Key: + Fn::If: + - IsProd + - cloudformation-templates/lambda/geocore-hnap-harvest/geocore-hnap-harvest-20241212-1100.zip + - Fn::If: + - IsStage + - cloudformation-templates/lambda/geocore-hnap-harvest/geocore-hnap-harvest-20241212-1100.zip + - cloudformation-templates/lambda/geocore-hnap-harvest/geocore-hnap-harvest-20241212-1100.zip + MemorySize: 3009 + Handler: app.lambda_handler + Timeout: 900 + Environment: + Variables: + BUCKET_NAME: !Sub 'app-geo-ca-pv-datalake-${SvelteBucketString}/hnap' + GEOJSON_BUCKET_NAME: !Sub 'app-geo-ca-pv-datalake-${SvelteBucketString}/geojson' + BASE_URL: 'https://maps.canada.ca' + GN_JSON_RECORD_URL_START: 'https://maps.canada.ca/geonetwork/srv/api/0.1/records/' + RUN_INTERVAL_MINUTES: 11 + Layers: + - arn:aws:lambda:ca-central-1:336392948345:layer:AWSSDKPandas-Python39:8 + + HnapJsonHarvesterRule: + Type: AWS::Events::Rule + Properties: + Name: !Sub 'harvester-10mins-app-geo-ca-v2-${Environment}' + Description: Harvester on a 10 minute interval + State: DISABLED + ScheduleExpression: 'rate(10 minutes)' + Targets: + - + Arn: + Fn::GetAtt: + - HnapJsonHarvesterAppGeoCav2 + - Arn + Id: !Ref HnapJsonHarvesterAppGeoCav2 + + PermissionForEventsToInvokeHarvesterLambda: + Type: AWS::Lambda::Permission + Properties: + FunctionName: !Ref HnapJsonHarvesterAppGeoCav2 + Action: 'lambda:InvokeFunction' + Principal: 'events.amazonaws.com' + SourceArn: !GetAtt + - HnapJsonHarvesterRule + - Arn + + LambdaExecutionRole: + Type: AWS::IAM::Role + Properties: + AssumeRolePolicyDocument: + Version: '2012-10-17' + Statement: + - Effect: Allow + Principal: + Service: + - lambda.amazonaws.com + Action: + - sts:AssumeRole + ManagedPolicyArns: + - arn:aws:iam::aws:policy/service-role/AWSLambdaBasicExecutionRole + Policies: + - PolicyName: 'policy' + PolicyDocument: + Version: '2012-10-17' + Statement: + - Effect: 'Allow' + Action: + - 's3:*' + Resource: + - !Sub arn:aws:s3:::app-geo-ca-pv-datalake-${SvelteBucketString} + - !Sub arn:aws:s3:::app-geo-ca-pv-datalake-${SvelteBucketString}/* + + LogGroup: + Type: Custom::LogGroup + Properties: + ServiceToken: !ImportValue LogGroupHelperLambdaArn + LogGroupName: !Sub '/${Environment}/webpresence/hnap_json_harvest_app-geo-ca-v2' + RetentionInDays: 3653 \ No newline at end of file diff --git a/docs/cloudformation/geocore-hnap-harvest.yml b/docs/cloudformation/geocore-hnap-harvest.yml index ad4732c..3fc514b 100644 --- a/docs/cloudformation/geocore-hnap-harvest.yml +++ b/docs/cloudformation/geocore-hnap-harvest.yml @@ -84,11 +84,11 @@ Resources: Key: Fn::If: - IsProd - - cloudformation-templates/lambda/geocore-hnap-harvest/geocore-hnap-harvest-20230823-1800.zip + - cloudformation-templates/lambda/geocore-hnap-harvest/geocore-hnap-harvest-20241212-1100.zip - Fn::If: - IsStage - - cloudformation-templates/lambda/geocore-hnap-harvest/geocore-hnap-harvest-20230823-1800.zip - - cloudformation-templates/lambda/geocore-hnap-harvest/geocore-hnap-harvest-20230823-1800.zip + - cloudformation-templates/lambda/geocore-hnap-harvest/geocore-hnap-harvest-20241212-1100.zip + - cloudformation-templates/lambda/geocore-hnap-harvest/geocore-hnap-harvest-20241212-1100.zip MemorySize: 3009 Handler: app.lambda_handler Timeout: 900 diff --git a/docs/cloudformation/geocore-stack.yml b/docs/cloudformation/geocore-stack.yml index f835351..43eef6d 100644 --- a/docs/cloudformation/geocore-stack.yml +++ b/docs/cloudformation/geocore-stack.yml @@ -4139,7 +4139,9 @@ Resources: ,\r\n \"type\": \"$input.params('type')\",\r\n \"org\": \"$input.params('org')\"\ ,\r\n \"min\": \"$input.params('min')\",\r\n \"max\": \"$input.params('max')\"\ ,\r\n \"foundational\": \"$input.params('foundational')\" - ,\r\n \"sort\": \"$input.params('sort')\" + ,\r\n \"sort\": \"$input.params('sort')\" + ,\r\n \"begin\": \"$input.params('begin')\" + ,\r\n \"end\": \"$input.params('end')\" ,\r\n \"source_system\": \"$input.params('sourcesystemname')\" ,\r\n \"eo_collection\": \"$input.params('eocollection')\" ,\r\n \"polarization\": \"$input.params('polarization')\" diff --git a/docs/lambda/geocore-hnap-harvest/geocore-hnap-harvest-20230823-1800.zip b/docs/lambda/geocore-hnap-harvest/geocore-hnap-harvest-20230823-1800.zip new file mode 100644 index 0000000..c015c62 Binary files /dev/null and b/docs/lambda/geocore-hnap-harvest/geocore-hnap-harvest-20230823-1800.zip differ diff --git a/docs/lambda/geocore-hnap-harvest/geocore-hnap-harvest-20241212-1100.zip b/docs/lambda/geocore-hnap-harvest/geocore-hnap-harvest-20241212-1100.zip new file mode 100644 index 0000000..06f96d9 Binary files /dev/null and b/docs/lambda/geocore-hnap-harvest/geocore-hnap-harvest-20241212-1100.zip differ