diff --git a/.github/workflows/release-workflow.yml b/.github/workflows/release-workflow.yml index 18e0fad..4a061ca 100644 --- a/.github/workflows/release-workflow.yml +++ b/.github/workflows/release-workflow.yml @@ -56,7 +56,7 @@ jobs: VERSION=v${{ github.event.inputs.version }} DIST_OUTPUT_BUCKET=micl-dev TEMPLATE_OUTPUT_BUCKET=micl-dev-${{ env.REGION }} - ./build-s3-dist.sh --no-layer --template-bucket $TEMPLATE_OUTPUT_BUCKET --code-bucket $DIST_OUTPUT_BUCKET --version $VERSION --region $REGION + echo y | ./build-s3-dist.sh --no-layer --template-bucket $TEMPLATE_OUTPUT_BUCKET --code-bucket $DIST_OUTPUT_BUCKET --version $VERSION --region $REGION echo "Templates artifact:" cat ./templateUrl.txt - name: 'Upload MIE One-click Deployment Artifact' @@ -147,7 +147,7 @@ jobs: VERSION=v${{ github.event.inputs.version }} DIST_OUTPUT_BUCKET=micl-dev TEMPLATE_OUTPUT_BUCKET=micl-dev-${{ env.REGION }} - ./build-s3-dist.sh --no-layer --template-bucket $TEMPLATE_OUTPUT_BUCKET --code-bucket $DIST_OUTPUT_BUCKET --version $VERSION --region $REGION + echo y | ./build-s3-dist.sh --no-layer --template-bucket $TEMPLATE_OUTPUT_BUCKET --code-bucket $DIST_OUTPUT_BUCKET --version $VERSION --region $REGION echo "Templates artifact:" cat ./templateUrl.txt - name: 'Upload MIE One-click Deployment Artifact' diff --git a/CHANGELOG.md b/CHANGELOG.md index bfb5bba..e9cdd27 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,14 +4,6 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [1.0.0] - 2021-10-22 -- Initial release. - +## [1.0.0] - 2021-11-3 ### Added -- Everything. - -### Changed -- Nothing. This is the first release. - -### Removed -- Nothing. This is the first release. \ No newline at end of file +- CHANGELOG version 1.0.0 release \ No newline at end of file diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 08aeddc..9cc789d 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,7 +23,7 @@ reported the issue. Please try to include as much information as you can. Detail ## Contributing via Pull Requests Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that: -1. You are working against the latest source on the *main* branch. +1. You are working against the latest source on the *development* branch. 2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already. 3. You open an issue to discuss any significant work - we would hate for your time to be wasted. diff --git a/README.md b/README.md index daa41de..630b854 100644 --- a/README.md +++ b/README.md @@ -36,9 +36,9 @@ The following Cloudformation templates will deploy the Content Localization fron Region| Launch ------|----- -US West (Oregon) | [![Launch in us-west-2](doc/images/launch-stack.png)](https://console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks/new?stackName=clo&templateURL=https://rodeolabz-us-west-2.s3.us-west-2.amazonaws.com/content-localization-on-aws/v0.1.0/content-localization-on-aws.template) -US East (N. Virginia) | [![Launch in us-east-1](doc/images/launch-stack.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=clo&templateURL=https://rodeolabz-us-east-1.s3.us-east-1.amazonaws.com/content-localization-on-aws/v0.1.0/content-localization-on-aws.template) -EU West (Ireland) | [![Launch in eu-west-1](doc/images/launch-stack.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-west-1#/stacks/new?stackName=clo&templateURL=https://rodeolabz-eu-west-1.s3.eu-west-1.amazonaws.com/content-localization-on-aws/v0.1.0/content-localization-on-aws.template) +US West (Oregon) | [![Launch in us-west-2](doc/images/launch-stack.png)](https://console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks/new?stackName=clo&templateURL=https://rodeolabz-us-west-2.s3.us-west-2.amazonaws.com/content-localization-on-aws/v1.0.0/content-localization-on-aws.template) +US East (N. Virginia) | [![Launch in us-east-1](doc/images/launch-stack.png)](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=clo&templateURL=https://rodeolabz-us-east-1.s3.us-east-1.amazonaws.com/content-localization-on-aws/v1.0.0/content-localization-on-aws.template) +EU West (Ireland) | [![Launch in eu-west-1](doc/images/launch-stack.png)](https://console.aws.amazon.com/cloudformation/home?region=eu-west-1#/stacks/new?stackName=clo&templateURL=https://rodeolabz-eu-west-1.s3.eu-west-1.amazonaws.com/content-localization-on-aws/v1.0.0/content-localization-on-aws.template) For more installation options, see the [Advanced Installation](#advanced-installation-options) section. @@ -141,6 +141,10 @@ TEMPLATE=[copy "Without existing MIE deployment" link from output of build scrip aws cloudformation create-stack --stack-name $WEBAPP_STACK_NAME --template-url $TEMPLATE --region $REGION --parameters ParameterKey=AdminEmail,ParameterValue=$EMAIL --capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND --profile default --disable-rollback ``` +### Tests + +See the [tests README document](test/README.md) for information on how to run tests for this project. + # Advanced Usage ## Adding new operators and extending data stream consumers: @@ -255,7 +259,9 @@ aws s3 rb s3:// --force ## Collection of operational metrics -This solution collects anonymous operational metrics to help AWS improve the quality of features of the solution. For more information, including how to disable this capability, please see the [implementation guide](_https://docs.aws.amazon.com/solutions/latest//collection-of-operational-metrics.html_). +This solution collects anonymous operational metrics to help AWS improve the +quality of features of the solution. For more information, including how to disable +this capability, please see the [implementation guide](https://docs.aws.amazon.com/solutions/latest/content-localization-on-aws/collection-of-operational-metrics.html). When enabled, the following information is collected and sent to AWS: @@ -273,7 +279,7 @@ Example data: "UUID": "d84a0bd5-7483-494e-8ab1-fdfaa7e97687", "TimeStamp": "2021-03-01T20:03:05.798545", "Data": { - "Version": "v2.0.0", + "Version": "v1.0.0", "CFTemplate": "Created" } } diff --git a/deployment/content-localization-on-aws-auth.yaml b/deployment/content-localization-on-aws-auth.yaml index 8dedbfd..a60a5f7 100755 --- a/deployment/content-localization-on-aws-auth.yaml +++ b/deployment/content-localization-on-aws-auth.yaml @@ -1,5 +1,5 @@ AWSTemplateFormatVersion: "2010-09-09" -Description: "Content Localization on AWS - user authentication infrastructure" +Description: "Content Localization on AWS %%VERSION%% - user authentication infrastructure" Parameters: AdminEmail: diff --git a/deployment/content-localization-on-aws-opensearch.yaml b/deployment/content-localization-on-aws-opensearch.yaml index 1e64073..f0f5d4a 100755 --- a/deployment/content-localization-on-aws-opensearch.yaml +++ b/deployment/content-localization-on-aws-opensearch.yaml @@ -1,5 +1,5 @@ AWSTemplateFormatVersion: "2010-09-09" -Description: "Content Localization on AWS - Opensearch Consumer stack" +Description: "Content Localization on AWS %%VERSION%% - Opensearch Consumer stack" Parameters: NodeType: @@ -96,7 +96,7 @@ Resources: Variables: EsEndpoint: !GetAtt OpensearchServiceDomain.DomainEndpoint DataplaneBucket: !Ref MieDataplaneBucket - botoConfig: '{"user_agent_extra": "AwsSolution/SO0042/%%VERSION%%"}' + botoConfig: '{"user_agent_extra": "AwsSolution/SO0164/%%VERSION%%"}' # stream event mapping for lambda diff --git a/deployment/content-localization-on-aws-video-workflow.yaml b/deployment/content-localization-on-aws-video-workflow.yaml index 650495b..7240699 100644 --- a/deployment/content-localization-on-aws-video-workflow.yaml +++ b/deployment/content-localization-on-aws-video-workflow.yaml @@ -1,5 +1,5 @@ AWSTemplateFormatVersion: "2010-09-09" -Description: "Content Localization on AWS - Deploys video processing workflow" +Description: "Content Localization on AWS %%VERSION%% - Deploys video processing workflow" Parameters: WorkflowCustomResourceArn: diff --git a/deployment/content-localization-on-aws-web.yaml b/deployment/content-localization-on-aws-web.yaml index 607eac4..f01482f 100755 --- a/deployment/content-localization-on-aws-web.yaml +++ b/deployment/content-localization-on-aws-web.yaml @@ -1,5 +1,5 @@ AWSTemplateFormatVersion: "2010-09-09" -Description: "Content Localization on AWS - Deploys the Content Localization on AWS website resources" +Description: "Content Localization on AWS %%VERSION%% - Deploys the Content Localization on AWS website resources" Parameters: DataplaneEndpoint: diff --git a/source/consumer/lambda_handler.py b/source/consumer/lambda_handler.py index 90fdea9..690c503 100644 --- a/source/consumer/lambda_handler.py +++ b/source/consumer/lambda_handler.py @@ -1,5 +1,15 @@ -# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -# SPDX-License-Identifier: Apache-2.0 +###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # +# # +# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance # +# with the License. A copy of the License is located at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES # +# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions # +# and limitations under the License. # +###################################################################################################################### from elasticsearch import Elasticsearch, RequestsHttpConnection import base64 diff --git a/source/helper/website_helper.py b/source/helper/website_helper.py index 50a923e..dcb3d2f 100644 --- a/source/helper/website_helper.py +++ b/source/helper/website_helper.py @@ -1,3 +1,16 @@ +###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # +# # +# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance # +# with the License. A copy of the License is located at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES # +# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions # +# and limitations under the License. # +###################################################################################################################### + import boto3 import json import logging @@ -101,22 +114,20 @@ def copy_source(event, context): deployment_bucket = s3.Bucket(website_bucket) - objects = s3.Bucket(name=source_bucket).objects.filter(Prefix='{k}/'.format(k=source_key)) - - for s3_object in objects: - old_key = s3_object.key - LOGGER.info(old_key) - try: - new_key = old_key.split('website/')[1] - # Only pickup items under the "website" prefix - except IndexError: - pass - else: - source = {"Bucket": source_bucket, "Key": old_key} - deployment_bucket.copy(source, '{key}'.format(key=new_key)) - if replace_env_variables is True and new_key == "runtimeConfig.json": + with open('./webapp-manifest.json') as file: + manifest = json.load(file) + print('UPLOADING FILES::') + for key in manifest: + print('s3://'+source_bucket+'/'+source_key+'/'+key) + copy_source = { + 'Bucket': source_bucket, + 'Key': source_key+'/'+key + } + s3.meta.client.copy(copy_source, website_bucket, key) + if replace_env_variables is True and key == "runtimeConfig.json": LOGGER.info("updating runtimeConfig.json") - write_to_s3(event, context, website_bucket, new_key, json.dumps(new_variables)) + write_to_s3(event, context, website_bucket, key, json.dumps(new_variables)) + except Exception as e: LOGGER.info("Unable to copy website source code into the website bucket: {e}".format(e=e)) send_response(event, context, "FAILED", {"Message": "Unexpected event received from CloudFormation"}) diff --git a/source/website/babel.config.js b/source/website/babel.config.js index ba17966..0437481 100644 --- a/source/website/babel.config.js +++ b/source/website/babel.config.js @@ -1,3 +1,18 @@ +/* +###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. # +# # +# Licensed under the Apache License, Version 2.0 (the "License"). You may not use this file except in compliance # +# with the License. A copy of the License is located at # +# # +# http://www.apache.org/licenses/LICENSE-2.0 # +# # +# or in the 'license' file accompanying this file. This file is distributed on an 'AS IS' BASIS, WITHOUT WARRANTIES # +# OR CONDITIONS OF ANY KIND, express or implied. See the License for the specific language governing permissions # +# and limitations under the License. # +###################################################################################################################### +*/ + module.exports = { presets: [ '@vue/app' diff --git a/source/website/public/index.html b/source/website/public/index.html index bb33a44..b88a1c9 100644 --- a/source/website/public/index.html +++ b/source/website/public/index.html @@ -1,3 +1,17 @@ + diff --git a/source/website/src/App.vue b/source/website/src/App.vue index 859879f..8eea746 100644 --- a/source/website/src/App.vue +++ b/source/website/src/App.vue @@ -1,3 +1,17 @@ +