From 42aec803258fcc1c2dfcc879047c15131dc7d570 Mon Sep 17 00:00:00 2001 From: Reet Takkar Date: Wed, 9 Jul 2025 16:50:59 -0400 Subject: [PATCH 1/2] Added deprecation notice to README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 8869564..d0200f0 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Maintaining Personalized Experiences with Machine Learning +⚠️🚨⚠️ **Important: [The Maintaining Personalized Experiences with Machine Learning](https://aws.amazon.com/solutions/implementations/maintaining-personalized-experiences-with-ml/) solution will retire in October 2025. Deployments (via CloudFormation or GitHub) will remain operational, but customers will assume responsibility for maintenance and API-related updates after support ends. Customers can explore using [Amazon Personalize](https://aws.amazon.com/personalize/) to deliver hyper-personalized user experiences in real-time at scale to improve user engagement, customer loyalty, and business results.** ⚠️🚨⚠️ + The Maintaining Personalized Experiences with Machine Learning solution provides a mechanism to automate much of the workflow around Amazon Personalize. This includes dataset group creation, dataset creation and import, solution creation, solution version creation, campaign creation and batch inference job creation From 14e46d7203f94db6d5159a8490779f6175aa99c2 Mon Sep 17 00:00:00 2001 From: Reet Takkar Date: Thu, 2 Oct 2025 15:29:04 -0400 Subject: [PATCH 2/2] Upgrade to version v1.5.0 --- .gitignore | 5 +- CHANGELOG.md | 12 ++ NOTICE.txt | 5 +- README.md | 2 +- deployment/run-unit-tests.sh | 12 +- source/aws_lambda/__init__.py | 14 +-- .../create_batch_inference_job/__init__.py | 14 +-- .../create_batch_inference_job/handler.py | 14 +-- .../create_batch_segment_job/__init__.py | 14 +-- .../create_batch_segment_job/handler.py | 14 +-- source/aws_lambda/create_campaign/__init__.py | 14 +-- source/aws_lambda/create_campaign/handler.py | 14 +-- source/aws_lambda/create_config/__init__.py | 14 +-- source/aws_lambda/create_config/handler.py | 15 +-- source/aws_lambda/create_dataset/__init__.py | 14 +-- source/aws_lambda/create_dataset/handler.py | 14 +-- .../create_dataset_group/__init__.py | 14 +-- .../create_dataset_group/handler.py | 14 +-- .../create_dataset_import_job/__init__.py | 14 +-- .../create_dataset_import_job/handler.py | 14 +-- .../create_event_tracker/__init__.py | 14 +-- .../create_event_tracker/handler.py | 14 +-- source/aws_lambda/create_filter/__init__.py | 14 +-- source/aws_lambda/create_filter/handler.py | 14 +-- .../aws_lambda/create_recommender/__init__.py | 14 +-- .../aws_lambda/create_recommender/handler.py | 14 +-- source/aws_lambda/create_schema/__init__.py | 14 +-- source/aws_lambda/create_schema/handler.py | 14 +-- source/aws_lambda/create_solution/__init__.py | 14 +-- source/aws_lambda/create_solution/handler.py | 14 +-- .../create_solution_version/__init__.py | 14 +-- .../create_solution_version/handler.py | 14 +-- .../aws_lambda/create_timestamp/__init__.py | 14 +-- source/aws_lambda/create_timestamp/handler.py | 14 +-- source/aws_lambda/prepare_input/__init__.py | 14 +-- source/aws_lambda/prepare_input/handler.py | 14 +-- source/aws_lambda/s3_event/__init__.py | 14 +-- source/aws_lambda/s3_event/handler.py | 15 +-- source/aws_lambda/shared/__init__.py | 14 +-- source/aws_lambda/shared/date_helpers.py | 14 +-- source/aws_lambda/shared/events.py | 15 +-- source/aws_lambda/shared/exceptions.py | 15 +-- .../aws_lambda/shared/notifiers/__init__.py | 14 +-- source/aws_lambda/shared/notifiers/base.py | 14 +-- .../shared/notifiers/notify_eventbridge.py | 15 +-- .../aws_lambda/shared/personalize/__init__.py | 14 +-- .../shared/personalize/service_model.py | 14 +-- .../aws_lambda/shared/personalize_service.py | 15 +-- source/aws_lambda/shared/resource/__init__.py | 14 +-- source/aws_lambda/shared/resource/base.py | 15 +-- .../shared/resource/batch_inference_job.py | 15 +-- .../shared/resource/batch_segment_job.py | 15 +-- source/aws_lambda/shared/resource/campaign.py | 15 +-- source/aws_lambda/shared/resource/dataset.py | 15 +-- .../shared/resource/dataset_group.py | 15 +-- .../shared/resource/dataset_import_job.py | 15 +-- .../shared/resource/event_tracker.py | 15 +-- source/aws_lambda/shared/resource/filter.py | 15 +-- source/aws_lambda/shared/resource/name.py | 15 +-- .../aws_lambda/shared/resource/recommender.py | 15 +-- source/aws_lambda/shared/resource/schema.py | 15 +-- source/aws_lambda/shared/resource/solution.py | 15 +-- .../shared/resource/solution_version.py | 15 +-- source/aws_lambda/shared/s3.py | 14 +-- source/aws_lambda/shared/sfn_middleware.py | 15 +-- .../aws_lambda/sns_notification/__init__.py | 14 +-- source/aws_lambda/sns_notification/handler.py | 15 +-- source/cdk_solution_helper_py/README.md | 14 +-- .../helpers_cdk/aws_solutions/cdk/__init__.py | 14 +-- .../helpers_cdk/aws_solutions/cdk/aspects.py | 15 +-- .../aws_solutions/cdk/aws_lambda/__init__.py | 14 +-- .../cfn_custom_resources/__init__.py | 14 +-- .../resource_hash/__init__.py | 14 +-- .../resource_hash/hash.py | 15 +-- .../resource_hash/src/__init__.py | 14 +-- .../src/custom_resources/__init__.py | 14 +-- .../src/custom_resources/hash.py | 15 +-- .../resource_name/__init__.py | 14 +-- .../resource_name/name.py | 15 +-- .../resource_name/src/__init__.py | 14 +-- .../src/custom_resources/__init__.py | 14 +-- .../src/custom_resources/name.py | 15 +-- .../solutions_metrics/__init__.py | 14 +-- .../solutions_metrics/metrics.py | 15 +-- .../solutions_metrics/src/__init__.py | 14 +-- .../src/custom_resources/__init__.py | 14 +-- .../src/custom_resources/metrics.py | 15 +-- .../cdk/aws_lambda/environment.py | 14 +-- .../cdk/aws_lambda/environment_variable.py | 14 +-- .../cdk/aws_lambda/java/__init__.py | 14 +-- .../cdk/aws_lambda/java/bundling.py | 15 +-- .../cdk/aws_lambda/java/function.py | 15 +-- .../cdk/aws_lambda/layers/__init__.py | 14 +-- .../layers/aws_lambda_powertools/__init__.py | 14 +-- .../layers/aws_lambda_powertools/layer.py | 14 +-- .../cdk/aws_lambda/python/__init__.py | 14 +-- .../cdk/aws_lambda/python/bundling.py | 14 +-- .../cdk/aws_lambda/python/function.py | 14 +-- .../cdk/aws_lambda/python/hash_utils.py | 14 +-- .../cdk/aws_lambda/python/layer.py | 14 +-- .../helpers_cdk/aws_solutions/cdk/cfn_nag.py | 14 +-- .../helpers_cdk/aws_solutions/cdk/context.py | 15 +-- .../aws_solutions/cdk/helpers/__init__.py | 14 +-- .../aws_solutions/cdk/helpers/copytree.py | 14 +-- .../aws_solutions/cdk/helpers/loader.py | 14 +-- .../aws_solutions/cdk/helpers/logger.py | 14 +-- .../aws_solutions/cdk/interfaces.py | 14 +-- .../helpers_cdk/aws_solutions/cdk/mappings.py | 15 +-- .../aws_solutions/cdk/scripts/__init__.py | 14 +-- .../cdk/scripts/build_s3_cdk_dist.py | 14 +-- .../helpers_cdk/aws_solutions/cdk/stack.py | 14 +-- .../cdk/stepfunctions/__init__.py | 14 +-- .../cdk/stepfunctions/solution_fragment.py | 15 +-- .../cdk/stepfunctions/solutionstep.py | 14 +-- .../aws_solutions/cdk/synthesizers.py | 76 +++--------- .../aws_solutions/cdk/tools/__init__.py | 14 +-- .../aws_solutions/cdk/tools/cleaner.py | 14 +-- .../helpers_cdk/setup.py | 14 +-- .../aws_solutions/core/__init__.py | 14 +-- .../aws_solutions/core/config.py | 14 +-- .../aws_solutions/core/helpers.py | 14 +-- .../aws_solutions/core/logging.py | 14 +-- .../helpers_common/setup.py | 14 +-- .../requirements-dev.txt | 1 - source/infrastructure/__init__.py | 14 +-- source/infrastructure/aspects/__init__.py | 12 -- source/infrastructure/aspects/app_registry.py | 96 ---------------- source/infrastructure/cdk.json | 3 +- source/infrastructure/deploy.py | 35 ++---- source/infrastructure/personalize/__init__.py | 14 +-- .../personalize/aws_lambda/__init__.py | 14 +-- .../aws_lambda/functions/__init__.py | 14 +-- .../functions/create_batch_inference_job.py | 15 +-- .../functions/create_batch_segment_job.py | 15 +-- .../aws_lambda/functions/create_campaign.py | 15 +-- .../aws_lambda/functions/create_config.py | 14 +-- .../aws_lambda/functions/create_dataset.py | 15 +-- .../functions/create_dataset_group.py | 15 +-- .../functions/create_dataset_import_job.py | 15 +-- .../functions/create_event_tracker.py | 15 +-- .../aws_lambda/functions/create_filter.py | 15 +-- .../functions/create_recommender.py | 15 +-- .../functions/create_scheduled_task.py | 15 +-- .../aws_lambda/functions/create_schema.py | 15 +-- .../aws_lambda/functions/create_solution.py | 15 +-- .../functions/create_solution_version.py | 15 +-- .../aws_lambda/functions/create_timestamp.py | 15 +-- .../aws_lambda/functions/environment.py | 14 +-- .../aws_lambda/functions/prepare_input.py | 14 +-- .../aws_lambda/functions/s3_event.py | 14 +-- .../personalize/aws_lambda/layers/__init__.py | 14 +-- .../layers/aws_solutions/__init__.py | 14 +-- .../aws_lambda/layers/aws_solutions/layer.py | 14 +-- .../personalize/cloudwatch/__init__.py | 14 +-- .../personalize/cloudwatch/dashboard.py | 15 +-- .../infrastructure/personalize/s3/__init__.py | 14 +-- .../personalize/s3/access_logs_bucket.py | 14 +-- .../personalize/s3/data_bucket.py | 14 +-- source/infrastructure/personalize/s3/utils.py | 14 +-- .../personalize/sns/__init__.py | 14 +-- .../personalize/sns/notifications.py | 15 +-- source/infrastructure/personalize/stack.py | 28 ++--- .../personalize/step_functions/__init__.py | 14 +-- .../batch_inference_jobs_fragment.py | 15 +-- .../batch_segment_jobs_fragment.py | 15 +-- .../step_functions/dataset_import_fragment.py | 15 +-- .../dataset_imports_fragment.py | 3 + .../step_functions/event_tracker_fragment.py | 15 +-- .../step_functions/failure_fragment.py | 15 +-- .../step_functions/filter_fragment.py | 15 +-- .../personalization_fragment.py | 15 +-- .../scheduled_dataset_import.py | 58 +++++----- .../scheduled_solution_maintenance.py | 77 ++++++------- .../step_functions/scheduler_fragment.py | 15 +-- .../personalize/step_functions/schedules.py | 14 +-- .../step_functions/solution_fragment.py | 15 +-- source/infrastructure/setup.py | 15 +-- source/pytest.ini | 1 - source/requirements-dev.txt | 1 - source/scheduler/cdk/__init__.py | 14 +-- .../aws_solutions/scheduler/cdk/__init__.py | 14 +-- .../scheduler/cdk/aws_lambda/__init__.py | 14 +-- .../cdk/aws_lambda/create_scheduled_task.py | 14 +-- .../cdk/aws_lambda/delete_scheduled_task.py | 14 +-- .../get_next_scheduled_event/build.gradle | 14 +-- .../get_next_scheduled_event/gradlew | 17 +-- .../get_next_scheduled_event/settings.gradle | 14 +-- .../HandleScheduleEvent.java | 14 +-- .../schedule_sfn_task/ScheduleEvent.java | 14 +-- .../schedule_sfn_task/ScheduleException.java | 14 +-- .../HandleScheduleEventTest.java | 14 +-- .../cdk/aws_lambda/read_scheduled_task.py | 14 +-- .../cdk/aws_lambda/scheduler/__init__.py | 14 +-- .../cdk/aws_lambda/scheduler/handler.py | 14 +-- .../cdk/aws_lambda/update_scheduled_task.py | 14 +-- .../aws_solutions/scheduler/cdk/construct.py | 29 ++--- .../scheduler/cdk/scheduler_fragment.py | 15 +-- source/scheduler/cdk/setup.py | 14 +-- source/scheduler/common/__init__.py | 14 +-- .../scheduler/common/__init__.py | 14 +-- .../aws_solutions/scheduler/common/base.py | 14 +-- .../scheduler/common/schedule.py | 14 +-- .../scheduler/common/scripts/__init__.py | 14 +-- .../scheduler/common/scripts/scheduler_cli.py | 15 +-- .../aws_solutions/scheduler/common/task.py | 14 +-- .../scheduler/common/task_resource.py | 14 +-- source/scheduler/common/setup.py | 14 +-- source/tests/__init__.py | 14 +-- source/tests/aspects/__init__.py | 12 -- .../aspects/test_personalize_app_stack.py | 108 ------------------ source/tests/aws_lambda/__init__.py | 14 +-- .../create_batch_inference_job/__init__.py | 14 +-- .../test_batch_inference_job_handler.py | 14 +-- .../create_batch_segment_job/__init__.py | 14 +-- .../test_batch_segment_job_handler.py | 14 +-- .../aws_lambda/create_campaign/__init__.py | 14 +-- .../test_create_campaign_handler.py | 14 +-- .../aws_lambda/create_config/__init__.py | 14 +-- .../test_create_config_handler.py | 17 +-- .../aws_lambda/create_dataset/__init__.py | 14 +-- .../create_dataset/test_dataset_handler.py | 14 +-- .../create_dataset_group/__init__.py | 14 +-- .../test_dataset_group_handler.py | 14 +-- .../create_dataset_import_job/__init__.py | 14 +-- .../test_dataset_import_job_handler.py | 32 +----- .../create_event_tracker/__init__.py | 14 +-- .../test_create_event_tracker_handler.py | 30 +---- .../aws_lambda/create_filter/__init__.py | 14 +-- .../test_create_filter_handler.py | 14 +-- .../aws_lambda/create_recommender/__init__.py | 14 +-- .../test_create_recommender_handler.py | 14 +-- .../aws_lambda/create_schema/__init__.py | 14 +-- .../create_schema/create_schema_handler.py | 14 +-- .../aws_lambda/create_solution/__init__.py | 14 +-- .../test_create_solution_handler.py | 14 +-- .../create_solution_version/__init__.py | 14 +-- .../test_create_solution_version_handler.py | 14 +-- .../s3_event/test_s3_event_handler.py | 15 +-- .../sns_notification/test_sns_notification.py | 15 +-- source/tests/aws_lambda/test_events.py | 14 +-- .../aws_lambda/test_personalize_service.py | 15 +-- .../tests/aws_lambda/test_sfn_middleware.py | 17 +-- source/tests/cdk_solution_helper/__init__.py | 14 +-- .../resource_hash/test_resource_name.py | 15 +-- .../resource_hash/test_resource_name_cdk.py | 14 +-- .../resource_name/test_resource_hash.py | 15 +-- .../resource_name/test_resource_hash_cdk.py | 14 +-- .../solution_metrics/test_metrics_cdk.py | 14 +-- .../solution_metrics/test_metrics_resource.py | 16 +-- .../java/fixtures/java_sample/gradlew | 17 +-- .../aws_lambda/java/test_java_function.py | 15 +-- .../lambda/package/minimal/__init__.py | 15 +-- .../python/fixtures/lambda/package/setup.py | 14 +-- .../packages/package2/minimal2/__init__.py | 15 +-- .../fixtures/packages/package2/setup.py | 14 +-- .../aws_lambda/python/test_function.py | 15 +-- .../aws_lambda/python/test_layer_version.py | 15 +-- .../helpers/test_load_cdk_app.py | 15 +-- .../helpers/test_logger.py | 14 +-- .../tests/cdk_solution_helper/test_aspects.py | 14 +-- .../test_build_s3_cdk_dist.py | 15 +-- .../cdk_solution_helper/test_cdk_context.py | 14 +-- .../test_cdk_interfaces.py | 14 +-- .../test_cfn_nag_suppressions.py | 14 +-- .../tests/cdk_solution_helper/test_helpers.py | 14 +-- .../cdk_solution_helper/test_interfaces.py | 14 +-- .../tests/cdk_solution_helper/test_logging.py | 14 +-- .../cdk_solution_helper/test_mappings.py | 15 +-- .../test_solution_config.py | 14 +-- .../tests/cdk_solution_helper/test_stack.py | 14 +-- .../cdk_solution_helper/test_synthesizers.py | 17 +-- .../cdk_solution_helper/tools/test_cleaner.py | 14 +-- source/tests/conftest.py | 36 +++--- source/tests/test_deploy.py | 14 +-- source/tests/test_notifies.py | 15 +-- source/tests/test_personalize_stack.py | 17 +-- source/tests/test_resources.py | 14 +-- source/tests/test_scheduler.py | 15 +-- source/tests/test_scheduler_cli.py | 14 +-- 279 files changed, 740 insertions(+), 3615 deletions(-) delete mode 100644 source/infrastructure/aspects/__init__.py delete mode 100644 source/infrastructure/aspects/app_registry.py delete mode 100644 source/tests/aspects/__init__.py delete mode 100644 source/tests/aspects/test_personalize_app_stack.py diff --git a/.gitignore b/.gitignore index ac8a6e3..b3c779a 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,3 @@ -# Modified based on https://www.gitignore.io/api/visualstudiocode,python - # compiled output **/global-s3-assets **/regional-s3-assets @@ -68,3 +66,6 @@ source/scheduler/cdk/build/* # nightswatch test results .nightswatch/functional/test-results.xml + +# Brazil Build files +/build \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index c7fe6e2..69826a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,18 @@ 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.5.0] - 2025-10-02 + +### Fixed + +- Deprecation warnings arising from aws-cdk-lib +- Bucket Notifications Handler Lambda to use Python 3.11 runtime + +### Changed + +- Removed use of AWS Service Catalog AppRegistry +- Standardized license headers across source files + ## [1.4.6] - 2025-06-26 ### Fixed diff --git a/NOTICE.txt b/NOTICE.txt index b7360f4..b6c7cca 100644 --- a/NOTICE.txt +++ b/NOTICE.txt @@ -17,7 +17,6 @@ AWS Lambda Java Support Libraries under the Apache-2.0 license aws-lambda-powertools under the MIT No Attribution license aws_cdk_lib under the Apache-2.0 license under the Apache-2.0 license aws_solutions_constructs.aws_lambda_sns under the Apache-2.0 license -aws-cdk.aws-servicecatalogappregistry-alpha under the Apache-2.0 license cdk-nag under the Apache-2.0 license AWS SDK under the Apache-2.0 license boto3 under the Apache-2.0 license @@ -64,5 +63,7 @@ OPEN SOURCE LICENSES 0BSD - https://opensource.org/licenses/0BSD Apache-2.0 - https://opensource.org/licenses/Apache-2.0 +BSD-3-Clause - https://spdx.org/licenses/BSD-3-Clause.html +EPL-2.0 - https://spdx.org/licenses/EPL-2.0.html MIT - https://opensource.org/licenses/MIT -MIT-0 - https://opensource.org/licenses/MIT-0 +MIT-0 - https://opensource.org/licenses/MIT-0 \ No newline at end of file diff --git a/README.md b/README.md index e715bc9..c927bb9 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Maintaining Personalized Experiences with Machine Learning -⚠️🚨⚠️ **Important: [The Maintaining Personalized Experiences with Machine Learning](https://aws.amazon.com/solutions/implementations/maintaining-personalized-experiences-with-ml/) solution will retire in October 2025. Deployments (via CloudFormation or GitHub) will remain operational, but customers will assume responsibility for maintenance and API-related updates after support ends. Customers can explore using [Amazon Personalize](https://aws.amazon.com/personalize/) to deliver hyper-personalized user experiences in real-time at scale to improve user engagement, customer loyalty, and business results.** ⚠️🚨⚠️ +⚠️🚨⚠️ __Important: [The Maintaining Personalized Experiences with Machine Learning](https://aws.amazon.com/solutions/implementations/maintaining-personalized-experiences-with-ml/) solution will retire in October 2025. Deployments (via CloudFormation or GitHub) will remain operational, but customers will assume responsibility for maintenance and API-related updates after support ends. Customers can explore using [Amazon Personalize](https://aws.amazon.com/personalize/) to deliver hyper-personalized user experiences in real-time at scale to improve user engagement, customer loyalty, and business results.__ ⚠️🚨⚠️ The Maintaining Personalized Experiences with Machine Learning solution provides a mechanism to automate much of the workflow around Amazon Personalize. This includes dataset group creation, dataset creation and import, solution diff --git a/deployment/run-unit-tests.sh b/deployment/run-unit-tests.sh index 303b5cc..92332f4 100644 --- a/deployment/run-unit-tests.sh +++ b/deployment/run-unit-tests.sh @@ -1,16 +1,6 @@ #!/bin/bash -# # 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. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for -# the specific language governing permissions and limitations under the License. -# +# SPDX-License-Identifier: Apache-2.0 # # This assumes all of the OS-level configuration has been completed and git repo has already been cloned diff --git a/source/aws_lambda/__init__.py b/source/aws_lambda/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/aws_lambda/__init__.py +++ b/source/aws_lambda/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/aws_lambda/create_batch_inference_job/__init__.py b/source/aws_lambda/create_batch_inference_job/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/aws_lambda/create_batch_inference_job/__init__.py +++ b/source/aws_lambda/create_batch_inference_job/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/aws_lambda/create_batch_inference_job/handler.py b/source/aws_lambda/create_batch_inference_job/handler.py index b16eec7..f1d0bbe 100644 --- a/source/aws_lambda/create_batch_inference_job/handler.py +++ b/source/aws_lambda/create_batch_inference_job/handler.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from typing import Dict, Any diff --git a/source/aws_lambda/create_batch_segment_job/__init__.py b/source/aws_lambda/create_batch_segment_job/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/aws_lambda/create_batch_segment_job/__init__.py +++ b/source/aws_lambda/create_batch_segment_job/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/aws_lambda/create_batch_segment_job/handler.py b/source/aws_lambda/create_batch_segment_job/handler.py index f2c30df..a905c7e 100644 --- a/source/aws_lambda/create_batch_segment_job/handler.py +++ b/source/aws_lambda/create_batch_segment_job/handler.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from typing import Dict, Any diff --git a/source/aws_lambda/create_campaign/__init__.py b/source/aws_lambda/create_campaign/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/aws_lambda/create_campaign/__init__.py +++ b/source/aws_lambda/create_campaign/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/aws_lambda/create_campaign/handler.py b/source/aws_lambda/create_campaign/handler.py index 3a5becd..22d1494 100644 --- a/source/aws_lambda/create_campaign/handler.py +++ b/source/aws_lambda/create_campaign/handler.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from typing import Dict, Any diff --git a/source/aws_lambda/create_config/__init__.py b/source/aws_lambda/create_config/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/aws_lambda/create_config/__init__.py +++ b/source/aws_lambda/create_config/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/aws_lambda/create_config/handler.py b/source/aws_lambda/create_config/handler.py index 6094f32..0cf6d1a 100644 --- a/source/aws_lambda/create_config/handler.py +++ b/source/aws_lambda/create_config/handler.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + import json import os diff --git a/source/aws_lambda/create_dataset/__init__.py b/source/aws_lambda/create_dataset/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/aws_lambda/create_dataset/__init__.py +++ b/source/aws_lambda/create_dataset/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/aws_lambda/create_dataset/handler.py b/source/aws_lambda/create_dataset/handler.py index 1f0f0b6..93fa97d 100644 --- a/source/aws_lambda/create_dataset/handler.py +++ b/source/aws_lambda/create_dataset/handler.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from typing import Dict, Any diff --git a/source/aws_lambda/create_dataset_group/__init__.py b/source/aws_lambda/create_dataset_group/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/aws_lambda/create_dataset_group/__init__.py +++ b/source/aws_lambda/create_dataset_group/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/aws_lambda/create_dataset_group/handler.py b/source/aws_lambda/create_dataset_group/handler.py index a76fafc..1120b1f 100644 --- a/source/aws_lambda/create_dataset_group/handler.py +++ b/source/aws_lambda/create_dataset_group/handler.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from typing import Dict, Any diff --git a/source/aws_lambda/create_dataset_import_job/__init__.py b/source/aws_lambda/create_dataset_import_job/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/aws_lambda/create_dataset_import_job/__init__.py +++ b/source/aws_lambda/create_dataset_import_job/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/aws_lambda/create_dataset_import_job/handler.py b/source/aws_lambda/create_dataset_import_job/handler.py index fa08fd1..55f1b1c 100644 --- a/source/aws_lambda/create_dataset_import_job/handler.py +++ b/source/aws_lambda/create_dataset_import_job/handler.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from typing import Dict, Any diff --git a/source/aws_lambda/create_event_tracker/__init__.py b/source/aws_lambda/create_event_tracker/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/aws_lambda/create_event_tracker/__init__.py +++ b/source/aws_lambda/create_event_tracker/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/aws_lambda/create_event_tracker/handler.py b/source/aws_lambda/create_event_tracker/handler.py index 76f23e3..44d4d01 100644 --- a/source/aws_lambda/create_event_tracker/handler.py +++ b/source/aws_lambda/create_event_tracker/handler.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from typing import Dict, Any diff --git a/source/aws_lambda/create_filter/__init__.py b/source/aws_lambda/create_filter/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/aws_lambda/create_filter/__init__.py +++ b/source/aws_lambda/create_filter/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/aws_lambda/create_filter/handler.py b/source/aws_lambda/create_filter/handler.py index 9a56a49..c3a5ba4 100644 --- a/source/aws_lambda/create_filter/handler.py +++ b/source/aws_lambda/create_filter/handler.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from typing import Dict, Any diff --git a/source/aws_lambda/create_recommender/__init__.py b/source/aws_lambda/create_recommender/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/aws_lambda/create_recommender/__init__.py +++ b/source/aws_lambda/create_recommender/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/aws_lambda/create_recommender/handler.py b/source/aws_lambda/create_recommender/handler.py index b61127f..b5c1a2d 100644 --- a/source/aws_lambda/create_recommender/handler.py +++ b/source/aws_lambda/create_recommender/handler.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from typing import Dict, Any diff --git a/source/aws_lambda/create_schema/__init__.py b/source/aws_lambda/create_schema/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/aws_lambda/create_schema/__init__.py +++ b/source/aws_lambda/create_schema/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/aws_lambda/create_schema/handler.py b/source/aws_lambda/create_schema/handler.py index b92d3ec..3a2bf80 100644 --- a/source/aws_lambda/create_schema/handler.py +++ b/source/aws_lambda/create_schema/handler.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from typing import Dict, Any diff --git a/source/aws_lambda/create_solution/__init__.py b/source/aws_lambda/create_solution/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/aws_lambda/create_solution/__init__.py +++ b/source/aws_lambda/create_solution/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/aws_lambda/create_solution/handler.py b/source/aws_lambda/create_solution/handler.py index d9816bd..28a12b9 100644 --- a/source/aws_lambda/create_solution/handler.py +++ b/source/aws_lambda/create_solution/handler.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from typing import Dict, Any diff --git a/source/aws_lambda/create_solution_version/__init__.py b/source/aws_lambda/create_solution_version/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/aws_lambda/create_solution_version/__init__.py +++ b/source/aws_lambda/create_solution_version/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/aws_lambda/create_solution_version/handler.py b/source/aws_lambda/create_solution_version/handler.py index 3388389..6c85ece 100644 --- a/source/aws_lambda/create_solution_version/handler.py +++ b/source/aws_lambda/create_solution_version/handler.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from typing import Dict, Any diff --git a/source/aws_lambda/create_timestamp/__init__.py b/source/aws_lambda/create_timestamp/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/aws_lambda/create_timestamp/__init__.py +++ b/source/aws_lambda/create_timestamp/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/aws_lambda/create_timestamp/handler.py b/source/aws_lambda/create_timestamp/handler.py index c92d0ca..a4b177a 100644 --- a/source/aws_lambda/create_timestamp/handler.py +++ b/source/aws_lambda/create_timestamp/handler.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import datetime from typing import Dict, Any diff --git a/source/aws_lambda/prepare_input/__init__.py b/source/aws_lambda/prepare_input/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/aws_lambda/prepare_input/__init__.py +++ b/source/aws_lambda/prepare_input/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/aws_lambda/prepare_input/handler.py b/source/aws_lambda/prepare_input/handler.py index 3b61252..40dd4eb 100644 --- a/source/aws_lambda/prepare_input/handler.py +++ b/source/aws_lambda/prepare_input/handler.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from typing import Dict, Any diff --git a/source/aws_lambda/s3_event/__init__.py b/source/aws_lambda/s3_event/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/aws_lambda/s3_event/__init__.py +++ b/source/aws_lambda/s3_event/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/aws_lambda/s3_event/handler.py b/source/aws_lambda/s3_event/handler.py index 9c21dfe..c04f7b2 100644 --- a/source/aws_lambda/s3_event/handler.py +++ b/source/aws_lambda/s3_event/handler.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + import json import os diff --git a/source/aws_lambda/shared/__init__.py b/source/aws_lambda/shared/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/aws_lambda/shared/__init__.py +++ b/source/aws_lambda/shared/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/aws_lambda/shared/date_helpers.py b/source/aws_lambda/shared/date_helpers.py index d154531..78026e3 100644 --- a/source/aws_lambda/shared/date_helpers.py +++ b/source/aws_lambda/shared/date_helpers.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import datetime diff --git a/source/aws_lambda/shared/events.py b/source/aws_lambda/shared/events.py index f899a27..8f614aa 100644 --- a/source/aws_lambda/shared/events.py +++ b/source/aws_lambda/shared/events.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from datetime import datetime from typing import Dict, Optional diff --git a/source/aws_lambda/shared/exceptions.py b/source/aws_lambda/shared/exceptions.py index 1b25d93..d8e3307 100644 --- a/source/aws_lambda/shared/exceptions.py +++ b/source/aws_lambda/shared/exceptions.py @@ -1,16 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### - +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 class ResourcePending(Exception): pass diff --git a/source/aws_lambda/shared/notifiers/__init__.py b/source/aws_lambda/shared/notifiers/__init__.py index ae5ed5c..072cef6 100644 --- a/source/aws_lambda/shared/notifiers/__init__.py +++ b/source/aws_lambda/shared/notifiers/__init__.py @@ -1,14 +1,4 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from shared.notifiers.notify_eventbridge import NotifyEventBridge diff --git a/source/aws_lambda/shared/notifiers/base.py b/source/aws_lambda/shared/notifiers/base.py index 08f529f..874eb95 100644 --- a/source/aws_lambda/shared/notifiers/base.py +++ b/source/aws_lambda/shared/notifiers/base.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from abc import ABC, abstractmethod from datetime import datetime diff --git a/source/aws_lambda/shared/notifiers/notify_eventbridge.py b/source/aws_lambda/shared/notifiers/notify_eventbridge.py index d87bbf1..e5af70a 100644 --- a/source/aws_lambda/shared/notifiers/notify_eventbridge.py +++ b/source/aws_lambda/shared/notifiers/notify_eventbridge.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + import json import os from typing import Dict diff --git a/source/aws_lambda/shared/personalize/__init__.py b/source/aws_lambda/shared/personalize/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/aws_lambda/shared/personalize/__init__.py +++ b/source/aws_lambda/shared/personalize/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/aws_lambda/shared/personalize/service_model.py b/source/aws_lambda/shared/personalize/service_model.py index 66cd0b4..5f2e0d6 100644 --- a/source/aws_lambda/shared/personalize/service_model.py +++ b/source/aws_lambda/shared/personalize/service_model.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from __future__ import annotations diff --git a/source/aws_lambda/shared/personalize_service.py b/source/aws_lambda/shared/personalize_service.py index 2aea466..041d8ba 100644 --- a/source/aws_lambda/shared/personalize_service.py +++ b/source/aws_lambda/shared/personalize_service.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + import json import re import time diff --git a/source/aws_lambda/shared/resource/__init__.py b/source/aws_lambda/shared/resource/__init__.py index 662ed40..6278bb7 100644 --- a/source/aws_lambda/shared/resource/__init__.py +++ b/source/aws_lambda/shared/resource/__init__.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from shared.resource.base import Resource from shared.resource.batch_inference_job import BatchInferenceJob diff --git a/source/aws_lambda/shared/resource/base.py b/source/aws_lambda/shared/resource/base.py index 741cf36..108a42f 100644 --- a/source/aws_lambda/shared/resource/base.py +++ b/source/aws_lambda/shared/resource/base.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from __future__ import annotations from typing import List diff --git a/source/aws_lambda/shared/resource/batch_inference_job.py b/source/aws_lambda/shared/resource/batch_inference_job.py index 2c58552..ae80bd0 100644 --- a/source/aws_lambda/shared/resource/batch_inference_job.py +++ b/source/aws_lambda/shared/resource/batch_inference_job.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from shared.resource.base import Resource diff --git a/source/aws_lambda/shared/resource/batch_segment_job.py b/source/aws_lambda/shared/resource/batch_segment_job.py index 2b32390..28c36cc 100644 --- a/source/aws_lambda/shared/resource/batch_segment_job.py +++ b/source/aws_lambda/shared/resource/batch_segment_job.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from shared.resource.base import Resource diff --git a/source/aws_lambda/shared/resource/campaign.py b/source/aws_lambda/shared/resource/campaign.py index cafeaf0..077b062 100644 --- a/source/aws_lambda/shared/resource/campaign.py +++ b/source/aws_lambda/shared/resource/campaign.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from shared.resource.base import Resource diff --git a/source/aws_lambda/shared/resource/dataset.py b/source/aws_lambda/shared/resource/dataset.py index f32cc46..04e2b21 100644 --- a/source/aws_lambda/shared/resource/dataset.py +++ b/source/aws_lambda/shared/resource/dataset.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from shared.resource.base import Resource from shared.resource.dataset_import_job import DatasetImportJob diff --git a/source/aws_lambda/shared/resource/dataset_group.py b/source/aws_lambda/shared/resource/dataset_group.py index a3c32bf..cba8d47 100644 --- a/source/aws_lambda/shared/resource/dataset_group.py +++ b/source/aws_lambda/shared/resource/dataset_group.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from shared.resource.base import Resource from shared.resource.dataset import Dataset from shared.resource.event_tracker import EventTracker diff --git a/source/aws_lambda/shared/resource/dataset_import_job.py b/source/aws_lambda/shared/resource/dataset_import_job.py index b9658de..40af7fb 100644 --- a/source/aws_lambda/shared/resource/dataset_import_job.py +++ b/source/aws_lambda/shared/resource/dataset_import_job.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from shared.resource.base import Resource diff --git a/source/aws_lambda/shared/resource/event_tracker.py b/source/aws_lambda/shared/resource/event_tracker.py index 68346af..c1f6028 100644 --- a/source/aws_lambda/shared/resource/event_tracker.py +++ b/source/aws_lambda/shared/resource/event_tracker.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from shared.resource.base import Resource diff --git a/source/aws_lambda/shared/resource/filter.py b/source/aws_lambda/shared/resource/filter.py index 3101bcc..3fe190b 100644 --- a/source/aws_lambda/shared/resource/filter.py +++ b/source/aws_lambda/shared/resource/filter.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from shared.resource.base import Resource diff --git a/source/aws_lambda/shared/resource/name.py b/source/aws_lambda/shared/resource/name.py index bf0ebd8..9707332 100644 --- a/source/aws_lambda/shared/resource/name.py +++ b/source/aws_lambda/shared/resource/name.py @@ -1,16 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### - +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 def camel_to_snake(s): """ diff --git a/source/aws_lambda/shared/resource/recommender.py b/source/aws_lambda/shared/resource/recommender.py index 12eab11..807fc4e 100644 --- a/source/aws_lambda/shared/resource/recommender.py +++ b/source/aws_lambda/shared/resource/recommender.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from shared.resource.base import Resource from shared.resource.batch_inference_job import BatchInferenceJob from shared.resource.batch_segment_job import BatchSegmentJob diff --git a/source/aws_lambda/shared/resource/schema.py b/source/aws_lambda/shared/resource/schema.py index 4b34b44..ee28727 100644 --- a/source/aws_lambda/shared/resource/schema.py +++ b/source/aws_lambda/shared/resource/schema.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from shared.resource import Resource diff --git a/source/aws_lambda/shared/resource/solution.py b/source/aws_lambda/shared/resource/solution.py index 1ba17b5..72ff6ae 100644 --- a/source/aws_lambda/shared/resource/solution.py +++ b/source/aws_lambda/shared/resource/solution.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from shared.resource.base import Resource from shared.resource.campaign import Campaign from shared.resource.solution_version import SolutionVersion diff --git a/source/aws_lambda/shared/resource/solution_version.py b/source/aws_lambda/shared/resource/solution_version.py index 230a9da..1f1ac49 100644 --- a/source/aws_lambda/shared/resource/solution_version.py +++ b/source/aws_lambda/shared/resource/solution_version.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from shared.resource.base import Resource from shared.resource.batch_inference_job import BatchInferenceJob from shared.resource.batch_segment_job import BatchSegmentJob diff --git a/source/aws_lambda/shared/s3.py b/source/aws_lambda/shared/s3.py index 44ece2a..abf0618 100644 --- a/source/aws_lambda/shared/s3.py +++ b/source/aws_lambda/shared/s3.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from functools import lru_cache from urllib.parse import urlparse diff --git a/source/aws_lambda/shared/sfn_middleware.py b/source/aws_lambda/shared/sfn_middleware.py index 245430a..4501b62 100644 --- a/source/aws_lambda/shared/sfn_middleware.py +++ b/source/aws_lambda/shared/sfn_middleware.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from __future__ import annotations import datetime diff --git a/source/aws_lambda/sns_notification/__init__.py b/source/aws_lambda/sns_notification/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/aws_lambda/sns_notification/__init__.py +++ b/source/aws_lambda/sns_notification/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/aws_lambda/sns_notification/handler.py b/source/aws_lambda/sns_notification/handler.py index d4bf2d2..7ecb69f 100644 --- a/source/aws_lambda/sns_notification/handler.py +++ b/source/aws_lambda/sns_notification/handler.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + import json import os from typing import Dict, Optional diff --git a/source/cdk_solution_helper_py/README.md b/source/cdk_solution_helper_py/README.md index c515abb..b158a5a 100644 --- a/source/cdk_solution_helper_py/README.md +++ b/source/cdk_solution_helper_py/README.md @@ -47,18 +47,8 @@ This might be a file called `app.py` in your CDK application directory ```python #!/usr/bin/env python3 -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import logging from pathlib import Path diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/__init__.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/__init__.py index fe3555a..91dd534 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/__init__.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/__init__.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from pathlib import Path diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aspects.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aspects.py index 29f0fec..cf6a6a1 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aspects.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aspects.py @@ -1,15 +1,6 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + import jsii from aws_cdk import CfnCondition, IAspect from constructs import IConstruct diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/__init__.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/__init__.py index 330623f..04f8b7b 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/__init__.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/__init__.py @@ -1,12 +1,2 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/__init__.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/__init__.py index 330623f..04f8b7b 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/__init__.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/__init__.py @@ -1,12 +1,2 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_hash/__init__.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_hash/__init__.py index 2895559..710c69a 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_hash/__init__.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_hash/__init__.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from aws_solutions.cdk.aws_lambda.cfn_custom_resources.resource_hash.hash import ( ResourceHash, diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_hash/hash.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_hash/hash.py index 87c3bf6..f0f51dd 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_hash/hash.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_hash/hash.py @@ -1,15 +1,6 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from pathlib import Path from aws_cdk import ( diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_hash/src/__init__.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_hash/src/__init__.py index 330623f..04f8b7b 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_hash/src/__init__.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_hash/src/__init__.py @@ -1,12 +1,2 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_hash/src/custom_resources/__init__.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_hash/src/custom_resources/__init__.py index 330623f..04f8b7b 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_hash/src/custom_resources/__init__.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_hash/src/custom_resources/__init__.py @@ -1,12 +1,2 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_hash/src/custom_resources/hash.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_hash/src/custom_resources/hash.py index 8921845..3c44f6e 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_hash/src/custom_resources/hash.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_hash/src/custom_resources/hash.py @@ -1,15 +1,6 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + import logging from hashlib import md5 from os import getenv diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_name/__init__.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_name/__init__.py index 0667198..1d6d92e 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_name/__init__.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_name/__init__.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from aws_solutions.cdk.aws_lambda.cfn_custom_resources.resource_name.name import ( ResourceName, diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_name/name.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_name/name.py index eca0cab..b55e7a3 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_name/name.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_name/name.py @@ -1,15 +1,6 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from pathlib import Path from typing import Optional diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_name/src/__init__.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_name/src/__init__.py index 330623f..04f8b7b 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_name/src/__init__.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_name/src/__init__.py @@ -1,12 +1,2 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_name/src/custom_resources/__init__.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_name/src/custom_resources/__init__.py index 330623f..04f8b7b 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_name/src/custom_resources/__init__.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_name/src/custom_resources/__init__.py @@ -1,12 +1,2 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_name/src/custom_resources/name.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_name/src/custom_resources/name.py index bfc802e..8204db8 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_name/src/custom_resources/name.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/resource_name/src/custom_resources/name.py @@ -1,15 +1,6 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + import logging from os import getenv from uuid import uuid4 as uuid diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/solutions_metrics/__init__.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/solutions_metrics/__init__.py index f9dba6b..63de637 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/solutions_metrics/__init__.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/solutions_metrics/__init__.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from aws_solutions.cdk.aws_lambda.cfn_custom_resources.solutions_metrics.metrics import ( Metrics, diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/solutions_metrics/metrics.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/solutions_metrics/metrics.py index 2de6089..21be76a 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/solutions_metrics/metrics.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/solutions_metrics/metrics.py @@ -1,15 +1,6 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from pathlib import Path from typing import Dict diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/solutions_metrics/src/__init__.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/solutions_metrics/src/__init__.py index 330623f..04f8b7b 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/solutions_metrics/src/__init__.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/solutions_metrics/src/__init__.py @@ -1,12 +1,2 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/solutions_metrics/src/custom_resources/__init__.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/solutions_metrics/src/custom_resources/__init__.py index 330623f..04f8b7b 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/solutions_metrics/src/custom_resources/__init__.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/solutions_metrics/src/custom_resources/__init__.py @@ -1,12 +1,2 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/solutions_metrics/src/custom_resources/metrics.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/solutions_metrics/src/custom_resources/metrics.py index 9d046f4..20ce27b 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/solutions_metrics/src/custom_resources/metrics.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/cfn_custom_resources/solutions_metrics/src/custom_resources/metrics.py @@ -1,16 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### - +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import logging import uuid diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/environment.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/environment.py index 66f88a1..7e029b9 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/environment.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/environment.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from dataclasses import dataclass, field diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/environment_variable.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/environment_variable.py index 9a360d5..fa8178d 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/environment_variable.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/environment_variable.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from dataclasses import dataclass, field diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/java/__init__.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/java/__init__.py index 330623f..04f8b7b 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/java/__init__.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/java/__init__.py @@ -1,12 +1,2 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/java/bundling.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/java/bundling.py index e151cd7..e0b5a8f 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/java/bundling.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/java/bundling.py @@ -1,15 +1,6 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + import logging import shutil import subprocess diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/java/function.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/java/function.py index 3fc5041..f6b03fe 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/java/function.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/java/function.py @@ -1,15 +1,6 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from pathlib import Path from typing import Optional diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/layers/__init__.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/layers/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/layers/__init__.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/layers/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/layers/aws_lambda_powertools/__init__.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/layers/aws_lambda_powertools/__init__.py index 8b086e5..b70fb2f 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/layers/aws_lambda_powertools/__init__.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/layers/aws_lambda_powertools/__init__.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from aws_solutions.cdk.aws_lambda.layers.aws_lambda_powertools.layer import ( PowertoolsLayer, diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/layers/aws_lambda_powertools/layer.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/layers/aws_lambda_powertools/layer.py index f5ad9d0..89f2974 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/layers/aws_lambda_powertools/layer.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/layers/aws_lambda_powertools/layer.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from pathlib import Path diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/python/__init__.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/python/__init__.py index 330623f..04f8b7b 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/python/__init__.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/python/__init__.py @@ -1,12 +1,2 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/python/bundling.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/python/bundling.py index d5d1786..abe5a3d 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/python/bundling.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/python/bundling.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import importlib.util import logging diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/python/function.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/python/function.py index acad14e..b066526 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/python/function.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/python/function.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from pathlib import Path from typing import List, Union diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/python/hash_utils.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/python/hash_utils.py index a612320..f35de7a 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/python/hash_utils.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/python/hash_utils.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import hashlib import os diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/python/layer.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/python/layer.py index a67623c..ef02d2d 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/python/layer.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/aws_lambda/python/layer.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from pathlib import Path from typing import Union, List diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/cfn_nag.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/cfn_nag.py index 156c128..2745457 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/cfn_nag.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/cfn_nag.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from dataclasses import dataclass from typing import List diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/context.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/context.py index a7d728a..8c4f087 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/context.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/context.py @@ -1,16 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### - +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import json import logging diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/helpers/__init__.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/helpers/__init__.py index bae5553..9b054cd 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/helpers/__init__.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/helpers/__init__.py @@ -1,14 +1,4 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from aws_solutions.cdk.helpers.copytree import copytree, ignore_globs diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/helpers/copytree.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/helpers/copytree.py index 25987e5..3826120 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/helpers/copytree.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/helpers/copytree.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import os import shutil diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/helpers/loader.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/helpers/loader.py index 6a12128..d298504 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/helpers/loader.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/helpers/loader.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import importlib import json diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/helpers/logger.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/helpers/logger.py index 5351235..ab94838 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/helpers/logger.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/helpers/logger.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import logging diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/interfaces.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/interfaces.py index 5834c88..6ad7a94 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/interfaces.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/interfaces.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import logging from dataclasses import dataclass diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/mappings.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/mappings.py index 30bea37..acb8301 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/mappings.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/mappings.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from aws_cdk import CfnMapping from constructs import Construct @@ -35,7 +25,6 @@ def __init__( "Version": "%%SOLUTION_VERSION%%", "SendAnonymousUsageData": "Yes" if send_anonymous_usage_data else "No", "SolutionName": "%%SOLUTION_NAME%%", - "AppRegistryName": "%%APP_REGISTRY_NAME%%", "ApplicationType": "AWS-Solutions", } }, diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/scripts/__init__.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/scripts/__init__.py index 330623f..04f8b7b 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/scripts/__init__.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/scripts/__init__.py @@ -1,12 +1,2 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/scripts/build_s3_cdk_dist.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/scripts/build_s3_cdk_dist.py index 0f016a5..e644dfc 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/scripts/build_s3_cdk_dist.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/scripts/build_s3_cdk_dist.py @@ -1,17 +1,7 @@ #!/usr/bin/env python3 -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import os import re diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/stack.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/stack.py index 2d5e7c2..b365d2d 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/stack.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/stack.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from __future__ import annotations diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/stepfunctions/__init__.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/stepfunctions/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/stepfunctions/__init__.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/stepfunctions/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/stepfunctions/solution_fragment.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/stepfunctions/solution_fragment.py index 225f32b..d20a9b0 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/stepfunctions/solution_fragment.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/stepfunctions/solution_fragment.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Dict from typing import Optional diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/stepfunctions/solutionstep.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/stepfunctions/solutionstep.py index 244dc2c..099ac66 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/stepfunctions/solutionstep.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/stepfunctions/solutionstep.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from pathlib import Path from typing import Optional, List diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/synthesizers.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/synthesizers.py index 13b7cd5..e446756 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/synthesizers.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/synthesizers.py @@ -1,15 +1,6 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + import json import logging import os @@ -19,7 +10,7 @@ from dataclasses import dataclass, field from fileinput import FileInput from pathlib import Path -from typing import Dict, List, Tuple, Iterable +from typing import Dict, Iterable, List, Tuple import jsii from aws_cdk import DefaultStackSynthesizer, IStackSynthesizer, ISynthesisSession @@ -188,48 +179,6 @@ def patch_lambda(self): # add resource to the list of regional assets self.assets_regional.append(archive_path) - def patch_app_reg(self): - """Patch the App Registry Info""" - for resource_name, resource in self.contents.get("Resources", {}).items(): - resource_type = resource.get("Type") - if resource_type == "AWS::ApplicationInsights::Application": - logger.info(f"{resource_name} ({resource_type}) patching") - - # update CloudFormation resource properties for ServiceCatalogAppRegistry - # fmt: off - resource["Properties"]["ResourceGroupName"] = { - "Fn::Join": [ # NOSONAR (python:S1192) - string for clarity - "-", - [ - "AWS_AppRegistry_Application", - {"Ref": "AWS::StackName"}, - { - "Fn::FindInMap": ["Solution", "Data", "AppRegistryName"] # NOSONAR (python:S1192) - string for clarity - } - ], - ] - } - # fmt: on - - if resource_type == "AWS::ServiceCatalogAppRegistry::Application": - logger.info(f"{resource_name} ({resource_type}) patching") - - # update CloudFormation resource properties for ServiceCatalogAppRegistry - # fmt: off - resource["Properties"]["Name"] = { - "Fn::Join": [ # NOSONAR (python:S1192) - string for clarity - "-", - [ - "App", - {"Ref": "AWS::StackName"}, - { - "Fn::FindInMap": ["Solution", "Data", "AppRegistryName"] # NOSONAR (python:S1192) - string for clarity - }, - ], - ] - } - # fmt: on - def _build_asset_path(self, asset_path): asset_output_path = self.cloud_assembly_path.joinpath(asset_path) asset_output_path.mkdir(parents=True, exist_ok=True) @@ -264,10 +213,10 @@ class SolutionStackSubstitutions(DefaultStackSynthesizer): def _template_names(self, session: ISynthesisSession) -> List[Path]: assembly_output_path = Path(session.assembly.outdir) - templates = [assembly_output_path.joinpath(self._stack.template_file)] + templates = [assembly_output_path.joinpath(self._bound_stack.template_file)] # add this stack's children to the outputs to process (todo: this only works for singly-nested stacks) - for child in self._stack.node.children: + for child in self._bound_stack.node.children: child_template = getattr(child, "template_file", None) if child_template: templates.append(assembly_output_path.joinpath(child_template)) @@ -276,9 +225,11 @@ def _template_names(self, session: ISynthesisSession) -> List[Path]: def _templates(self, session: ISynthesisSession) -> Iterable[Tuple[Path, Dict]]: assembly_output_path = Path(session.assembly.outdir) assets = {} - + try: - assets = json.loads(next(assembly_output_path.glob(self._stack.stack_name + "*.assets.json")).read_text()) + assets = json.loads( + next(assembly_output_path.glob(self._bound_stack.stack_name + "*.assets.json")).read_text() + ) except StopIteration: pass # use the default (no assets) @@ -290,8 +241,8 @@ def synthesize(self, session: ISynthesisSession): # when called from python directly, this outputs to a temporary directory result = DefaultStackSynthesizer.synthesize(self, session) - asset_path_regional = self._stack.node.try_get_context("SOLUTIONS_ASSETS_REGIONAL") - asset_path_global = self._stack.node.try_get_context("SOLUTIONS_ASSETS_GLOBAL") + asset_path_regional = self._bound_stack.node.try_get_context("SOLUTIONS_ASSETS_REGIONAL") + asset_path_global = self._bound_stack.node.try_get_context("SOLUTIONS_ASSETS_GLOBAL") logger.info(f"solutions parameter substitution in {session.assembly.outdir} started") for template in self._template_names(session): @@ -301,7 +252,7 @@ def synthesize(self, session: ISynthesisSession): # handle all template substitutions in the line for match in SolutionStackSubstitutions.substitution_re.findall(line): placeholder = match.replace("%", "") - replacement = self._stack.node.try_get_context(placeholder) + replacement = self._bound_stack.node.try_get_context(placeholder) if not replacement: raise ValueError( f"Please provide a parameter substitution for {placeholder} via environment variable or CDK context" @@ -321,7 +272,6 @@ def synthesize(self, session: ISynthesisSession): for template in self._templates(session): template.patch_lambda() template.patch_nested() - template.patch_app_reg() template.delete_bootstrap_parameters() template.delete_cdk_helpers() diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/tools/__init__.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/tools/__init__.py index fa96974..3dd0c17 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/tools/__init__.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/tools/__init__.py @@ -1,14 +1,4 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from aws_solutions.cdk.tools.cleaner import Cleaner diff --git a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/tools/cleaner.py b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/tools/cleaner.py index 6248cde..0357cdf 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/tools/cleaner.py +++ b/source/cdk_solution_helper_py/helpers_cdk/aws_solutions/cdk/tools/cleaner.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import logging import os diff --git a/source/cdk_solution_helper_py/helpers_cdk/setup.py b/source/cdk_solution_helper_py/helpers_cdk/setup.py index 4af645b..9136728 100644 --- a/source/cdk_solution_helper_py/helpers_cdk/setup.py +++ b/source/cdk_solution_helper_py/helpers_cdk/setup.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import re from pathlib import Path diff --git a/source/cdk_solution_helper_py/helpers_common/aws_solutions/core/__init__.py b/source/cdk_solution_helper_py/helpers_common/aws_solutions/core/__init__.py index a608fb6..85de4c6 100644 --- a/source/cdk_solution_helper_py/helpers_common/aws_solutions/core/__init__.py +++ b/source/cdk_solution_helper_py/helpers_common/aws_solutions/core/__init__.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from aws_solutions.core.config import Config diff --git a/source/cdk_solution_helper_py/helpers_common/aws_solutions/core/config.py b/source/cdk_solution_helper_py/helpers_common/aws_solutions/core/config.py index 7349c48..cd51919 100644 --- a/source/cdk_solution_helper_py/helpers_common/aws_solutions/core/config.py +++ b/source/cdk_solution_helper_py/helpers_common/aws_solutions/core/config.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import os import re diff --git a/source/cdk_solution_helper_py/helpers_common/aws_solutions/core/helpers.py b/source/cdk_solution_helper_py/helpers_common/aws_solutions/core/helpers.py index b4c5ac7..c05885a 100644 --- a/source/cdk_solution_helper_py/helpers_common/aws_solutions/core/helpers.py +++ b/source/cdk_solution_helper_py/helpers_common/aws_solutions/core/helpers.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import os diff --git a/source/cdk_solution_helper_py/helpers_common/aws_solutions/core/logging.py b/source/cdk_solution_helper_py/helpers_common/aws_solutions/core/logging.py index 269ce90..b151af5 100644 --- a/source/cdk_solution_helper_py/helpers_common/aws_solutions/core/logging.py +++ b/source/cdk_solution_helper_py/helpers_common/aws_solutions/core/logging.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import logging import os diff --git a/source/cdk_solution_helper_py/helpers_common/setup.py b/source/cdk_solution_helper_py/helpers_common/setup.py index f28cfb4..400139c 100644 --- a/source/cdk_solution_helper_py/helpers_common/setup.py +++ b/source/cdk_solution_helper_py/helpers_common/setup.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import re from pathlib import Path diff --git a/source/cdk_solution_helper_py/requirements-dev.txt b/source/cdk_solution_helper_py/requirements-dev.txt index 8a304e7..4a52aae 100644 --- a/source/cdk_solution_helper_py/requirements-dev.txt +++ b/source/cdk_solution_helper_py/requirements-dev.txt @@ -1,5 +1,4 @@ aws_cdk_lib==2.88.0 -aws-cdk.aws-servicecatalogappregistry-alpha==2.88.0a0 black boto3==1.26.47 requests==2.32.4 diff --git a/source/infrastructure/__init__.py b/source/infrastructure/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/infrastructure/__init__.py +++ b/source/infrastructure/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/infrastructure/aspects/__init__.py b/source/infrastructure/aspects/__init__.py deleted file mode 100644 index 330623f..0000000 --- a/source/infrastructure/aspects/__init__.py +++ /dev/null @@ -1,12 +0,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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### diff --git a/source/infrastructure/aspects/app_registry.py b/source/infrastructure/aspects/app_registry.py deleted file mode 100644 index 2d9d61c..0000000 --- a/source/infrastructure/aspects/app_registry.py +++ /dev/null @@ -1,96 +0,0 @@ -#!/usr/bin/env python3 - -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### - -import jsii - -import aws_cdk as cdk -from aws_cdk import aws_servicecatalogappregistry_alpha as appreg - -from constructs import Construct, IConstruct - - -@jsii.implements(cdk.IAspect) -class AppRegistry(Construct): - """This construct creates the resources required for AppRegistry and injects them as Aspects""" - - def __init__(self, scope: Construct, id: str): - super().__init__(scope, id) - self.solution_name = scope.node.try_get_context("SOLUTION_NAME") - self.app_registry_name = scope.node.try_get_context("APP_REGISTRY_NAME") - self.solution_id = scope.node.try_get_context("SOLUTION_ID") - self.solution_version = scope.node.try_get_context("SOLUTION_VERSION") - self.application_type = scope.node.try_get_context("APPLICATION_TYPE") - self.application: appreg.Application = None - - def visit(self, node: IConstruct) -> None: - """The visitor method invoked during cdk synthesis""" - if isinstance(node, cdk.Stack): - if not node.nested: - # parent stack - stack: cdk.Stack = node - self.__create_app_for_app_registry() - self.application.associate_application_with_stack(stack) - self.__create_atttribute_group() - self.__add_tags_for_application() - else: - # nested stack - if not self.application: - self.__create_app_for_app_registry() - - self.application.associate_application_with_stack(node) - - def __create_app_for_app_registry(self) -> None: - """Method to create an AppRegistry Application""" - self.application = appreg.Application( - self, - "RegistrySetup", - application_name=cdk.Fn.join( - "-", ["App", cdk.Aws.STACK_NAME, self.app_registry_name, cdk.Aws.REGION, cdk.Aws.ACCOUNT_ID] - ), - description=f"Service Catalog application to track and manage all your resources for the solution {self.solution_name}", - ) - - def __add_tags_for_application(self) -> None: - """Method to add tags to the AppRegistry's Application instance""" - if not self.application: - self.__create_app_for_app_registry() - - cdk.Tags.of(self.application).add("Solutions:SolutionID", self.solution_id) - cdk.Tags.of(self.application).add("Solutions:SolutionName", self.solution_name) - cdk.Tags.of(self.application).add("Solutions:SolutionVersion", self.solution_version) - cdk.Tags.of(self.application).add("Solutions:ApplicationType", self.application_type) - - def __create_atttribute_group(self) -> None: - """Method to add attributes to be as associated with the Application's instance in AppRegistry""" - if not self.application: - self.__create_app_for_app_registry() - - # The AttributeGroup.associate_with takes 2 params. First is Attribute Group, second is application. - # The method signature unclear in official documentation. - appreg.AttributeGroup.associate_with( - appreg.AttributeGroup( - self, - "AppAttributes", - attribute_group_name=f"AttrGrp-{cdk.Aws.STACK_NAME}", - description="Attributes for Solutions Metadata", - attributes={ - "applicationType": self.application_type, - "version": self.solution_version, - "solutionID": self.solution_id, - "solutionName": self.solution_name, - }, - ) - , self.application - ) diff --git a/source/infrastructure/cdk.json b/source/infrastructure/cdk.json index 1e568fd..81d40a0 100644 --- a/source/infrastructure/cdk.json +++ b/source/infrastructure/cdk.json @@ -3,8 +3,7 @@ "context": { "SOLUTION_NAME": "Maintaining Personalized Experiences with Machine Learning", "SOLUTION_ID": "SO0170", - "SOLUTION_VERSION": "v1.4.5", - "APP_REGISTRY_NAME": "personalized-experiences-ML", + "SOLUTION_VERSION": "v1.5.0", "APPLICATION_TYPE": "AWS-Solutions", "@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy": true } diff --git a/source/infrastructure/deploy.py b/source/infrastructure/deploy.py index 5f9e98e..7a7858f 100644 --- a/source/infrastructure/deploy.py +++ b/source/infrastructure/deploy.py @@ -1,28 +1,15 @@ #!/usr/bin/env python3 -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import logging from pathlib import Path import aws_cdk as cdk -from aspects.app_registry import AppRegistry from aws_solutions.cdk import CDKSolution +from cdk_nag import AwsSolutionsChecks, NagPackSuppression, NagSuppressions from personalize.stack import PersonalizeStack -from cdk_nag import AwsSolutionsChecks -from cdk_nag import NagSuppressions -from cdk_nag import NagPackSuppression logger = logging.getLogger("cdk-helper") solution = CDKSolution(cdk_json_path=Path(__file__).parent.absolute() / "cdk.json") @@ -41,16 +28,16 @@ def build_app(context): template_filename="maintaining-personalized-experiences-with-machine-learning.template", synthesizer=solution.synthesizer, ) - - cdk.Aspects.of(app).add(AppRegistry(stack, "AppRegistryAspect")) cdk.Aspects.of(app).add(AwsSolutionsChecks(verbose=True)) - NagSuppressions.add_stack_suppressions(stack, - [ - NagPackSuppression(id='AwsSolutions-L1', - reason='Python lambda runtime is planned to be ' - 'upgraded in future release.') - ]) + NagSuppressions.add_stack_suppressions( + stack, + [ + NagPackSuppression( + id="AwsSolutions-L1", reason="Python lambda runtime is maintained at version 3.11 as a stable version." + ) + ], + ) return app.synth() diff --git a/source/infrastructure/personalize/__init__.py b/source/infrastructure/personalize/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/infrastructure/personalize/__init__.py +++ b/source/infrastructure/personalize/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/infrastructure/personalize/aws_lambda/__init__.py b/source/infrastructure/personalize/aws_lambda/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/infrastructure/personalize/aws_lambda/__init__.py +++ b/source/infrastructure/personalize/aws_lambda/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/infrastructure/personalize/aws_lambda/functions/__init__.py b/source/infrastructure/personalize/aws_lambda/functions/__init__.py index 6db50b3..1c4d4cb 100644 --- a/source/infrastructure/personalize/aws_lambda/functions/__init__.py +++ b/source/infrastructure/personalize/aws_lambda/functions/__init__.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from personalize.aws_lambda.functions.create_batch_inference_job import ( CreateBatchInferenceJob, diff --git a/source/infrastructure/personalize/aws_lambda/functions/create_batch_inference_job.py b/source/infrastructure/personalize/aws_lambda/functions/create_batch_inference_job.py index f2ddcac..cb35636 100644 --- a/source/infrastructure/personalize/aws_lambda/functions/create_batch_inference_job.py +++ b/source/infrastructure/personalize/aws_lambda/functions/create_batch_inference_job.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from pathlib import Path import aws_cdk.aws_iam as iam diff --git a/source/infrastructure/personalize/aws_lambda/functions/create_batch_segment_job.py b/source/infrastructure/personalize/aws_lambda/functions/create_batch_segment_job.py index 39f1f80..6612fb4 100644 --- a/source/infrastructure/personalize/aws_lambda/functions/create_batch_segment_job.py +++ b/source/infrastructure/personalize/aws_lambda/functions/create_batch_segment_job.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from pathlib import Path import aws_cdk.aws_iam as iam diff --git a/source/infrastructure/personalize/aws_lambda/functions/create_campaign.py b/source/infrastructure/personalize/aws_lambda/functions/create_campaign.py index 89c1fe0..345a0f0 100644 --- a/source/infrastructure/personalize/aws_lambda/functions/create_campaign.py +++ b/source/infrastructure/personalize/aws_lambda/functions/create_campaign.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from pathlib import Path import aws_cdk.aws_iam as iam diff --git a/source/infrastructure/personalize/aws_lambda/functions/create_config.py b/source/infrastructure/personalize/aws_lambda/functions/create_config.py index be13a19..caa0158 100644 --- a/source/infrastructure/personalize/aws_lambda/functions/create_config.py +++ b/source/infrastructure/personalize/aws_lambda/functions/create_config.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from pathlib import Path diff --git a/source/infrastructure/personalize/aws_lambda/functions/create_dataset.py b/source/infrastructure/personalize/aws_lambda/functions/create_dataset.py index 17b3b24..a5d053d 100644 --- a/source/infrastructure/personalize/aws_lambda/functions/create_dataset.py +++ b/source/infrastructure/personalize/aws_lambda/functions/create_dataset.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from pathlib import Path from typing import Optional diff --git a/source/infrastructure/personalize/aws_lambda/functions/create_dataset_group.py b/source/infrastructure/personalize/aws_lambda/functions/create_dataset_group.py index 38fc1a0..7a70980 100644 --- a/source/infrastructure/personalize/aws_lambda/functions/create_dataset_group.py +++ b/source/infrastructure/personalize/aws_lambda/functions/create_dataset_group.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from pathlib import Path from typing import Optional diff --git a/source/infrastructure/personalize/aws_lambda/functions/create_dataset_import_job.py b/source/infrastructure/personalize/aws_lambda/functions/create_dataset_import_job.py index 72255e7..af052db 100644 --- a/source/infrastructure/personalize/aws_lambda/functions/create_dataset_import_job.py +++ b/source/infrastructure/personalize/aws_lambda/functions/create_dataset_import_job.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from pathlib import Path from typing import Optional diff --git a/source/infrastructure/personalize/aws_lambda/functions/create_event_tracker.py b/source/infrastructure/personalize/aws_lambda/functions/create_event_tracker.py index ac40bf4..b9b007e 100644 --- a/source/infrastructure/personalize/aws_lambda/functions/create_event_tracker.py +++ b/source/infrastructure/personalize/aws_lambda/functions/create_event_tracker.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from pathlib import Path from typing import Optional diff --git a/source/infrastructure/personalize/aws_lambda/functions/create_filter.py b/source/infrastructure/personalize/aws_lambda/functions/create_filter.py index 313d9d9..b53200c 100644 --- a/source/infrastructure/personalize/aws_lambda/functions/create_filter.py +++ b/source/infrastructure/personalize/aws_lambda/functions/create_filter.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from pathlib import Path from typing import Optional diff --git a/source/infrastructure/personalize/aws_lambda/functions/create_recommender.py b/source/infrastructure/personalize/aws_lambda/functions/create_recommender.py index b5796ba..1173a35 100644 --- a/source/infrastructure/personalize/aws_lambda/functions/create_recommender.py +++ b/source/infrastructure/personalize/aws_lambda/functions/create_recommender.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from pathlib import Path import aws_cdk.aws_iam as iam diff --git a/source/infrastructure/personalize/aws_lambda/functions/create_scheduled_task.py b/source/infrastructure/personalize/aws_lambda/functions/create_scheduled_task.py index 2a6c8f3..45881aa 100644 --- a/source/infrastructure/personalize/aws_lambda/functions/create_scheduled_task.py +++ b/source/infrastructure/personalize/aws_lambda/functions/create_scheduled_task.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from pathlib import Path from constructs import Construct diff --git a/source/infrastructure/personalize/aws_lambda/functions/create_schema.py b/source/infrastructure/personalize/aws_lambda/functions/create_schema.py index 5bd7286..4b3ac52 100644 --- a/source/infrastructure/personalize/aws_lambda/functions/create_schema.py +++ b/source/infrastructure/personalize/aws_lambda/functions/create_schema.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from pathlib import Path from typing import Optional diff --git a/source/infrastructure/personalize/aws_lambda/functions/create_solution.py b/source/infrastructure/personalize/aws_lambda/functions/create_solution.py index 065ccae..131721c 100644 --- a/source/infrastructure/personalize/aws_lambda/functions/create_solution.py +++ b/source/infrastructure/personalize/aws_lambda/functions/create_solution.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from pathlib import Path import aws_cdk.aws_iam as iam diff --git a/source/infrastructure/personalize/aws_lambda/functions/create_solution_version.py b/source/infrastructure/personalize/aws_lambda/functions/create_solution_version.py index ce0c57e..243f2fc 100644 --- a/source/infrastructure/personalize/aws_lambda/functions/create_solution_version.py +++ b/source/infrastructure/personalize/aws_lambda/functions/create_solution_version.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from pathlib import Path import aws_cdk.aws_iam as iam diff --git a/source/infrastructure/personalize/aws_lambda/functions/create_timestamp.py b/source/infrastructure/personalize/aws_lambda/functions/create_timestamp.py index 1649096..1ee3ad1 100644 --- a/source/infrastructure/personalize/aws_lambda/functions/create_timestamp.py +++ b/source/infrastructure/personalize/aws_lambda/functions/create_timestamp.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from pathlib import Path from constructs import Construct diff --git a/source/infrastructure/personalize/aws_lambda/functions/environment.py b/source/infrastructure/personalize/aws_lambda/functions/environment.py index 66f88a1..7e029b9 100644 --- a/source/infrastructure/personalize/aws_lambda/functions/environment.py +++ b/source/infrastructure/personalize/aws_lambda/functions/environment.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from dataclasses import dataclass, field diff --git a/source/infrastructure/personalize/aws_lambda/functions/prepare_input.py b/source/infrastructure/personalize/aws_lambda/functions/prepare_input.py index 95d3b5f..1212a81 100644 --- a/source/infrastructure/personalize/aws_lambda/functions/prepare_input.py +++ b/source/infrastructure/personalize/aws_lambda/functions/prepare_input.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from pathlib import Path diff --git a/source/infrastructure/personalize/aws_lambda/functions/s3_event.py b/source/infrastructure/personalize/aws_lambda/functions/s3_event.py index b2b99e5..3abc742 100644 --- a/source/infrastructure/personalize/aws_lambda/functions/s3_event.py +++ b/source/infrastructure/personalize/aws_lambda/functions/s3_event.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from pathlib import Path diff --git a/source/infrastructure/personalize/aws_lambda/layers/__init__.py b/source/infrastructure/personalize/aws_lambda/layers/__init__.py index 0e77372..2b4ea4d 100644 --- a/source/infrastructure/personalize/aws_lambda/layers/__init__.py +++ b/source/infrastructure/personalize/aws_lambda/layers/__init__.py @@ -1,14 +1,4 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from personalize.aws_lambda.layers.aws_solutions.layer import SolutionsLayer diff --git a/source/infrastructure/personalize/aws_lambda/layers/aws_solutions/__init__.py b/source/infrastructure/personalize/aws_lambda/layers/aws_solutions/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/infrastructure/personalize/aws_lambda/layers/aws_solutions/__init__.py +++ b/source/infrastructure/personalize/aws_lambda/layers/aws_solutions/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/infrastructure/personalize/aws_lambda/layers/aws_solutions/layer.py b/source/infrastructure/personalize/aws_lambda/layers/aws_solutions/layer.py index 2778d7d..5c69474 100644 --- a/source/infrastructure/personalize/aws_lambda/layers/aws_solutions/layer.py +++ b/source/infrastructure/personalize/aws_lambda/layers/aws_solutions/layer.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from pathlib import Path diff --git a/source/infrastructure/personalize/cloudwatch/__init__.py b/source/infrastructure/personalize/cloudwatch/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/infrastructure/personalize/cloudwatch/__init__.py +++ b/source/infrastructure/personalize/cloudwatch/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/infrastructure/personalize/cloudwatch/dashboard.py b/source/infrastructure/personalize/cloudwatch/dashboard.py index 63c0f3a..6e1517a 100644 --- a/source/infrastructure/personalize/cloudwatch/dashboard.py +++ b/source/infrastructure/personalize/cloudwatch/dashboard.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from typing import Optional import aws_cdk.aws_cloudwatch as cw diff --git a/source/infrastructure/personalize/s3/__init__.py b/source/infrastructure/personalize/s3/__init__.py index 2b3ca6e..961cd3c 100644 --- a/source/infrastructure/personalize/s3/__init__.py +++ b/source/infrastructure/personalize/s3/__init__.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from personalize.s3.access_logs_bucket import AccessLogsBucket from personalize.s3.data_bucket import DataBucket diff --git a/source/infrastructure/personalize/s3/access_logs_bucket.py b/source/infrastructure/personalize/s3/access_logs_bucket.py index 2533325..af76946 100644 --- a/source/infrastructure/personalize/s3/access_logs_bucket.py +++ b/source/infrastructure/personalize/s3/access_logs_bucket.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from personalize.s3.utils import SecureBucket diff --git a/source/infrastructure/personalize/s3/data_bucket.py b/source/infrastructure/personalize/s3/data_bucket.py index c38f799..be35333 100644 --- a/source/infrastructure/personalize/s3/data_bucket.py +++ b/source/infrastructure/personalize/s3/data_bucket.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from personalize.s3.utils import SecureBucket diff --git a/source/infrastructure/personalize/s3/utils.py b/source/infrastructure/personalize/s3/utils.py index d9ad398..61961d8 100644 --- a/source/infrastructure/personalize/s3/utils.py +++ b/source/infrastructure/personalize/s3/utils.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import logging from typing import List diff --git a/source/infrastructure/personalize/sns/__init__.py b/source/infrastructure/personalize/sns/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/infrastructure/personalize/sns/__init__.py +++ b/source/infrastructure/personalize/sns/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/infrastructure/personalize/sns/notifications.py b/source/infrastructure/personalize/sns/notifications.py index d65520f..930c287 100644 --- a/source/infrastructure/personalize/sns/notifications.py +++ b/source/infrastructure/personalize/sns/notifications.py @@ -1,15 +1,6 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from pathlib import Path from typing import Optional diff --git a/source/infrastructure/personalize/stack.py b/source/infrastructure/personalize/stack.py index 9def2ac..9b53f72 100644 --- a/source/infrastructure/personalize/stack.py +++ b/source/infrastructure/personalize/stack.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from aws_cdk import ( Aspects, @@ -24,7 +14,7 @@ from aws_cdk.aws_events import EventBus from aws_cdk.aws_s3 import EventType, NotificationKeyFilter from aws_cdk.aws_s3_notifications import LambdaDestination -from aws_cdk.aws_stepfunctions import Chain, Parallel, StateMachine, TaskInput +from aws_cdk.aws_stepfunctions import Chain, DefinitionBody, Parallel, StateMachine, TaskInput from aws_solutions.cdk.aws_lambda.cfn_custom_resources.resource_name import ResourceName from aws_solutions.cdk.aws_lambda.layers.aws_lambda_powertools import PowertoolsLayer from aws_solutions.cdk.cfn_nag import ( @@ -68,9 +58,7 @@ from personalize.step_functions.scheduler_fragment import SchedulerFragment from personalize.step_functions.schedules import Schedules from personalize.step_functions.solution_fragment import SolutionFragment - -from cdk_nag import NagSuppressions -from cdk_nag import NagPackSuppression +from cdk_nag import NagPackSuppression, NagSuppressions class PersonalizeStack(SolutionStack): @@ -362,7 +350,7 @@ def __init__(self, scope: Construct, construct_id: str, *args, **kwargs) -> None self, "PersonalizeStateMachine", state_machine_name=state_machine_namer.resource_name.to_string(), - definition=definition, + definition_body=DefinitionBody.from_chainable(definition), tracing_enabled=True, ) add_cfn_nag_suppressions( @@ -406,6 +394,12 @@ def __init__(self, scope: Construct, construct_id: str, *args, **kwargs) -> None bucket_notification_handler = self.node.try_find_child( "BucketNotificationsHandler050a0587b7544547bf325f094a3db834" ) + + # Escape hatch to change Python runtime from 3.9 to 3.11 + if bucket_notification_handler: + bucket_notification_lambda = bucket_notification_handler.node.find_child("Resource") + bucket_notification_lambda.add_property_override("Runtime", "python3.11") + bucket_notification_policy = ( bucket_notification_handler.node.find_child("Role") .node.find_child("DefaultPolicy") diff --git a/source/infrastructure/personalize/step_functions/__init__.py b/source/infrastructure/personalize/step_functions/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/infrastructure/personalize/step_functions/__init__.py +++ b/source/infrastructure/personalize/step_functions/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/infrastructure/personalize/step_functions/batch_inference_jobs_fragment.py b/source/infrastructure/personalize/step_functions/batch_inference_jobs_fragment.py index e9b0ea0..bc4a3aa 100644 --- a/source/infrastructure/personalize/step_functions/batch_inference_jobs_fragment.py +++ b/source/infrastructure/personalize/step_functions/batch_inference_jobs_fragment.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Optional from aws_cdk import Duration diff --git a/source/infrastructure/personalize/step_functions/batch_segment_jobs_fragment.py b/source/infrastructure/personalize/step_functions/batch_segment_jobs_fragment.py index 15e24e7..b6bec8a 100644 --- a/source/infrastructure/personalize/step_functions/batch_segment_jobs_fragment.py +++ b/source/infrastructure/personalize/step_functions/batch_segment_jobs_fragment.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Optional from aws_cdk import Duration diff --git a/source/infrastructure/personalize/step_functions/dataset_import_fragment.py b/source/infrastructure/personalize/step_functions/dataset_import_fragment.py index f0dd2e3..4b4b518 100644 --- a/source/infrastructure/personalize/step_functions/dataset_import_fragment.py +++ b/source/infrastructure/personalize/step_functions/dataset_import_fragment.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from typing import List from aws_cdk import Duration diff --git a/source/infrastructure/personalize/step_functions/dataset_imports_fragment.py b/source/infrastructure/personalize/step_functions/dataset_imports_fragment.py index 1cf1352..bb0815d 100644 --- a/source/infrastructure/personalize/step_functions/dataset_imports_fragment.py +++ b/source/infrastructure/personalize/step_functions/dataset_imports_fragment.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from typing import List from aws_cdk.aws_stepfunctions import ( diff --git a/source/infrastructure/personalize/step_functions/event_tracker_fragment.py b/source/infrastructure/personalize/step_functions/event_tracker_fragment.py index 0970b58..035fcc6 100644 --- a/source/infrastructure/personalize/step_functions/event_tracker_fragment.py +++ b/source/infrastructure/personalize/step_functions/event_tracker_fragment.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from typing import List from aws_cdk import Duration diff --git a/source/infrastructure/personalize/step_functions/failure_fragment.py b/source/infrastructure/personalize/step_functions/failure_fragment.py index 7719fbe..8366860 100644 --- a/source/infrastructure/personalize/step_functions/failure_fragment.py +++ b/source/infrastructure/personalize/step_functions/failure_fragment.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from typing import List from aws_cdk.aws_stepfunctions import ( diff --git a/source/infrastructure/personalize/step_functions/filter_fragment.py b/source/infrastructure/personalize/step_functions/filter_fragment.py index b9b7644..a50fe5d 100644 --- a/source/infrastructure/personalize/step_functions/filter_fragment.py +++ b/source/infrastructure/personalize/step_functions/filter_fragment.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from typing import List from aws_cdk import Duration diff --git a/source/infrastructure/personalize/step_functions/personalization_fragment.py b/source/infrastructure/personalize/step_functions/personalization_fragment.py index 8ce0c5c..895fa8a 100644 --- a/source/infrastructure/personalize/step_functions/personalization_fragment.py +++ b/source/infrastructure/personalize/step_functions/personalization_fragment.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from typing import List, Dict from typing import Optional diff --git a/source/infrastructure/personalize/step_functions/scheduled_dataset_import.py b/source/infrastructure/personalize/step_functions/scheduled_dataset_import.py index a7b5572..e2459ba 100644 --- a/source/infrastructure/personalize/step_functions/scheduled_dataset_import.py +++ b/source/infrastructure/personalize/step_functions/scheduled_dataset_import.py @@ -1,20 +1,10 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from typing import Dict -from aws_cdk.aws_stepfunctions import StateMachine, Chain, Parallel, TaskInput +from aws_cdk.aws_stepfunctions import Chain, DefinitionBody, Parallel, StateMachine, TaskInput from constructs import Construct - from aws_solutions.cdk.aws_lambda.cfn_custom_resources.resource_name import ResourceName from aws_solutions.cdk.cfn_nag import add_cfn_nag_suppressions, CfnNagSuppression from aws_solutions.cdk.stepfunctions.solutionstep import SolutionStep @@ -40,25 +30,29 @@ def __init__( "PeriodicDatasetImport", tracing_enabled=True, state_machine_name=state_machine_namer.resource_name.to_string(), - definition=Chain.start( - Parallel(self, "Manage The Execution") - .branch( - create_timestamp.state(self, "Set Current Timestamp", result_path="$.currentDate") - .next(prepare_input.state(self, "Prepare Input")) - .next( - DatasetImportsFragment(self, "Handle Periodic Dataset Imports", **dataset_management_functions) + definition_body=DefinitionBody.from_chainable( + Chain.start( + Parallel(self, "Manage The Execution") + .branch( + create_timestamp.state(self, "Set Current Timestamp", result_path="$.currentDate") + .next(prepare_input.state(self, "Prepare Input")) + .next( + DatasetImportsFragment( + self, "Handle Periodic Dataset Imports", **dataset_management_functions + ) + ) ) - ) - .add_catch( - FailureFragment(self, notifications).start_state, - errors=["States.ALL"], - result_path="$.statesError", - ) - .next( - notifications.state( - self, - "Success", - payload=TaskInput.from_object({"datasetGroup.$": "$[0].datasetGroup.serviceConfig.name"}), + .add_catch( + FailureFragment(self, notifications).start_state, + errors=["States.ALL"], + result_path="$.statesError", + ) + .next( + notifications.state( + self, + "Success", + payload=TaskInput.from_object({"datasetGroup.$": "$[0].datasetGroup.serviceConfig.name"}), + ) ) ) ), diff --git a/source/infrastructure/personalize/step_functions/scheduled_solution_maintenance.py b/source/infrastructure/personalize/step_functions/scheduled_solution_maintenance.py index c286ba6..b8a8b59 100644 --- a/source/infrastructure/personalize/step_functions/scheduled_solution_maintenance.py +++ b/source/infrastructure/personalize/step_functions/scheduled_solution_maintenance.py @@ -1,29 +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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 -from aws_cdk.aws_stepfunctions import StateMachine, Chain, Parallel, TaskInput +from aws_cdk.aws_stepfunctions import Chain, DefinitionBody, Parallel, StateMachine, TaskInput from constructs import Construct - from aws_solutions.cdk.aws_lambda.cfn_custom_resources.resource_name import ResourceName -from aws_solutions.cdk.cfn_nag import add_cfn_nag_suppressions, CfnNagSuppression +from aws_solutions.cdk.cfn_nag import CfnNagSuppression, add_cfn_nag_suppressions from aws_solutions.cdk.stepfunctions.solutionstep import SolutionStep from personalize.aws_lambda.functions import ( CreateBatchInferenceJob, - CreateSolution, - CreateSolutionVersion, - CreateCampaign, CreateBatchSegmentJob, + CreateCampaign, CreateRecommender, + CreateSolution, + CreateSolutionVersion, ) from personalize.aws_lambda.functions.prepare_input import PrepareInput from personalize.step_functions.failure_fragment import FailureFragment @@ -58,36 +47,38 @@ def __init__( "PeriodicSolutionMaintenance", tracing_enabled=True, state_machine_name=state_machine_namer.resource_name.to_string(), - definition=Chain.start( - Parallel(self, "Manage Solution Maintenance") - .branch( - create_timestamp.state(self, "Set Current Timestamp", result_path="$.currentDate") - .next(prepare_input.state(self, "Prepare Input")) + definition_body=DefinitionBody.from_chainable( + Chain.start( + Parallel(self, "Manage Solution Maintenance") + .branch( + create_timestamp.state(self, "Set Current Timestamp", result_path="$.currentDate") + .next(prepare_input.state(self, "Prepare Input")) + .next( + SolutionFragment( + self, + "Handle Periodic Solution Maintenance", + create_solution=create_solution, + create_solution_version=create_solution_version, + create_campaign=create_campaign, + create_batch_inference_job=create_batch_inference_job, + create_batch_segment_job=create_batch_segment_job, + create_recommender=create_recommender, + ) + ) + ) + .add_catch( + FailureFragment(self, notifications).start_state, + errors=["States.ALL"], + result_path="$.statesError", + ) .next( - SolutionFragment( + notifications.state( self, - "Handle Periodic Solution Maintenance", - create_solution=create_solution, - create_solution_version=create_solution_version, - create_campaign=create_campaign, - create_batch_inference_job=create_batch_inference_job, - create_batch_segment_job=create_batch_segment_job, - create_recommender=create_recommender, + "Success", + payload=TaskInput.from_object({"datasetGroup.$": "$[0].datasetGroup.serviceConfig.name"}), ) ) ) - .add_catch( - FailureFragment(self, notifications).start_state, - errors=["States.ALL"], - result_path="$.statesError", - ) - .next( - notifications.state( - self, - "Success", - payload=TaskInput.from_object({"datasetGroup.$": "$[0].datasetGroup.serviceConfig.name"}), - ) - ) ), ) add_cfn_nag_suppressions( diff --git a/source/infrastructure/personalize/step_functions/scheduler_fragment.py b/source/infrastructure/personalize/step_functions/scheduler_fragment.py index ba1ab9a..169b754 100644 --- a/source/infrastructure/personalize/step_functions/scheduler_fragment.py +++ b/source/infrastructure/personalize/step_functions/scheduler_fragment.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + import re from typing import List, Optional, Dict diff --git a/source/infrastructure/personalize/step_functions/schedules.py b/source/infrastructure/personalize/step_functions/schedules.py index 85ddb6b..cdffc55 100644 --- a/source/infrastructure/personalize/step_functions/schedules.py +++ b/source/infrastructure/personalize/step_functions/schedules.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from dataclasses import dataclass diff --git a/source/infrastructure/personalize/step_functions/solution_fragment.py b/source/infrastructure/personalize/step_functions/solution_fragment.py index d260a83..c34c6db 100644 --- a/source/infrastructure/personalize/step_functions/solution_fragment.py +++ b/source/infrastructure/personalize/step_functions/solution_fragment.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + import time from datetime import datetime from typing import List, Optional diff --git a/source/infrastructure/setup.py b/source/infrastructure/setup.py index f88655f..1ee02ab 100644 --- a/source/infrastructure/setup.py +++ b/source/infrastructure/setup.py @@ -1,16 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### - +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import json from pathlib import Path diff --git a/source/pytest.ini b/source/pytest.ini index 151a80a..a5d3147 100644 --- a/source/pytest.ini +++ b/source/pytest.ini @@ -5,7 +5,6 @@ env = SOLUTION_ID=SO0170test SOLUTION_VERSION=v99.99.99 SOLUTION_NAME=Maintaining Personalized Experiences with Machine Learning - APP_REGISTRY_NAME=personalized-experiences-ML APPLICATION_TYPE=AWS-Solutions AWS_REGION=us-east-1 AWS_DEFAULT_REGION=us-east-1 diff --git a/source/requirements-dev.txt b/source/requirements-dev.txt index d8b1c17..d193595 100644 --- a/source/requirements-dev.txt +++ b/source/requirements-dev.txt @@ -3,7 +3,6 @@ black==24.3.0 boto3==1.26.47 aws_cdk_lib==2.88.0 aws_solutions_constructs.aws_lambda_sns==2.41.0 -aws-cdk.aws-servicecatalogappregistry-alpha==2.88.0a0 cdk-nag==2.27.107 requests==2.32.4 crhelper==2.0.11 diff --git a/source/scheduler/cdk/__init__.py b/source/scheduler/cdk/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/scheduler/cdk/__init__.py +++ b/source/scheduler/cdk/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/scheduler/cdk/aws_solutions/scheduler/cdk/__init__.py b/source/scheduler/cdk/aws_solutions/scheduler/cdk/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/scheduler/cdk/aws_solutions/scheduler/cdk/__init__.py +++ b/source/scheduler/cdk/aws_solutions/scheduler/cdk/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/__init__.py b/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/__init__.py index aed94dd..e445a71 100644 --- a/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/__init__.py +++ b/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/__init__.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from aws_solutions.scheduler.cdk.aws_lambda.create_scheduled_task import ( CreateScheduledTask, diff --git a/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/create_scheduled_task.py b/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/create_scheduled_task.py index edc730f..c6df359 100644 --- a/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/create_scheduled_task.py +++ b/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/create_scheduled_task.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from pathlib import Path from typing import Optional diff --git a/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/delete_scheduled_task.py b/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/delete_scheduled_task.py index 89fd66a..cafc8b1 100644 --- a/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/delete_scheduled_task.py +++ b/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/delete_scheduled_task.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from pathlib import Path from typing import Optional diff --git a/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_event/build.gradle b/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_event/build.gradle index 1199154..3279d49 100644 --- a/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_event/build.gradle +++ b/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_event/build.gradle @@ -1,15 +1,5 @@ -/* - * 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. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for - * the specific language governing permissions and limitations under the License. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 plugins { id 'java' diff --git a/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_event/gradlew b/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_event/gradlew index 4f906e0..770c810 100755 --- a/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_event/gradlew +++ b/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_event/gradlew @@ -1,20 +1,7 @@ #!/usr/bin/env sh -# -# Copyright 2015 the original author or authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 ############################################################################## ## diff --git a/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_event/settings.gradle b/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_event/settings.gradle index c77d37d..adbab2a 100644 --- a/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_event/settings.gradle +++ b/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_event/settings.gradle @@ -1,14 +1,4 @@ -/* - * 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. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for - * the specific language governing permissions and limitations under the License. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 rootProject.name = 'sfn-schedule-task' \ No newline at end of file diff --git a/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_event/src/main/java/com/amazonaws/solutions/schedule_sfn_task/HandleScheduleEvent.java b/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_event/src/main/java/com/amazonaws/solutions/schedule_sfn_task/HandleScheduleEvent.java index 32c1c6e..b611720 100644 --- a/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_event/src/main/java/com/amazonaws/solutions/schedule_sfn_task/HandleScheduleEvent.java +++ b/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_event/src/main/java/com/amazonaws/solutions/schedule_sfn_task/HandleScheduleEvent.java @@ -1,15 +1,5 @@ -/* - * 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. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for - * the specific language governing permissions and limitations under the License. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 package com.amazonaws.solutions.schedule_sfn_task; diff --git a/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_event/src/main/java/com/amazonaws/solutions/schedule_sfn_task/ScheduleEvent.java b/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_event/src/main/java/com/amazonaws/solutions/schedule_sfn_task/ScheduleEvent.java index a645b2e..1665c4a 100644 --- a/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_event/src/main/java/com/amazonaws/solutions/schedule_sfn_task/ScheduleEvent.java +++ b/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_event/src/main/java/com/amazonaws/solutions/schedule_sfn_task/ScheduleEvent.java @@ -1,15 +1,5 @@ -/* - * 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. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for - * the specific language governing permissions and limitations under the License. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 package com.amazonaws.solutions.schedule_sfn_task; diff --git a/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_event/src/main/java/com/amazonaws/solutions/schedule_sfn_task/ScheduleException.java b/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_event/src/main/java/com/amazonaws/solutions/schedule_sfn_task/ScheduleException.java index b845178..8c4e18f 100644 --- a/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_event/src/main/java/com/amazonaws/solutions/schedule_sfn_task/ScheduleException.java +++ b/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_event/src/main/java/com/amazonaws/solutions/schedule_sfn_task/ScheduleException.java @@ -1,15 +1,5 @@ -/* - * 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. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for - * the specific language governing permissions and limitations under the License. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 package com.amazonaws.solutions.schedule_sfn_task; diff --git a/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_event/src/test/java/com/amazonaws/solutions/schedule_sfn_task/HandleScheduleEventTest.java b/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_event/src/test/java/com/amazonaws/solutions/schedule_sfn_task/HandleScheduleEventTest.java index f6ce94a..8dcb98e 100644 --- a/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_event/src/test/java/com/amazonaws/solutions/schedule_sfn_task/HandleScheduleEventTest.java +++ b/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/get_next_scheduled_event/src/test/java/com/amazonaws/solutions/schedule_sfn_task/HandleScheduleEventTest.java @@ -1,15 +1,5 @@ -/* - * 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. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed - * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for - * the specific language governing permissions and limitations under the License. - */ +// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +// SPDX-License-Identifier: Apache-2.0 package com.amazonaws.solutions.schedule_sfn_task; diff --git a/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/read_scheduled_task.py b/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/read_scheduled_task.py index 832ce34..c4cffc6 100644 --- a/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/read_scheduled_task.py +++ b/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/read_scheduled_task.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from pathlib import Path from typing import Optional diff --git a/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/scheduler/__init__.py b/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/scheduler/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/scheduler/__init__.py +++ b/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/scheduler/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/scheduler/handler.py b/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/scheduler/handler.py index 5cd60cb..078eff1 100644 --- a/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/scheduler/handler.py +++ b/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/scheduler/handler.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from typing import Dict diff --git a/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/update_scheduled_task.py b/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/update_scheduled_task.py index 40dd44a..dee8f06 100644 --- a/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/update_scheduled_task.py +++ b/source/scheduler/cdk/aws_solutions/scheduler/cdk/aws_lambda/update_scheduled_task.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from pathlib import Path from typing import Optional diff --git a/source/scheduler/cdk/aws_solutions/scheduler/cdk/construct.py b/source/scheduler/cdk/aws_solutions/scheduler/cdk/construct.py index 86f648c..c258507 100644 --- a/source/scheduler/cdk/aws_solutions/scheduler/cdk/construct.py +++ b/source/scheduler/cdk/aws_solutions/scheduler/cdk/construct.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from __future__ import annotations @@ -22,15 +12,16 @@ from aws_cdk import Aws, IAspect, Aspects from aws_cdk.aws_lambda import Tracing from aws_cdk.aws_stepfunctions import ( - StateMachine, Chain, - Wait, - WaitTime, - IStateMachine, - CustomState, - TaskInput, Choice, Condition, + CustomState, + DefinitionBody, + IStateMachine, + StateMachine, + TaskInput, + Wait, + WaitTime, ) from aws_cdk.aws_stepfunctions_tasks import LambdaInvoke from constructs import Construct, IConstruct @@ -238,7 +229,7 @@ def __init__(self, scope: Construct, construct_id: str, sync: bool = True): self, "SchedulerStateMachine", state_machine_name=self.state_machine_name, - definition=self._scheduler_definition, + definition_body=DefinitionBody.from_chainable(self._scheduler_definition), tracing_enabled=True, ) diff --git a/source/scheduler/cdk/aws_solutions/scheduler/cdk/scheduler_fragment.py b/source/scheduler/cdk/aws_solutions/scheduler/cdk/scheduler_fragment.py index ba1ab9a..169b754 100644 --- a/source/scheduler/cdk/aws_solutions/scheduler/cdk/scheduler_fragment.py +++ b/source/scheduler/cdk/aws_solutions/scheduler/cdk/scheduler_fragment.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + import re from typing import List, Optional, Dict diff --git a/source/scheduler/cdk/setup.py b/source/scheduler/cdk/setup.py index 6b5d938..ff46480 100644 --- a/source/scheduler/cdk/setup.py +++ b/source/scheduler/cdk/setup.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import re from pathlib import Path diff --git a/source/scheduler/common/__init__.py b/source/scheduler/common/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/scheduler/common/__init__.py +++ b/source/scheduler/common/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/scheduler/common/aws_solutions/scheduler/common/__init__.py b/source/scheduler/common/aws_solutions/scheduler/common/__init__.py index 77dee24..0c0c424 100644 --- a/source/scheduler/common/aws_solutions/scheduler/common/__init__.py +++ b/source/scheduler/common/aws_solutions/scheduler/common/__init__.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 TASK_PK = "name" TASK_SK = "version" diff --git a/source/scheduler/common/aws_solutions/scheduler/common/base.py b/source/scheduler/common/aws_solutions/scheduler/common/base.py index dd4c5a1..28285d9 100644 --- a/source/scheduler/common/aws_solutions/scheduler/common/base.py +++ b/source/scheduler/common/aws_solutions/scheduler/common/base.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from __future__ import annotations diff --git a/source/scheduler/common/aws_solutions/scheduler/common/schedule.py b/source/scheduler/common/aws_solutions/scheduler/common/schedule.py index 783782b..32f4fbd 100644 --- a/source/scheduler/common/aws_solutions/scheduler/common/schedule.py +++ b/source/scheduler/common/aws_solutions/scheduler/common/schedule.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import re from dataclasses import dataclass, field diff --git a/source/scheduler/common/aws_solutions/scheduler/common/scripts/__init__.py b/source/scheduler/common/aws_solutions/scheduler/common/scripts/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/scheduler/common/aws_solutions/scheduler/common/scripts/__init__.py +++ b/source/scheduler/common/aws_solutions/scheduler/common/scripts/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/scheduler/common/aws_solutions/scheduler/common/scripts/scheduler_cli.py b/source/scheduler/common/aws_solutions/scheduler/common/scripts/scheduler_cli.py index 82e1fbf..8befb4a 100644 --- a/source/scheduler/common/aws_solutions/scheduler/common/scripts/scheduler_cli.py +++ b/source/scheduler/common/aws_solutions/scheduler/common/scripts/scheduler_cli.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + import json import os from typing import List, Tuple, Dict, Any diff --git a/source/scheduler/common/aws_solutions/scheduler/common/task.py b/source/scheduler/common/aws_solutions/scheduler/common/task.py index 840e071..47ccc1d 100644 --- a/source/scheduler/common/aws_solutions/scheduler/common/task.py +++ b/source/scheduler/common/aws_solutions/scheduler/common/task.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from __future__ import annotations diff --git a/source/scheduler/common/aws_solutions/scheduler/common/task_resource.py b/source/scheduler/common/aws_solutions/scheduler/common/task_resource.py index 854fe1a..f4a6598 100644 --- a/source/scheduler/common/aws_solutions/scheduler/common/task_resource.py +++ b/source/scheduler/common/aws_solutions/scheduler/common/task_resource.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import dataclasses import functools diff --git a/source/scheduler/common/setup.py b/source/scheduler/common/setup.py index 22fdbc9..7957746 100644 --- a/source/scheduler/common/setup.py +++ b/source/scheduler/common/setup.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import re from pathlib import Path diff --git a/source/tests/__init__.py b/source/tests/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/tests/__init__.py +++ b/source/tests/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/tests/aspects/__init__.py b/source/tests/aspects/__init__.py deleted file mode 100644 index ef2f9eb..0000000 --- a/source/tests/aspects/__init__.py +++ /dev/null @@ -1,12 +0,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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### diff --git a/source/tests/aspects/test_personalize_app_stack.py b/source/tests/aspects/test_personalize_app_stack.py deleted file mode 100644 index 51066fd..0000000 --- a/source/tests/aspects/test_personalize_app_stack.py +++ /dev/null @@ -1,108 +0,0 @@ -#!/usr/bin/env python3 - -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### - -from pathlib import Path - -import aws_cdk as cdk -import pytest -from aws_cdk.assertions import Capture, Template -from aws_solutions.cdk import CDKSolution - -solution = CDKSolution(cdk_json_path=Path(__file__).parent.parent.absolute() / "infrastructure" / "cdk.json") - -from infrastructure.aspects.app_registry import AppRegistry -from infrastructure.personalize.stack import PersonalizeStack - - -@pytest.fixture(scope="module") -def synth_template(cdk_json): - app = cdk.App(context=cdk_json["context"]) - - stack = PersonalizeStack( - app, - "PersonalizeStack", - description=f"Deploy, deliver and maintain personalized experiences with Amazon Personalize", - template_filename="maintaining-personalized-experiences-with-machine-learning.template", - synthesizer=solution.synthesizer, - ) - cdk.Aspects.of(app).add(AppRegistry(stack, "AppRegistryAspect")) - template = Template.from_stack(stack) - yield template, app - - -app_registry_capture = Capture() - - -def test_service_catalog_registry_application(synth_template): - template, app = synth_template - template.resource_count_is("AWS::ServiceCatalogAppRegistry::Application", 1) - template.has_resource_properties( - "AWS::ServiceCatalogAppRegistry::Application", - { - "Name": { - "Fn::Join": [ - "-", - [ - "App", - {"Ref": "AWS::StackName"}, - app.node.try_get_context("APP_REGISTRY_NAME"), - {"Ref": "AWS::Region"}, - {"Ref": "AWS::AccountId"}, - ], - ] - }, - "Description": "Service Catalog application to track and manage all your resources for the solution Maintaining Personalized Experiences with Machine Learning", - "Tags": { - "SOLUTION_ID": "SO0170", - "SOLUTION_NAME": "Maintaining Personalized Experiences with Machine Learning", - "SOLUTION_VERSION": "v1.4.5", - "Solutions:ApplicationType": "AWS-Solutions", - "Solutions:SolutionID": "SO0170", - "Solutions:SolutionName": "Maintaining Personalized Experiences with Machine Learning", - "Solutions:SolutionVersion": "v1.4.5", - }, - }, - ) - - -def test_resource_association_nested_stacks(synth_template): - template, app = synth_template - template.resource_count_is("AWS::ServiceCatalogAppRegistry::ResourceAssociation", 1) - template.has_resource_properties( - "AWS::ServiceCatalogAppRegistry::ResourceAssociation", - { - "Application": {"Fn::GetAtt": [app_registry_capture, "Id"]}, - "Resource": {"Ref": "AWS::StackId"}, - "ResourceType": "CFN_STACK", - }, - ) - - -def test_attr_grp_association(synth_template): - attr_grp_capture = Capture() - template, app = synth_template - template.resource_count_is("AWS::ServiceCatalogAppRegistry::AttributeGroupAssociation", 1) - template.has_resource_properties( - "AWS::ServiceCatalogAppRegistry::AttributeGroupAssociation", - { - "Application": {"Fn::GetAtt": [app_registry_capture.as_string(), "Id"]}, - "AttributeGroup": {"Fn::GetAtt": [attr_grp_capture, "Id"]}, - }, - ) - - assert ( - template.to_json()["Resources"][attr_grp_capture.as_string()]["Type"] - == "AWS::ServiceCatalogAppRegistry::AttributeGroup" - ) diff --git a/source/tests/aws_lambda/__init__.py b/source/tests/aws_lambda/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/tests/aws_lambda/__init__.py +++ b/source/tests/aws_lambda/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/tests/aws_lambda/create_batch_inference_job/__init__.py b/source/tests/aws_lambda/create_batch_inference_job/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/tests/aws_lambda/create_batch_inference_job/__init__.py +++ b/source/tests/aws_lambda/create_batch_inference_job/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/tests/aws_lambda/create_batch_inference_job/test_batch_inference_job_handler.py b/source/tests/aws_lambda/create_batch_inference_job/test_batch_inference_job_handler.py index 8bd76a4..56b53b0 100644 --- a/source/tests/aws_lambda/create_batch_inference_job/test_batch_inference_job_handler.py +++ b/source/tests/aws_lambda/create_batch_inference_job/test_batch_inference_job_handler.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import os diff --git a/source/tests/aws_lambda/create_batch_segment_job/__init__.py b/source/tests/aws_lambda/create_batch_segment_job/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/tests/aws_lambda/create_batch_segment_job/__init__.py +++ b/source/tests/aws_lambda/create_batch_segment_job/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/tests/aws_lambda/create_batch_segment_job/test_batch_segment_job_handler.py b/source/tests/aws_lambda/create_batch_segment_job/test_batch_segment_job_handler.py index 1c4294d..978dd6f 100644 --- a/source/tests/aws_lambda/create_batch_segment_job/test_batch_segment_job_handler.py +++ b/source/tests/aws_lambda/create_batch_segment_job/test_batch_segment_job_handler.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import os diff --git a/source/tests/aws_lambda/create_campaign/__init__.py b/source/tests/aws_lambda/create_campaign/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/tests/aws_lambda/create_campaign/__init__.py +++ b/source/tests/aws_lambda/create_campaign/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/tests/aws_lambda/create_campaign/test_create_campaign_handler.py b/source/tests/aws_lambda/create_campaign/test_create_campaign_handler.py index 125e64e..9e5badf 100644 --- a/source/tests/aws_lambda/create_campaign/test_create_campaign_handler.py +++ b/source/tests/aws_lambda/create_campaign/test_create_campaign_handler.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from datetime import datetime, timedelta diff --git a/source/tests/aws_lambda/create_config/__init__.py b/source/tests/aws_lambda/create_config/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/tests/aws_lambda/create_config/__init__.py +++ b/source/tests/aws_lambda/create_config/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/tests/aws_lambda/create_config/test_create_config_handler.py b/source/tests/aws_lambda/create_config/test_create_config_handler.py index 85542de..35a133d 100644 --- a/source/tests/aws_lambda/create_config/test_create_config_handler.py +++ b/source/tests/aws_lambda/create_config/test_create_config_handler.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from aws_lambda.create_config.handler import lambda_handler from shared.resource import ( @@ -25,7 +15,8 @@ ) -def test_create_config(personalize_stubber): +def test_create_config(mocker, personalize_stubber): + dsg_name = "dsg" event_tracker_name = "dsgeventtracker" dataset_name = "dsg/INTERACTIONS" diff --git a/source/tests/aws_lambda/create_dataset/__init__.py b/source/tests/aws_lambda/create_dataset/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/tests/aws_lambda/create_dataset/__init__.py +++ b/source/tests/aws_lambda/create_dataset/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/tests/aws_lambda/create_dataset/test_dataset_handler.py b/source/tests/aws_lambda/create_dataset/test_dataset_handler.py index be018a5..4ccc7b6 100644 --- a/source/tests/aws_lambda/create_dataset/test_dataset_handler.py +++ b/source/tests/aws_lambda/create_dataset/test_dataset_handler.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from datetime import datetime, timedelta diff --git a/source/tests/aws_lambda/create_dataset_group/__init__.py b/source/tests/aws_lambda/create_dataset_group/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/tests/aws_lambda/create_dataset_group/__init__.py +++ b/source/tests/aws_lambda/create_dataset_group/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/tests/aws_lambda/create_dataset_group/test_dataset_group_handler.py b/source/tests/aws_lambda/create_dataset_group/test_dataset_group_handler.py index 22846f9..dc93503 100644 --- a/source/tests/aws_lambda/create_dataset_group/test_dataset_group_handler.py +++ b/source/tests/aws_lambda/create_dataset_group/test_dataset_group_handler.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from datetime import datetime, timedelta diff --git a/source/tests/aws_lambda/create_dataset_import_job/__init__.py b/source/tests/aws_lambda/create_dataset_import_job/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/tests/aws_lambda/create_dataset_import_job/__init__.py +++ b/source/tests/aws_lambda/create_dataset_import_job/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/tests/aws_lambda/create_dataset_import_job/test_dataset_import_job_handler.py b/source/tests/aws_lambda/create_dataset_import_job/test_dataset_import_job_handler.py index 5d0591f..e6660a9 100644 --- a/source/tests/aws_lambda/create_dataset_import_job/test_dataset_import_job_handler.py +++ b/source/tests/aws_lambda/create_dataset_import_job/test_dataset_import_job_handler.py @@ -1,34 +1,15 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import os import pytest -from aws_lambda.create_dataset_import_job.handler import ( - CONFIG, - RESOURCE, - STATUS, - lambda_handler, -) +from aws_lambda.create_dataset_import_job.handler import CONFIG, RESOURCE, STATUS, lambda_handler from botocore.exceptions import ParamValidationError -from moto import mock_sts from shared.exceptions import ResourcePending from shared.resource import Dataset, DatasetGroup, DatasetImportJob dataset_name = "mockDataset" -dataset_arn = Dataset().arn(dataset_name) -dataset_import_arn = DatasetImportJob().arn("mockDatasetImport") -dataset_group_arn = DatasetGroup().arn("mockDatasetGroup") def test_create_dataset_import_job_handler(validate_handler_config): @@ -37,9 +18,9 @@ def test_create_dataset_import_job_handler(validate_handler_config): lambda_handler({}, None) -@mock_sts def test_data_import_tags(mocker, personalize_stubber, notifier_stubber): os.environ["ROLE_ARN"] = "roleArn" + dataset_arn = Dataset().arn(dataset_name) dataset_import_arn = DatasetImportJob().arn("mockDatasetImport") @@ -91,13 +72,12 @@ def test_data_import_tags(mocker, personalize_stubber, notifier_stubber): del os.environ["ROLE_ARN"] -@mock_sts def test_bad_data_import_tags(mocker, personalize_stubber): + os.environ["ROLE_ARN"] = "roleArn" + dataset_arn = Dataset().arn(dataset_name) dataset_import_arn = DatasetImportJob().arn("mockDatasetImport") - os.environ["ROLE_ARN"] = "roleArn" - personalize_stubber.add_response( method="list_dataset_import_jobs", expected_params={"datasetArn": dataset_arn}, diff --git a/source/tests/aws_lambda/create_event_tracker/__init__.py b/source/tests/aws_lambda/create_event_tracker/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/tests/aws_lambda/create_event_tracker/__init__.py +++ b/source/tests/aws_lambda/create_event_tracker/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/tests/aws_lambda/create_event_tracker/test_create_event_tracker_handler.py b/source/tests/aws_lambda/create_event_tracker/test_create_event_tracker_handler.py index 352b707..f80f88a 100644 --- a/source/tests/aws_lambda/create_event_tracker/test_create_event_tracker_handler.py +++ b/source/tests/aws_lambda/create_event_tracker/test_create_event_tracker_handler.py @@ -1,33 +1,15 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import os import pytest -from aws_lambda.create_event_tracker.handler import ( - CONFIG, - RESOURCE, - STATUS, - lambda_handler, -) +from aws_lambda.create_event_tracker.handler import CONFIG, RESOURCE, STATUS, lambda_handler from botocore.exceptions import ParamValidationError -from moto import mock_sts from shared.exceptions import ResourcePending from shared.resource import DatasetGroup, EventTracker etracker_name = "mockEventTracker" -event_tracker_arn = EventTracker().arn(etracker_name) -dataset_group_arn = DatasetGroup().arn("mockDatasetGroup") def test_create_event_tracker(validate_handler_config): @@ -36,8 +18,7 @@ def test_create_event_tracker(validate_handler_config): lambda_handler({}, None) -@mock_sts -def test_event_tracker_tags(personalize_stubber, notifier_stubber): +def test_event_tracker_tags(mocker, personalize_stubber, notifier_stubber): event_tracker_arn = EventTracker().arn(etracker_name) dataset_group_arn = DatasetGroup().arn("mockDatasetGroup") @@ -77,8 +58,7 @@ def test_event_tracker_tags(personalize_stubber, notifier_stubber): assert notifier_stubber.latest_notification_status == "CREATING" -@mock_sts -def test_bad_event_tracker_tags(personalize_stubber): +def test_bad_event_tracker_tags(mocker, personalize_stubber): event_tracker_arn = EventTracker().arn(etracker_name) dataset_group_arn = DatasetGroup().arn("mockDatasetGroup") diff --git a/source/tests/aws_lambda/create_filter/__init__.py b/source/tests/aws_lambda/create_filter/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/tests/aws_lambda/create_filter/__init__.py +++ b/source/tests/aws_lambda/create_filter/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/tests/aws_lambda/create_filter/test_create_filter_handler.py b/source/tests/aws_lambda/create_filter/test_create_filter_handler.py index d32a1a9..a56bf01 100644 --- a/source/tests/aws_lambda/create_filter/test_create_filter_handler.py +++ b/source/tests/aws_lambda/create_filter/test_create_filter_handler.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import os diff --git a/source/tests/aws_lambda/create_recommender/__init__.py b/source/tests/aws_lambda/create_recommender/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/tests/aws_lambda/create_recommender/__init__.py +++ b/source/tests/aws_lambda/create_recommender/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/tests/aws_lambda/create_recommender/test_create_recommender_handler.py b/source/tests/aws_lambda/create_recommender/test_create_recommender_handler.py index d9a3f36..ea4b527 100644 --- a/source/tests/aws_lambda/create_recommender/test_create_recommender_handler.py +++ b/source/tests/aws_lambda/create_recommender/test_create_recommender_handler.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import os diff --git a/source/tests/aws_lambda/create_schema/__init__.py b/source/tests/aws_lambda/create_schema/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/tests/aws_lambda/create_schema/__init__.py +++ b/source/tests/aws_lambda/create_schema/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/tests/aws_lambda/create_schema/create_schema_handler.py b/source/tests/aws_lambda/create_schema/create_schema_handler.py index 83b2260..a47410c 100644 --- a/source/tests/aws_lambda/create_schema/create_schema_handler.py +++ b/source/tests/aws_lambda/create_schema/create_schema_handler.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import pytest from aws_lambda.create_schema.handler import CONFIG, RESOURCE, lambda_handler diff --git a/source/tests/aws_lambda/create_solution/__init__.py b/source/tests/aws_lambda/create_solution/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/tests/aws_lambda/create_solution/__init__.py +++ b/source/tests/aws_lambda/create_solution/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/tests/aws_lambda/create_solution/test_create_solution_handler.py b/source/tests/aws_lambda/create_solution/test_create_solution_handler.py index e6feb66..0e3eed5 100644 --- a/source/tests/aws_lambda/create_solution/test_create_solution_handler.py +++ b/source/tests/aws_lambda/create_solution/test_create_solution_handler.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import os diff --git a/source/tests/aws_lambda/create_solution_version/__init__.py b/source/tests/aws_lambda/create_solution_version/__init__.py index ef2f9eb..04f8b7b 100644 --- a/source/tests/aws_lambda/create_solution_version/__init__.py +++ b/source/tests/aws_lambda/create_solution_version/__init__.py @@ -1,12 +1,2 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/tests/aws_lambda/create_solution_version/test_create_solution_version_handler.py b/source/tests/aws_lambda/create_solution_version/test_create_solution_version_handler.py index 5a2f91e..218cc7b 100644 --- a/source/tests/aws_lambda/create_solution_version/test_create_solution_version_handler.py +++ b/source/tests/aws_lambda/create_solution_version/test_create_solution_version_handler.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import os diff --git a/source/tests/aws_lambda/s3_event/test_s3_event_handler.py b/source/tests/aws_lambda/s3_event/test_s3_event_handler.py index 7f733d7..069579f 100644 --- a/source/tests/aws_lambda/s3_event/test_s3_event_handler.py +++ b/source/tests/aws_lambda/s3_event/test_s3_event_handler.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + import json from os import environ diff --git a/source/tests/aws_lambda/sns_notification/test_sns_notification.py b/source/tests/aws_lambda/sns_notification/test_sns_notification.py index 70b757c..c213bba 100644 --- a/source/tests/aws_lambda/sns_notification/test_sns_notification.py +++ b/source/tests/aws_lambda/sns_notification/test_sns_notification.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + import json import os from collections import namedtuple diff --git a/source/tests/aws_lambda/test_events.py b/source/tests/aws_lambda/test_events.py index 64e76c7..9f320be 100644 --- a/source/tests/aws_lambda/test_events.py +++ b/source/tests/aws_lambda/test_events.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from datetime import datetime diff --git a/source/tests/aws_lambda/test_personalize_service.py b/source/tests/aws_lambda/test_personalize_service.py index becdd1c..a49b5c7 100644 --- a/source/tests/aws_lambda/test_personalize_service.py +++ b/source/tests/aws_lambda/test_personalize_service.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + import binascii import json import os diff --git a/source/tests/aws_lambda/test_sfn_middleware.py b/source/tests/aws_lambda/test_sfn_middleware.py index e474c3a..7465c48 100644 --- a/source/tests/aws_lambda/test_sfn_middleware.py +++ b/source/tests/aws_lambda/test_sfn_middleware.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + import logging from datetime import datetime from decimal import Decimal @@ -200,7 +191,7 @@ def test_parameter_resolution(key, source, path, format_as, default, result): ) -def test_set_workflow_config(): +def test_set_workflow_config(mocker): result = set_workflow_config( { "tags": [{"tagKey": "tag1", "tagValue": "key1"}], diff --git a/source/tests/cdk_solution_helper/__init__.py b/source/tests/cdk_solution_helper/__init__.py index 330623f..04f8b7b 100644 --- a/source/tests/cdk_solution_helper/__init__.py +++ b/source/tests/cdk_solution_helper/__init__.py @@ -1,12 +1,2 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 diff --git a/source/tests/cdk_solution_helper/aws_lambda/cfn_custom_resources/resource_hash/test_resource_name.py b/source/tests/cdk_solution_helper/aws_lambda/cfn_custom_resources/resource_hash/test_resource_name.py index e1c96b5..5dfc352 100644 --- a/source/tests/cdk_solution_helper/aws_lambda/cfn_custom_resources/resource_hash/test_resource_name.py +++ b/source/tests/cdk_solution_helper/aws_lambda/cfn_custom_resources/resource_hash/test_resource_name.py @@ -1,16 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### - +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import re diff --git a/source/tests/cdk_solution_helper/aws_lambda/cfn_custom_resources/resource_hash/test_resource_name_cdk.py b/source/tests/cdk_solution_helper/aws_lambda/cfn_custom_resources/resource_hash/test_resource_name_cdk.py index 8a9bae8..bd7d505 100644 --- a/source/tests/cdk_solution_helper/aws_lambda/cfn_custom_resources/resource_hash/test_resource_name_cdk.py +++ b/source/tests/cdk_solution_helper/aws_lambda/cfn_custom_resources/resource_hash/test_resource_name_cdk.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import pytest from aws_cdk import Stack, App diff --git a/source/tests/cdk_solution_helper/aws_lambda/cfn_custom_resources/resource_name/test_resource_hash.py b/source/tests/cdk_solution_helper/aws_lambda/cfn_custom_resources/resource_name/test_resource_hash.py index b5b1da3..56c0364 100644 --- a/source/tests/cdk_solution_helper/aws_lambda/cfn_custom_resources/resource_name/test_resource_hash.py +++ b/source/tests/cdk_solution_helper/aws_lambda/cfn_custom_resources/resource_name/test_resource_hash.py @@ -1,16 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### - +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import pytest diff --git a/source/tests/cdk_solution_helper/aws_lambda/cfn_custom_resources/resource_name/test_resource_hash_cdk.py b/source/tests/cdk_solution_helper/aws_lambda/cfn_custom_resources/resource_name/test_resource_hash_cdk.py index 8a9bae8..bd7d505 100644 --- a/source/tests/cdk_solution_helper/aws_lambda/cfn_custom_resources/resource_name/test_resource_hash_cdk.py +++ b/source/tests/cdk_solution_helper/aws_lambda/cfn_custom_resources/resource_name/test_resource_hash_cdk.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import pytest from aws_cdk import Stack, App diff --git a/source/tests/cdk_solution_helper/aws_lambda/cfn_custom_resources/solution_metrics/test_metrics_cdk.py b/source/tests/cdk_solution_helper/aws_lambda/cfn_custom_resources/solution_metrics/test_metrics_cdk.py index d58a6f8..1961bbc 100644 --- a/source/tests/cdk_solution_helper/aws_lambda/cfn_custom_resources/solution_metrics/test_metrics_cdk.py +++ b/source/tests/cdk_solution_helper/aws_lambda/cfn_custom_resources/solution_metrics/test_metrics_cdk.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import pytest from aws_cdk import Stack, App diff --git a/source/tests/cdk_solution_helper/aws_lambda/cfn_custom_resources/solution_metrics/test_metrics_resource.py b/source/tests/cdk_solution_helper/aws_lambda/cfn_custom_resources/solution_metrics/test_metrics_resource.py index 66d8364..4dcf46e 100644 --- a/source/tests/cdk_solution_helper/aws_lambda/cfn_custom_resources/solution_metrics/test_metrics_resource.py +++ b/source/tests/cdk_solution_helper/aws_lambda/cfn_custom_resources/solution_metrics/test_metrics_resource.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import logging import os @@ -36,7 +26,7 @@ def test_event(request): event = { "RequestType": request.param, - "ResourceProperties": {"Solution": "SOL0123", "Version": "v1.4.5","Metric1": "Data1"}, + "ResourceProperties": {"Solution": "SOL0123", "Version": "v1.5.0","Metric1": "Data1"}, } yield event diff --git a/source/tests/cdk_solution_helper/aws_lambda/java/fixtures/java_sample/gradlew b/source/tests/cdk_solution_helper/aws_lambda/java/fixtures/java_sample/gradlew index 4f906e0..770c810 100755 --- a/source/tests/cdk_solution_helper/aws_lambda/java/fixtures/java_sample/gradlew +++ b/source/tests/cdk_solution_helper/aws_lambda/java/fixtures/java_sample/gradlew @@ -1,20 +1,7 @@ #!/usr/bin/env sh -# -# Copyright 2015 the original author or authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 ############################################################################## ## diff --git a/source/tests/cdk_solution_helper/aws_lambda/java/test_java_function.py b/source/tests/cdk_solution_helper/aws_lambda/java/test_java_function.py index e44e830..1fc50aa 100644 --- a/source/tests/cdk_solution_helper/aws_lambda/java/test_java_function.py +++ b/source/tests/cdk_solution_helper/aws_lambda/java/test_java_function.py @@ -1,15 +1,6 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + import logging from pathlib import Path diff --git a/source/tests/cdk_solution_helper/aws_lambda/python/fixtures/lambda/package/minimal/__init__.py b/source/tests/cdk_solution_helper/aws_lambda/python/fixtures/lambda/package/minimal/__init__.py index bce76b6..1a9d0b3 100644 --- a/source/tests/cdk_solution_helper/aws_lambda/python/fixtures/lambda/package/minimal/__init__.py +++ b/source/tests/cdk_solution_helper/aws_lambda/python/fixtures/lambda/package/minimal/__init__.py @@ -1,16 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### - +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 def function_in_package(): return "hello from function_in_package" diff --git a/source/tests/cdk_solution_helper/aws_lambda/python/fixtures/lambda/package/setup.py b/source/tests/cdk_solution_helper/aws_lambda/python/fixtures/lambda/package/setup.py index f0c38cd..f808868 100644 --- a/source/tests/cdk_solution_helper/aws_lambda/python/fixtures/lambda/package/setup.py +++ b/source/tests/cdk_solution_helper/aws_lambda/python/fixtures/lambda/package/setup.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from setuptools import setup diff --git a/source/tests/cdk_solution_helper/aws_lambda/python/fixtures/packages/package2/minimal2/__init__.py b/source/tests/cdk_solution_helper/aws_lambda/python/fixtures/packages/package2/minimal2/__init__.py index c18aa8e..ff9b45a 100644 --- a/source/tests/cdk_solution_helper/aws_lambda/python/fixtures/packages/package2/minimal2/__init__.py +++ b/source/tests/cdk_solution_helper/aws_lambda/python/fixtures/packages/package2/minimal2/__init__.py @@ -1,16 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### - +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 def function_in_package(): return "hello from minimal2 function_in_package" diff --git a/source/tests/cdk_solution_helper/aws_lambda/python/fixtures/packages/package2/setup.py b/source/tests/cdk_solution_helper/aws_lambda/python/fixtures/packages/package2/setup.py index f90f494..e613790 100644 --- a/source/tests/cdk_solution_helper/aws_lambda/python/fixtures/packages/package2/setup.py +++ b/source/tests/cdk_solution_helper/aws_lambda/python/fixtures/packages/package2/setup.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from setuptools import setup diff --git a/source/tests/cdk_solution_helper/aws_lambda/python/test_function.py b/source/tests/cdk_solution_helper/aws_lambda/python/test_function.py index 666c688..83de048 100644 --- a/source/tests/cdk_solution_helper/aws_lambda/python/test_function.py +++ b/source/tests/cdk_solution_helper/aws_lambda/python/test_function.py @@ -1,15 +1,6 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + import logging import shutil from pathlib import Path diff --git a/source/tests/cdk_solution_helper/aws_lambda/python/test_layer_version.py b/source/tests/cdk_solution_helper/aws_lambda/python/test_layer_version.py index c7dd566..3bf0171 100644 --- a/source/tests/cdk_solution_helper/aws_lambda/python/test_layer_version.py +++ b/source/tests/cdk_solution_helper/aws_lambda/python/test_layer_version.py @@ -1,15 +1,6 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + import json import logging import shutil diff --git a/source/tests/cdk_solution_helper/helpers/test_load_cdk_app.py b/source/tests/cdk_solution_helper/helpers/test_load_cdk_app.py index 746d1b3..10b74f9 100644 --- a/source/tests/cdk_solution_helper/helpers/test_load_cdk_app.py +++ b/source/tests/cdk_solution_helper/helpers/test_load_cdk_app.py @@ -1,15 +1,6 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from pathlib import Path import pytest diff --git a/source/tests/cdk_solution_helper/helpers/test_logger.py b/source/tests/cdk_solution_helper/helpers/test_logger.py index efbb0c6..e729b96 100644 --- a/source/tests/cdk_solution_helper/helpers/test_logger.py +++ b/source/tests/cdk_solution_helper/helpers/test_logger.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import logging diff --git a/source/tests/cdk_solution_helper/test_aspects.py b/source/tests/cdk_solution_helper/test_aspects.py index 5207f9e..188a068 100644 --- a/source/tests/cdk_solution_helper/test_aspects.py +++ b/source/tests/cdk_solution_helper/test_aspects.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import pytest from aws_cdk import App, Stack, Aspects, CfnCondition, Fn diff --git a/source/tests/cdk_solution_helper/test_build_s3_cdk_dist.py b/source/tests/cdk_solution_helper/test_build_s3_cdk_dist.py index 38afe4c..99bb89c 100644 --- a/source/tests/cdk_solution_helper/test_build_s3_cdk_dist.py +++ b/source/tests/cdk_solution_helper/test_build_s3_cdk_dist.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from pathlib import Path import boto3 diff --git a/source/tests/cdk_solution_helper/test_cdk_context.py b/source/tests/cdk_solution_helper/test_cdk_context.py index 68b2d9f..0b5672b 100644 --- a/source/tests/cdk_solution_helper/test_cdk_context.py +++ b/source/tests/cdk_solution_helper/test_cdk_context.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import json from os import environ diff --git a/source/tests/cdk_solution_helper/test_cdk_interfaces.py b/source/tests/cdk_solution_helper/test_cdk_interfaces.py index b346dd7..166d62c 100644 --- a/source/tests/cdk_solution_helper/test_cdk_interfaces.py +++ b/source/tests/cdk_solution_helper/test_cdk_interfaces.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from pathlib import Path diff --git a/source/tests/cdk_solution_helper/test_cfn_nag_suppressions.py b/source/tests/cdk_solution_helper/test_cfn_nag_suppressions.py index 4b998b3..a8de6b9 100644 --- a/source/tests/cdk_solution_helper/test_cfn_nag_suppressions.py +++ b/source/tests/cdk_solution_helper/test_cfn_nag_suppressions.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from aws_cdk import CfnResource, App, Stack diff --git a/source/tests/cdk_solution_helper/test_helpers.py b/source/tests/cdk_solution_helper/test_helpers.py index c75d191..ce8f351 100644 --- a/source/tests/cdk_solution_helper/test_helpers.py +++ b/source/tests/cdk_solution_helper/test_helpers.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import os diff --git a/source/tests/cdk_solution_helper/test_interfaces.py b/source/tests/cdk_solution_helper/test_interfaces.py index 5e1c522..110588d 100644 --- a/source/tests/cdk_solution_helper/test_interfaces.py +++ b/source/tests/cdk_solution_helper/test_interfaces.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import json from pathlib import Path diff --git a/source/tests/cdk_solution_helper/test_logging.py b/source/tests/cdk_solution_helper/test_logging.py index e8c4c9d..756122a 100644 --- a/source/tests/cdk_solution_helper/test_logging.py +++ b/source/tests/cdk_solution_helper/test_logging.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import logging import os diff --git a/source/tests/cdk_solution_helper/test_mappings.py b/source/tests/cdk_solution_helper/test_mappings.py index a2db796..a5179b2 100644 --- a/source/tests/cdk_solution_helper/test_mappings.py +++ b/source/tests/cdk_solution_helper/test_mappings.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + import pytest from aws_cdk import App, Stack diff --git a/source/tests/cdk_solution_helper/test_solution_config.py b/source/tests/cdk_solution_helper/test_solution_config.py index acf97c9..c83b529 100644 --- a/source/tests/cdk_solution_helper/test_solution_config.py +++ b/source/tests/cdk_solution_helper/test_solution_config.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import os diff --git a/source/tests/cdk_solution_helper/test_stack.py b/source/tests/cdk_solution_helper/test_stack.py index ceea7f1..9b308df 100644 --- a/source/tests/cdk_solution_helper/test_stack.py +++ b/source/tests/cdk_solution_helper/test_stack.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import re diff --git a/source/tests/cdk_solution_helper/test_synthesizers.py b/source/tests/cdk_solution_helper/test_synthesizers.py index 0d254da..7eec573 100644 --- a/source/tests/cdk_solution_helper/test_synthesizers.py +++ b/source/tests/cdk_solution_helper/test_synthesizers.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import os @@ -35,7 +25,6 @@ def template(): "SOLUTION_VERSION": "v1.0.0", "SOLUTION_NAME": "test-solution-name", "BUCKET_NAME": "test-solution-bucket", - "APP_REGISTRY_NAME": "test-solution-name", } for ctx_var in ["SOLUTIONS_ASSETS_GLOBAL", "SOLUTIONS_ASSETS_REGIONAL"]: ctx_var_val = os.environ.get(ctx_var) @@ -54,7 +43,6 @@ def template(): yield app.synth().stacks[0].template - def test_cloudformation_template_init(template): assert template["Parameters"] assert template["Rules"]["CheckBootstrapVersion"] @@ -72,7 +60,6 @@ def test_cloudformation_template_init_metadata(solution_build_environment, templ "Version": "v1.0.0", "SendAnonymousUsageData": "Yes", "SolutionName": "test-solution-name", - "AppRegistryName": "test-solution-name", "ApplicationType": "AWS-Solutions", } } diff --git a/source/tests/cdk_solution_helper/tools/test_cleaner.py b/source/tests/cdk_solution_helper/tools/test_cleaner.py index 59c50fc..3919f6b 100644 --- a/source/tests/cdk_solution_helper/tools/test_cleaner.py +++ b/source/tests/cdk_solution_helper/tools/test_cleaner.py @@ -1,15 +1,5 @@ -# ##################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ##################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 from pathlib import Path diff --git a/source/tests/conftest.py b/source/tests/conftest.py index e20aa72..c573772 100644 --- a/source/tests/conftest.py +++ b/source/tests/conftest.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + import json import os import sys @@ -20,14 +11,7 @@ import boto3 import jsii import pytest -from aws_cdk.aws_lambda import ( - Code, - Function, - FunctionProps, - LayerVersion, - LayerVersionProps, - Runtime, -) +from aws_cdk.aws_lambda import Code, Function, FunctionProps, LayerVersion, LayerVersionProps, Runtime from aws_solutions.cdk.synthesizers import SolutionStackSubstitutions from aws_solutions.core import get_service_client from botocore.stub import Stubber @@ -53,7 +37,6 @@ def context(self): "SOLUTION_NAME": "Maintaining Personalized Experiences with Machine Learning", "SOLUTION_ID": self.id, "SOLUTION_VERSION": self.version, - "APP_REGISTRY_NAME": "personalized-experiences-ML", "APPLICATION_TYPE": "AWS-Solutions", "@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy": True, } @@ -209,6 +192,17 @@ def notifier_stubber(mocker): yield notifier +@pytest.fixture(autouse=True) +def mock_aws_helpers(mocker): + """Automatically mock AWS helper functions for all tests to avoid real AWS calls""" + mocker.patch("shared.resource.base.get_aws_account", return_value="111111111111") + mocker.patch("shared.resource.base.get_aws_region", return_value="us-east-1") + mocker.patch("shared.resource.base.get_aws_partition", return_value="aws") + mocker.patch("shared.personalize_service.get_aws_account", return_value="111111111111") + mocker.patch("shared.personalize_service.get_aws_region", return_value="us-east-1") + mocker.patch("shared.personalize_service.get_aws_partition", return_value="aws") + + @pytest.fixture def validate_handler_config(): """Validates a handler configuration against the installed botocore shapes""" diff --git a/source/tests/test_deploy.py b/source/tests/test_deploy.py index fabd994..f517921 100644 --- a/source/tests/test_deploy.py +++ b/source/tests/test_deploy.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import pytest diff --git a/source/tests/test_notifies.py b/source/tests/test_notifies.py index 0b5af84..99b27dd 100644 --- a/source/tests/test_notifies.py +++ b/source/tests/test_notifies.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + from datetime import datetime, timedelta from typing import Dict diff --git a/source/tests/test_personalize_stack.py b/source/tests/test_personalize_stack.py index 48dc2c5..e660490 100644 --- a/source/tests/test_personalize_stack.py +++ b/source/tests/test_personalize_stack.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import pytest from aws_cdk import App @@ -23,7 +13,6 @@ def emails_context(): "SOLUTION_NAME": "Maintaining Personalized Experiences with Machine Learning", "SOLUTION_ID": "99.99.99", "SOLUTION_VERSION": "SO0170test", - "APP_REGISTRY_NAME": "personalized-experiences-ML", "APPLICATION_TYPE": "AWS-Solutions", "@aws-cdk/aws-s3:serverAccessLogsUseBucketPolicy": True, "BUCKET_NAME": "test-solution-bucket", @@ -32,7 +21,7 @@ def emails_context(): def test_personalize_stack_email(solution, emails_context, monkeypatch): app = App(context=emails_context) - + PersonalizeStack( app, "PersonalizeStack", diff --git a/source/tests/test_resources.py b/source/tests/test_resources.py index b978586..6595c9f 100644 --- a/source/tests/test_resources.py +++ b/source/tests/test_resources.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import pytest diff --git a/source/tests/test_scheduler.py b/source/tests/test_scheduler.py index cd05f61..b2274f4 100644 --- a/source/tests/test_scheduler.py +++ b/source/tests/test_scheduler.py @@ -1,15 +1,6 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 + import json import os diff --git a/source/tests/test_scheduler_cli.py b/source/tests/test_scheduler_cli.py index 00bc01f..0d148ef 100644 --- a/source/tests/test_scheduler_cli.py +++ b/source/tests/test_scheduler_cli.py @@ -1,15 +1,5 @@ -# ###################################################################################################################### -# 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. You may obtain a copy of the License at # -# # -# http://www.apache.org/licenses/LICENSE-2.0 # -# # -# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed # -# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for # -# the specific language governing permissions and limitations under the License. # -# ###################################################################################################################### +# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: Apache-2.0 import pytest import json