From 0cad5db795c4d733910696ead475b881cc331eee Mon Sep 17 00:00:00 2001 From: Simon Kok Date: Mon, 8 Apr 2024 16:29:14 +0200 Subject: [PATCH 1/8] Update copyright statements and license info (#713) **Why?** The year is no longer required in our Copyright statements. Additionally, some files were missing a Copyright / license statement, while it is a best practice to add one. **What?** * Add/update copyright statement, * Add Apache-2.0 license, except for Lambda Functions, these should have MIT-0 instead. Since most of our code is in the initial-commit Lambda Function, these files are under the MIT-0 license. With the exception of CloudFormation templates. --- Makefile | 2 +- Makefile.tox | 2 +- NOTICE.md | 2 +- resources/OrganizationAccountAccessRole.yaml | 3 +++ samples/sample-cdk-app/buildspec.yml | 3 +++ samples/sample-cdk-app/handler.py | 3 +++ samples/sample-cdk-app/index.ts | 3 +++ samples/sample-codebuild-vpc/buildspec.yml | 3 +++ samples/sample-codebuild-vpc/params/global.yml | 3 +++ samples/sample-codebuild-vpc/template.yml | 4 ++-- samples/sample-codebuild-vpc/testspec.yml | 3 +++ samples/sample-ec2-java-app-codedeploy/appspec.yml | 3 +++ samples/sample-ec2-java-app-codedeploy/buildspec.yml | 3 +++ samples/sample-ec2-java-app-codedeploy/pom.xml | 3 +++ samples/sample-ec2-java-app-codedeploy/scripts/start.sh | 3 +++ samples/sample-ec2-java-app-codedeploy/scripts/stop.sh | 3 +++ samples/sample-ec2-java-app-codedeploy/scripts/validate.sh | 3 +++ .../src/main/java/hello/Application.java | 3 +++ .../src/resources/application.yml | 3 +++ samples/sample-ec2-with-codedeploy/buildspec.yml | 3 +++ samples/sample-ec2-with-codedeploy/params/global.yml | 3 +++ .../scripts/install-codedeploy.sh | 3 +++ samples/sample-ec2-with-codedeploy/scripts/install-deps.sh | 3 +++ samples/sample-ec2-with-codedeploy/template.yml | 4 ++-- samples/sample-ecr-repository/buildspec.yml | 3 +++ samples/sample-ecr-repository/params/global.yml | 3 +++ samples/sample-ecr-repository/template.yml | 4 ++-- samples/sample-ecs-cluster/buildspec.yml | 3 +++ samples/sample-ecs-cluster/params/banking-production.yml | 3 +++ samples/sample-ecs-cluster/params/global.yml | 3 +++ samples/sample-ecs-cluster/template.yml | 4 ++-- samples/sample-etl-pipeline/scripts/some_etl_script.sh | 3 +++ samples/sample-expunge-vpc/build-lambda.sh | 3 +++ samples/sample-expunge-vpc/buildspec.yml | 3 +++ .../sample-expunge-vpc/src/lambda_vpc/lambda_function.py | 3 +++ samples/sample-expunge-vpc/template.yml | 3 +++ samples/sample-fargate-node-app/Dockerfile | 3 +++ samples/sample-fargate-node-app/build/docker.sh | 3 +++ .../sample-fargate-node-app/build/generate_parameters.sh | 3 +++ samples/sample-fargate-node-app/buildspec.yml | 3 +++ samples/sample-fargate-node-app/index.js | 3 +++ samples/sample-fargate-node-app/package.json | 2 +- .../sample-fargate-node-app/params/banking-production.yml | 3 +++ samples/sample-fargate-node-app/params/global.yml | 3 +++ samples/sample-fargate-node-app/public/main.css | 3 +++ samples/sample-fargate-node-app/template.yml | 4 ++-- samples/sample-fargate-node-app/views/index.ejs | 3 +++ samples/sample-iam/buildspec.yml | 3 +++ samples/sample-iam/params/global.yml | 3 +++ samples/sample-iam/template.yml | 4 ++-- samples/sample-mono-repo/apps/alpha/buildspec.yml | 3 +++ samples/sample-mono-repo/apps/alpha/params/global.yml | 3 +++ samples/sample-mono-repo/apps/alpha/template.yml | 4 ++-- samples/sample-mono-repo/apps/beta/buildspec.yml | 3 +++ samples/sample-mono-repo/apps/beta/params/global.yml | 3 +++ samples/sample-mono-repo/apps/beta/template.yml | 4 ++-- samples/sample-rdk-rules/buildspec.yml | 3 +++ .../EC2_CHECKS_TERMINATION_PROTECTION_ADF.py | 3 +++ .../EC2_CHECKS_TERMINATION_PROTECTION_ADF_test.py | 3 +++ samples/sample-rdk-rules/lambda_helper.py | 3 +++ samples/sample-serverless-app/build/generate_parameters.sh | 3 +++ samples/sample-serverless-app/buildspec.yml | 3 +++ samples/sample-serverless-app/handler.py | 3 +++ samples/sample-serverless-app/template.yml | 4 ++-- samples/sample-service-catalog-product/buildspec.yml | 3 +++ samples/sample-service-catalog-product/params/global.yml | 3 +++ .../sample-service-catalog-product/productX/template.yml | 4 ++-- samples/sample-service-catalog-product/template.yml | 4 ++-- samples/sample-terraform/buildspec.yml | 3 +++ samples/sample-terraform/params/global.yml | 3 +++ samples/sample-terraform/tf/backend.tf | 3 +++ samples/sample-terraform/tf/main.tf | 3 +++ samples/sample-terraform/tf/s3.tf | 3 +++ samples/sample-terraform/tf/variables.tf | 3 +++ samples/sample-terraform/tf_apply.yml | 3 +++ samples/sample-terraform/tf_destroy.yml | 3 +++ samples/sample-terraform/tf_plan.yml | 3 +++ samples/sample-terraform/tf_scan.yml | 3 +++ samples/sample-vpc/buildspec.yml | 3 +++ samples/sample-vpc/params/banking-production.yml | 3 +++ samples/sample-vpc/params/global.yml | 3 +++ samples/sample-vpc/template.yml | 4 ++-- src/lambda_codebase/__init__.py | 2 +- src/lambda_codebase/account/handler.py | 2 +- src/lambda_codebase/account/main.py | 3 ++- src/lambda_codebase/account/pytest.ini | 3 +++ src/lambda_codebase/account/tests/__init__.py | 2 +- src/lambda_codebase/account/tests/test_main.py | 2 +- src/lambda_codebase/account_bootstrap.py | 2 +- src/lambda_codebase/account_processing/__init__.py | 4 ++++ .../account_processing/configure_account_alias.py | 2 +- .../account_processing/configure_account_ou.py | 2 +- .../account_processing/configure_account_regions.py | 2 +- .../account_processing/configure_account_tags.py | 2 +- src/lambda_codebase/account_processing/create_account.py | 2 +- .../account_processing/delete_default_vpc.py | 2 +- .../account_processing/get_account_regions.py | 2 +- .../account_processing/process_account_files.py | 2 +- src/lambda_codebase/account_processing/pytest.ini | 4 +++- .../account_processing/register_account_for_support.py | 2 +- src/lambda_codebase/account_processing/tests/__init__.py | 4 ++++ .../account_processing/tests/test_account_alias.py | 3 +++ .../account_processing/tests/test_account_creation.py | 3 +++ .../tests/test_account_file_processing.py | 3 +++ .../account_processing/tests/test_account_tags.py | 3 +++ .../tests/test_configure_account_regions.py | 3 +++ .../account_processing/tests/test_get_default_regions.py | 3 +++ src/lambda_codebase/cross_region_bucket/handler.py | 2 +- src/lambda_codebase/cross_region_bucket/main.py | 2 +- src/lambda_codebase/deployment_account_config.py | 6 +++--- src/lambda_codebase/determine_event.py | 2 +- src/lambda_codebase/event.py | 2 +- src/lambda_codebase/generic_account_config.py | 3 +-- src/lambda_codebase/initial_commit/adf.yml.j2 | 3 +++ src/lambda_codebase/initial_commit/adfconfig.yml.j2 | 4 +++- .../adf-bootstrap/deployment/example-global-iam.yml | 5 +++-- .../adf-bootstrap/deployment/global.yml | 4 ++-- .../adf-bootstrap/deployment/lambda_codebase/__init__.py | 4 +++- .../determine_default_branch/determine_default_branch.py | 3 +++ .../lambda_codebase/determine_default_branch/handler.py | 3 +++ .../lambda_codebase/determine_default_branch/pytest.ini | 3 +++ .../determine_default_branch/tests/__init__.py | 2 +- .../tests/test_determine_default_branch.py | 2 +- .../lambda_codebase/enable_cross_account_access.py | 3 +-- .../lambda_codebase/iam_cfn_deploy_role_policy.py | 2 +- .../deployment/lambda_codebase/initial_commit/handler.py | 3 +++ .../lambda_codebase/initial_commit/initial_commit.py | 3 +++ .../pipelines_repository/example-deployment_map.yml | 3 +++ .../deployment/lambda_codebase/initial_commit/pytest.ini | 3 +++ .../lambda_codebase/initial_commit/tests/__init__.py | 2 +- .../initial_commit/tests/test_initial_commit.py | 2 +- .../pipeline_management/create_or_update_rule.py | 3 +++ .../pipeline_management/create_repository.py | 3 +++ .../pipeline_management/generate_pipeline_inputs.py | 3 +++ .../pipeline_management/identify_out_of_date_pipelines.py | 3 +++ .../pipeline_management/process_deployment_map.py | 3 +++ .../pipeline_management/store_pipeline_definition.py | 3 +++ .../pipeline_management/templates/codecommit.yml | 4 ++-- .../pipeline_management/templates/events.yml | 4 ++-- .../adf-bootstrap/deployment/lambda_codebase/pytest.ini | 3 +++ .../adf-bootstrap/deployment/lambda_codebase/slack.py | 2 +- .../deployment/lambda_codebase/tests/__init__.py | 2 +- .../deployment/lambda_codebase/tests/stubs/__init__.py | 2 +- .../deployment/lambda_codebase/tests/stubs/slack.py | 2 +- .../deployment/lambda_codebase/tests/stubs/stub_iam.py | 2 +- .../tests/test_iam_cfn_deploy_role_policy.py | 2 +- .../deployment/lambda_codebase/tests/test_slack.py | 2 +- .../deployment/lambda_codebase/update_pipelines.py | 2 +- .../adf-bootstrap/deployment/pipeline_management.yml | 3 +++ .../adf-bootstrap/deployment/regional.yml | 4 ++-- .../adf-bootstrap/example-global-iam.yml | 4 ++-- .../bootstrap_repository/adf-bootstrap/global.yml | 4 ++-- .../bootstrap_repository/adf-build/__init__.py | 2 +- .../initial_commit/bootstrap_repository/adf-build/config.py | 2 +- .../bootstrap_repository/adf-build/global.yml | 4 ++-- .../initial_commit/bootstrap_repository/adf-build/main.py | 2 +- .../bootstrap_repository/adf-build/organization_policy.py | 2 +- .../adf-build/provisioner/src/__init__.py | 2 +- .../adf-build/provisioner/src/account.py | 2 +- .../adf-build/provisioner/src/configparser.py | 2 +- .../adf-build/provisioner/src/support.py | 3 +++ .../bootstrap_repository/adf-build/provisioner/src/vpc.py | 2 +- .../bootstrap_repository/adf-build/shared/__init__.py | 2 +- .../bootstrap_repository/adf-build/shared/base_resolver.py | 2 +- .../bootstrap_repository/adf-build/shared/cdk/__init__.py | 2 +- .../adf-build/shared/cdk/cdk_constructs/__init__.py | 2 +- .../adf-build/shared/cdk/cdk_constructs/adf_chatbot.py | 2 +- .../shared/cdk/cdk_constructs/adf_cloudformation.py | 2 +- .../adf-build/shared/cdk/cdk_constructs/adf_codebuild.py | 2 +- .../adf-build/shared/cdk/cdk_constructs/adf_codecommit.py | 2 +- .../adf-build/shared/cdk/cdk_constructs/adf_codepipeline.py | 2 +- .../adf-build/shared/cdk/cdk_constructs/adf_codestar.py | 4 ++-- .../adf-build/shared/cdk/cdk_constructs/adf_events.py | 2 +- .../adf-build/shared/cdk/cdk_constructs/adf_github.py | 2 +- .../adf-build/shared/cdk/cdk_constructs/adf_jenkins.py | 2 +- .../shared/cdk/cdk_constructs/adf_notifications.py | 2 +- .../adf-build/shared/cdk/cdk_constructs/adf_s3.py | 2 +- .../adf-build/shared/cdk/cdk_constructs/tests/__init__.py | 2 +- .../cdk_constructs/tests/adf_codepipeline_test_constants.py | 3 +-- .../cdk_constructs/tests/test_adf_codebuild_buildspec.py | 2 +- .../tests/test_adf_codebuild_determine_build_image.py | 2 +- .../cdk_constructs/tests/test_adf_codepipeline_generate.py | 2 +- .../tests/test_adf_codepipeline_input_artifacts.py | 2 +- .../tests/test_adf_codepipeline_output_artifacts.py | 2 +- .../adf-build/shared/cdk/cdk_stacks/__init__.py | 2 ++ .../adf-build/shared/cdk/cdk_stacks/tests/__init__.py | 2 ++ .../adf-build/shared/cdk/clean_pipelines.py | 2 +- .../adf-build/shared/cdk/execute_pipeline_stacks.py | 2 +- .../adf-build/shared/cdk/generate_pipeline_stacks.py | 2 +- .../bootstrap_repository/adf-build/shared/cdk/pytest.ini | 3 +++ .../adf-build/shared/generate_params.py | 2 +- .../adf-build/shared/helpers/__init__.py | 2 +- .../shared/helpers/describe_codepipeline_trigger.py | 3 ++- .../adf-build/shared/helpers/package_transform.sh | 5 ++++- .../adf-build/shared/helpers/pytest.ini | 3 +++ .../shared/helpers/retrieve_organization_accounts.py | 3 +++ .../bootstrap_repository/adf-build/shared/helpers/sts.sh | 3 +++ .../adf-build/shared/helpers/sync_to_s3.py | 3 ++- .../adf-build/shared/helpers/terraform/adf_terraform.sh | 4 ++++ .../adf-build/shared/helpers/terraform/get_accounts.py | 2 +- .../adf-build/shared/helpers/terraform/install_terraform.sh | 4 ++++ .../adf-build/shared/helpers/tests/__init__.py | 2 +- .../adf-build/shared/helpers/tests/test_sync_to_s3.py | 3 +++ .../bootstrap_repository/adf-build/shared/pytest.ini | 3 +++ .../adf-build/shared/python/__init__.py | 2 +- .../bootstrap_repository/adf-build/shared/python/cache.py | 2 +- .../adf-build/shared/python/cloudformation.py | 2 +- .../adf-build/shared/python/cloudwatch.py | 3 +++ .../adf-build/shared/python/codepipeline.py | 3 +-- .../adf-build/shared/python/deployment_map.py | 2 +- .../bootstrap_repository/adf-build/shared/python/errors.py | 2 +- .../adf-build/shared/python/list_utils.py | 2 +- .../bootstrap_repository/adf-build/shared/python/logger.py | 2 +- .../adf-build/shared/python/organizations.py | 2 +- .../adf-build/shared/python/paginator.py | 2 +- .../adf-build/shared/python/parameter_store.py | 2 +- .../adf-build/shared/python/partition.py | 3 ++- .../adf-build/shared/python/pipeline.py | 2 +- .../bootstrap_repository/adf-build/shared/python/pytest.ini | 3 +++ .../bootstrap_repository/adf-build/shared/python/repo.py | 2 +- .../bootstrap_repository/adf-build/shared/python/rule.py | 2 +- .../bootstrap_repository/adf-build/shared/python/s3.py | 2 +- .../adf-build/shared/python/schema_validation.py | 2 +- .../adf-build/shared/python/stepfunctions.py | 2 +- .../bootstrap_repository/adf-build/shared/python/sts.py | 2 +- .../bootstrap_repository/adf-build/shared/python/target.py | 2 +- .../adf-build/shared/python/tests/__init__.py | 2 +- .../adf-build/shared/python/tests/stubs/__init__.py | 2 +- .../shared/python/tests/stubs/stub_cloudformation.py | 2 +- .../shared/python/tests/stubs/stub_codepipeline.py | 3 +-- .../shared/python/tests/stubs/stub_deployment_map.yml | 3 +++ .../adf-build/shared/python/tests/stubs/stub_event.py | 2 +- .../adf-build/shared/python/tests/stubs/stub_kms.py | 2 +- .../shared/python/tests/stubs/stub_organizations.py | 2 +- .../shared/python/tests/stubs/stub_parameter_store.py | 2 +- .../adf-build/shared/python/tests/stubs/stub_s3.py | 2 +- .../shared/python/tests/stubs/stub_step_functions.py | 2 +- .../adf-build/shared/python/tests/stubs/stub_target.py | 2 +- .../adf-build/shared/python/tests/test_cache.py | 2 +- .../adf-build/shared/python/tests/test_cloudformation.py | 2 +- .../adf-build/shared/python/tests/test_codepipeline.py | 2 +- .../adf-build/shared/python/tests/test_deployment_map.py | 2 +- .../adf-build/shared/python/tests/test_list_utils.py | 2 +- .../adf-build/shared/python/tests/test_organizations.py | 2 +- .../adf-build/shared/python/tests/test_parameter_store.py | 2 +- .../adf-build/shared/python/tests/test_partition.py | 3 +++ .../adf-build/shared/python/tests/test_pipeline.py | 2 +- .../adf-build/shared/python/tests/test_s3.py | 2 +- .../adf-build/shared/python/tests/test_schema_validation.py | 3 +++ .../adf-build/shared/python/tests/test_step_functions.py | 2 +- .../adf-build/shared/python/tests/test_target.py | 2 +- .../bootstrap_repository/adf-build/shared/python/thread.py | 3 +-- .../bootstrap_repository/adf-build/shared/resolver.py | 2 +- .../adf-build/shared/resolver_param_store.py | 2 +- .../adf-build/shared/resolver_stack_output.py | 2 +- .../adf-build/shared/resolver_upload.py | 2 +- .../adf-build/shared/templates/codecommit.yml | 4 ++-- .../adf-build/shared/templates/events.yml | 4 ++-- .../bootstrap_repository/adf-build/shared/tests/__init__.py | 2 +- .../adf-build/shared/tests/stubs/__init__.py | 2 +- .../parameter_environment_acceptance_tag_project_a.yml | 3 +++ .../adf-build/shared/tests/stubs/stub_cfn_global.yml | 3 +++ .../adf-build/shared/tests/test_generate_params.py | 2 +- .../bootstrap_repository/adf-build/store_config.py | 2 +- .../bootstrap_repository/adf-build/tests/__init__.py | 2 +- .../adf-build/tests/stubs/stub_adfconfig.yml | 3 +++ .../bootstrap_repository/adf-build/tests/test_config.py | 2 +- .../bootstrap_repository/adf-build/tests/test_main.py | 2 +- .../bootstrap_repository/example-adfconfig.yml | 3 +++ .../initial_commit/bootstrap_repository/pytest.ini | 3 +++ .../initial_commit/bootstrap_repository/tox.ini | 3 +++ src/lambda_codebase/initial_commit/handler.py | 3 +++ src/lambda_codebase/initial_commit/initial_commit.py | 3 +++ src/lambda_codebase/initial_commit/pytest.ini | 3 +++ src/lambda_codebase/initial_commit/tests/__init__.py | 2 +- .../initial_commit/tests/test_initial_commit.py | 2 +- src/lambda_codebase/moved_to_root.py | 2 +- src/lambda_codebase/organization/handler.py | 2 +- src/lambda_codebase/organization/main.py | 2 +- src/lambda_codebase/organization_unit/handler.py | 2 +- src/lambda_codebase/organization_unit/main.py | 2 +- src/lambda_codebase/wait_until_complete.py | 2 +- src/template.yml | 4 ++-- tox.ini | 3 +++ 284 files changed, 560 insertions(+), 199 deletions(-) diff --git a/Makefile b/Makefile index 124febc23..5395a39b8 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: Apache-2.0 # Makefile versions diff --git a/Makefile.tox b/Makefile.tox index 0c8d8521a..912392175 100644 --- a/Makefile.tox +++ b/Makefile.tox @@ -1,4 +1,4 @@ -# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: Apache-2.0 # Files to work with diff --git a/NOTICE.md b/NOTICE.md index ee3e86b40..8d1be5488 100644 --- a/NOTICE.md +++ b/NOTICE.md @@ -2,4 +2,4 @@ AWS Deployment Framework -Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +Copyright Amazon.com Inc. or its affiliates. diff --git a/resources/OrganizationAccountAccessRole.yaml b/resources/OrganizationAccountAccessRole.yaml index 7711704cb..f1a359200 100644 --- a/resources/OrganizationAccountAccessRole.yaml +++ b/resources/OrganizationAccountAccessRole.yaml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + AWSTemplateFormatVersion: "2010-09-09" Description: >- Organizational Account Access Role for Cross-Account automation diff --git a/samples/sample-cdk-app/buildspec.yml b/samples/sample-cdk-app/buildspec.yml index 6fe2b146f..3ddbd5003 100644 --- a/samples/sample-cdk-app/buildspec.yml +++ b/samples/sample-cdk-app/buildspec.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + version: 0.2 phases: diff --git a/samples/sample-cdk-app/handler.py b/samples/sample-cdk-app/handler.py index 021dc6519..ed280a2ae 100644 --- a/samples/sample-cdk-app/handler.py +++ b/samples/sample-cdk-app/handler.py @@ -1,2 +1,5 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + def main(event, context): print("I'm running!") diff --git a/samples/sample-cdk-app/index.ts b/samples/sample-cdk-app/index.ts index 677ca5765..27c7272a6 100644 --- a/samples/sample-cdk-app/index.ts +++ b/samples/sample-cdk-app/index.ts @@ -1,3 +1,6 @@ +// Copyright Amazon.com Inc. or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + import events = require('@aws-cdk/aws-events'); import targets = require('@aws-cdk/aws-events-targets'); import lambda = require('@aws-cdk/aws-lambda'); diff --git a/samples/sample-codebuild-vpc/buildspec.yml b/samples/sample-codebuild-vpc/buildspec.yml index 3f6ef2309..fd64374bd 100644 --- a/samples/sample-codebuild-vpc/buildspec.yml +++ b/samples/sample-codebuild-vpc/buildspec.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + version: 0.2 phases: diff --git a/samples/sample-codebuild-vpc/params/global.yml b/samples/sample-codebuild-vpc/params/global.yml index 89f82f3ab..e6ca8bbc5 100644 --- a/samples/sample-codebuild-vpc/params/global.yml +++ b/samples/sample-codebuild-vpc/params/global.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + Tags: Repository: sample-codebuild-vpc-repo App: Sample CodeBuild VPC application diff --git a/samples/sample-codebuild-vpc/template.yml b/samples/sample-codebuild-vpc/template.yml index c84eff6b6..765755bde 100644 --- a/samples/sample-codebuild-vpc/template.yml +++ b/samples/sample-codebuild-vpc/template.yml @@ -1,5 +1,5 @@ -# // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. -# // SPDX-License-Identifier: Apache-2.0 +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 AWSTemplateFormatVersion: '2010-09-09' Description: ADF CloudFormation Sample Template diff --git a/samples/sample-codebuild-vpc/testspec.yml b/samples/sample-codebuild-vpc/testspec.yml index de0bfb94a..5a01edfcf 100644 --- a/samples/sample-codebuild-vpc/testspec.yml +++ b/samples/sample-codebuild-vpc/testspec.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + version: 0.2 phases: diff --git a/samples/sample-ec2-java-app-codedeploy/appspec.yml b/samples/sample-ec2-java-app-codedeploy/appspec.yml index 99a02bc57..ad4633d37 100644 --- a/samples/sample-ec2-java-app-codedeploy/appspec.yml +++ b/samples/sample-ec2-java-app-codedeploy/appspec.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + version: 0.0 os: linux diff --git a/samples/sample-ec2-java-app-codedeploy/buildspec.yml b/samples/sample-ec2-java-app-codedeploy/buildspec.yml index ce70f06b8..49792a062 100644 --- a/samples/sample-ec2-java-app-codedeploy/buildspec.yml +++ b/samples/sample-ec2-java-app-codedeploy/buildspec.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + version: 0.2 phases: diff --git a/samples/sample-ec2-java-app-codedeploy/pom.xml b/samples/sample-ec2-java-app-codedeploy/pom.xml index 4d3e62561..750b24e40 100644 --- a/samples/sample-ec2-java-app-codedeploy/pom.xml +++ b/samples/sample-ec2-java-app-codedeploy/pom.xml @@ -1,3 +1,6 @@ + + + diff --git a/samples/sample-ec2-java-app-codedeploy/scripts/start.sh b/samples/sample-ec2-java-app-codedeploy/scripts/start.sh index 649b805f9..6287f2e68 100755 --- a/samples/sample-ec2-java-app-codedeploy/scripts/start.sh +++ b/samples/sample-ec2-java-app-codedeploy/scripts/start.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + cd /home/ec2-user/server sudo /usr/bin/java -jar -Dserver.port=80 \ *.jar > /dev/null 2> /dev/null < /dev/null & diff --git a/samples/sample-ec2-java-app-codedeploy/scripts/stop.sh b/samples/sample-ec2-java-app-codedeploy/scripts/stop.sh index b20ff5949..f028bea4a 100755 --- a/samples/sample-ec2-java-app-codedeploy/scripts/stop.sh +++ b/samples/sample-ec2-java-app-codedeploy/scripts/stop.sh @@ -1,4 +1,7 @@ #!/usr/bin/env bash +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + sudo killall java exit 0 diff --git a/samples/sample-ec2-java-app-codedeploy/scripts/validate.sh b/samples/sample-ec2-java-app-codedeploy/scripts/validate.sh index 30b9c8668..be90adf22 100755 --- a/samples/sample-ec2-java-app-codedeploy/scripts/validate.sh +++ b/samples/sample-ec2-java-app-codedeploy/scripts/validate.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + echo "Waiting for 15 seconds before checking health.." sleep 15 diff --git a/samples/sample-ec2-java-app-codedeploy/src/main/java/hello/Application.java b/samples/sample-ec2-java-app-codedeploy/src/main/java/hello/Application.java index b87ae5390..2b00894e0 100644 --- a/samples/sample-ec2-java-app-codedeploy/src/main/java/hello/Application.java +++ b/samples/sample-ec2-java-app-codedeploy/src/main/java/hello/Application.java @@ -1,3 +1,6 @@ +// Copyright Amazon.com Inc. or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + package hello; import org.springframework.boot.SpringApplication; diff --git a/samples/sample-ec2-java-app-codedeploy/src/resources/application.yml b/samples/sample-ec2-java-app-codedeploy/src/resources/application.yml index 351e62e9c..0baa50eae 100644 --- a/samples/sample-ec2-java-app-codedeploy/src/resources/application.yml +++ b/samples/sample-ec2-java-app-codedeploy/src/resources/application.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + server: port: 8080 diff --git a/samples/sample-ec2-with-codedeploy/buildspec.yml b/samples/sample-ec2-with-codedeploy/buildspec.yml index 6a1fec8e0..ded1b65a2 100644 --- a/samples/sample-ec2-with-codedeploy/buildspec.yml +++ b/samples/sample-ec2-with-codedeploy/buildspec.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + version: 0.2 phases: diff --git a/samples/sample-ec2-with-codedeploy/params/global.yml b/samples/sample-ec2-with-codedeploy/params/global.yml index 841df8a2b..b943f40bd 100644 --- a/samples/sample-ec2-with-codedeploy/params/global.yml +++ b/samples/sample-ec2-with-codedeploy/params/global.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + Parameters: Environment: testing ApplicationName: sample diff --git a/samples/sample-ec2-with-codedeploy/scripts/install-codedeploy.sh b/samples/sample-ec2-with-codedeploy/scripts/install-codedeploy.sh index 96a9d1af5..68191cc9f 100755 --- a/samples/sample-ec2-with-codedeploy/scripts/install-codedeploy.sh +++ b/samples/sample-ec2-with-codedeploy/scripts/install-codedeploy.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + set -xe ## Code Deploy Agent Bootstrap Script ## diff --git a/samples/sample-ec2-with-codedeploy/scripts/install-deps.sh b/samples/sample-ec2-with-codedeploy/scripts/install-deps.sh index 874e4f050..286723b72 100755 --- a/samples/sample-ec2-with-codedeploy/scripts/install-deps.sh +++ b/samples/sample-ec2-with-codedeploy/scripts/install-deps.sh @@ -1,5 +1,8 @@ #!/bin/bash +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + # install apache httpd sudo yum install httpd -y diff --git a/samples/sample-ec2-with-codedeploy/template.yml b/samples/sample-ec2-with-codedeploy/template.yml index 4678f740f..fc4621830 100644 --- a/samples/sample-ec2-with-codedeploy/template.yml +++ b/samples/sample-ec2-with-codedeploy/template.yml @@ -1,5 +1,5 @@ -# // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# // SPDX-License-Identifier: Apache-2.0 +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 AWSTemplateFormatVersion: '2010-09-09' Description: ADF CloudFormation Sample Template (EC2 Application with CodeDeploy Components) diff --git a/samples/sample-ecr-repository/buildspec.yml b/samples/sample-ecr-repository/buildspec.yml index 6a1fec8e0..ded1b65a2 100644 --- a/samples/sample-ecr-repository/buildspec.yml +++ b/samples/sample-ecr-repository/buildspec.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + version: 0.2 phases: diff --git a/samples/sample-ecr-repository/params/global.yml b/samples/sample-ecr-repository/params/global.yml index a8d470838..6629a4e30 100644 --- a/samples/sample-ecr-repository/params/global.yml +++ b/samples/sample-ecr-repository/params/global.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + Parameters: TestingAccountId: '11111111111' ProductionAccountId: '999999999999' diff --git a/samples/sample-ecr-repository/template.yml b/samples/sample-ecr-repository/template.yml index dd1236d7b..27e1e7a9c 100644 --- a/samples/sample-ecr-repository/template.yml +++ b/samples/sample-ecr-repository/template.yml @@ -1,5 +1,5 @@ -# // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# // SPDX-License-Identifier: Apache-2.0 +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 AWSTemplateFormatVersion: "2010-09-09" Description: ADF CloudFormation Sample Template (Shared ECR Repository) diff --git a/samples/sample-ecs-cluster/buildspec.yml b/samples/sample-ecs-cluster/buildspec.yml index 6a1fec8e0..ded1b65a2 100644 --- a/samples/sample-ecs-cluster/buildspec.yml +++ b/samples/sample-ecs-cluster/buildspec.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + version: 0.2 phases: diff --git a/samples/sample-ecs-cluster/params/banking-production.yml b/samples/sample-ecs-cluster/params/banking-production.yml index 4dc7da870..751758b2b 100644 --- a/samples/sample-ecs-cluster/params/banking-production.yml +++ b/samples/sample-ecs-cluster/params/banking-production.yml @@ -1,2 +1,5 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + Parameters: Environment: production diff --git a/samples/sample-ecs-cluster/params/global.yml b/samples/sample-ecs-cluster/params/global.yml index 64879d90f..d8f28ecfd 100644 --- a/samples/sample-ecs-cluster/params/global.yml +++ b/samples/sample-ecs-cluster/params/global.yml @@ -1,2 +1,5 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + Parameters: Environment: testing diff --git a/samples/sample-ecs-cluster/template.yml b/samples/sample-ecs-cluster/template.yml index b75cc9d6b..8119f437a 100644 --- a/samples/sample-ecs-cluster/template.yml +++ b/samples/sample-ecs-cluster/template.yml @@ -1,5 +1,5 @@ -# // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# // SPDX-License-Identifier: Apache-2.0 +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 # This Template builds on top of the great work of Nathan Pec # => https://github.com/nathanpeck/aws-cloudformation-fargate diff --git a/samples/sample-etl-pipeline/scripts/some_etl_script.sh b/samples/sample-etl-pipeline/scripts/some_etl_script.sh index fb990999f..2447d01ba 100755 --- a/samples/sample-etl-pipeline/scripts/some_etl_script.sh +++ b/samples/sample-etl-pipeline/scripts/some_etl_script.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + set -e echo "Doing some ETL tasks... This could also be done with a custom CodeBuild Image..." diff --git a/samples/sample-expunge-vpc/build-lambda.sh b/samples/sample-expunge-vpc/build-lambda.sh index 88363074f..dd21b1308 100755 --- a/samples/sample-expunge-vpc/build-lambda.sh +++ b/samples/sample-expunge-vpc/build-lambda.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + set -e cd src/lambda_vpc diff --git a/samples/sample-expunge-vpc/buildspec.yml b/samples/sample-expunge-vpc/buildspec.yml index 8552f31a2..f7747999b 100644 --- a/samples/sample-expunge-vpc/buildspec.yml +++ b/samples/sample-expunge-vpc/buildspec.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + version: 0.2 phases: diff --git a/samples/sample-expunge-vpc/src/lambda_vpc/lambda_function.py b/samples/sample-expunge-vpc/src/lambda_vpc/lambda_function.py index 45c57ce6a..5bc1512c1 100644 --- a/samples/sample-expunge-vpc/src/lambda_vpc/lambda_function.py +++ b/samples/sample-expunge-vpc/src/lambda_vpc/lambda_function.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + from crhelper import CfnResource import logging import boto3 diff --git a/samples/sample-expunge-vpc/template.yml b/samples/sample-expunge-vpc/template.yml index 9ae2acd4b..effa4dc08 100644 --- a/samples/sample-expunge-vpc/template.yml +++ b/samples/sample-expunge-vpc/template.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + AWSTemplateFormatVersion: "2010-09-09" Transform: AWS::Serverless-2016-10-31 Description: Deploys the Custom Resource for deleting the default VPC in all regions diff --git a/samples/sample-fargate-node-app/Dockerfile b/samples/sample-fargate-node-app/Dockerfile index 990a2a87d..09e956fc4 100644 --- a/samples/sample-fargate-node-app/Dockerfile +++ b/samples/sample-fargate-node-app/Dockerfile @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + FROM node:current-alpine WORKDIR /app COPY . . diff --git a/samples/sample-fargate-node-app/build/docker.sh b/samples/sample-fargate-node-app/build/docker.sh index 2e628a446..00af49e54 100755 --- a/samples/sample-fargate-node-app/build/docker.sh +++ b/samples/sample-fargate-node-app/build/docker.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + set -e $(aws ecr get-login --region $AWS_REGION --no-include-email) diff --git a/samples/sample-fargate-node-app/build/generate_parameters.sh b/samples/sample-fargate-node-app/build/generate_parameters.sh index bd4e78bc3..f3ee980ed 100755 --- a/samples/sample-fargate-node-app/build/generate_parameters.sh +++ b/samples/sample-fargate-node-app/build/generate_parameters.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + set -e aws s3 cp s3://$S3_BUCKET_NAME/adf-build/ adf-build/ --recursive --quiet diff --git a/samples/sample-fargate-node-app/buildspec.yml b/samples/sample-fargate-node-app/buildspec.yml index 1d52d3e0f..338c0908a 100644 --- a/samples/sample-fargate-node-app/buildspec.yml +++ b/samples/sample-fargate-node-app/buildspec.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + version: 0.2 phases: diff --git a/samples/sample-fargate-node-app/index.js b/samples/sample-fargate-node-app/index.js index 53f7ada70..54271436c 100644 --- a/samples/sample-fargate-node-app/index.js +++ b/samples/sample-fargate-node-app/index.js @@ -1,3 +1,6 @@ +// Copyright Amazon.com Inc. or its affiliates. +// SPDX-License-Identifier: Apache-2.0 + const express = require('express') const app = express() diff --git a/samples/sample-fargate-node-app/package.json b/samples/sample-fargate-node-app/package.json index 60de2701d..fc57c503a 100644 --- a/samples/sample-fargate-node-app/package.json +++ b/samples/sample-fargate-node-app/package.json @@ -8,7 +8,7 @@ "start": "node index.js" }, "author": "", - "license": "ISC", + "license": "Apache-2.0", "dependencies": { "ejs": "^3.1.7", "express": "^4.16.3" diff --git a/samples/sample-fargate-node-app/params/banking-production.yml b/samples/sample-fargate-node-app/params/banking-production.yml index 4dc7da870..751758b2b 100644 --- a/samples/sample-fargate-node-app/params/banking-production.yml +++ b/samples/sample-fargate-node-app/params/banking-production.yml @@ -1,2 +1,5 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + Parameters: Environment: production diff --git a/samples/sample-fargate-node-app/params/global.yml b/samples/sample-fargate-node-app/params/global.yml index 83a9fca47..c49392d8c 100644 --- a/samples/sample-fargate-node-app/params/global.yml +++ b/samples/sample-fargate-node-app/params/global.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + Parameters: Environment: testing ServiceName: sample-node-app diff --git a/samples/sample-fargate-node-app/public/main.css b/samples/sample-fargate-node-app/public/main.css index 62ea76a58..0334353b5 100644 --- a/samples/sample-fargate-node-app/public/main.css +++ b/samples/sample-fargate-node-app/public/main.css @@ -1,3 +1,6 @@ +/* Copyright Amazon.com Inc. or its affiliates. */ +/* SPDX-License-Identifier: Apache-2.0 */ + @import url(https://fonts.googleapis.com/css?family=Signika:700,300,600); html, body { diff --git a/samples/sample-fargate-node-app/template.yml b/samples/sample-fargate-node-app/template.yml index bca67e507..b65912c34 100644 --- a/samples/sample-fargate-node-app/template.yml +++ b/samples/sample-fargate-node-app/template.yml @@ -1,5 +1,5 @@ -# // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# // SPDX-License-Identifier: Apache-2.0 +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 AWSTemplateFormatVersion: '2010-09-09' Description: ADF CloudFormation Sample Template (NodeJS Application) diff --git a/samples/sample-fargate-node-app/views/index.ejs b/samples/sample-fargate-node-app/views/index.ejs index dbaf74f74..42d70cd24 100644 --- a/samples/sample-fargate-node-app/views/index.ejs +++ b/samples/sample-fargate-node-app/views/index.ejs @@ -1,6 +1,9 @@ + + + Sample App diff --git a/samples/sample-iam/buildspec.yml b/samples/sample-iam/buildspec.yml index 6a1fec8e0..ded1b65a2 100644 --- a/samples/sample-iam/buildspec.yml +++ b/samples/sample-iam/buildspec.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + version: 0.2 phases: diff --git a/samples/sample-iam/params/global.yml b/samples/sample-iam/params/global.yml index bb9e55587..5eb7c880e 100644 --- a/samples/sample-iam/params/global.yml +++ b/samples/sample-iam/params/global.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + Tags: TagKey: my_tag MyKey: new_value diff --git a/samples/sample-iam/template.yml b/samples/sample-iam/template.yml index b79ea4dc9..078b9e7f1 100644 --- a/samples/sample-iam/template.yml +++ b/samples/sample-iam/template.yml @@ -1,5 +1,5 @@ -# // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# // SPDX-License-Identifier: Apache-2.0 +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 AWSTemplateFormatVersion: "2010-09-09" Description: ADF CloudFormation Sample Template (IAM) diff --git a/samples/sample-mono-repo/apps/alpha/buildspec.yml b/samples/sample-mono-repo/apps/alpha/buildspec.yml index 40bc977a4..9c261d94f 100644 --- a/samples/sample-mono-repo/apps/alpha/buildspec.yml +++ b/samples/sample-mono-repo/apps/alpha/buildspec.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + version: 0.2 env: diff --git a/samples/sample-mono-repo/apps/alpha/params/global.yml b/samples/sample-mono-repo/apps/alpha/params/global.yml index 6e9aac14e..1def24a0b 100644 --- a/samples/sample-mono-repo/apps/alpha/params/global.yml +++ b/samples/sample-mono-repo/apps/alpha/params/global.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + Tags: Repository: sample-mono-repo App: Sample Mono Repo Alpha diff --git a/samples/sample-mono-repo/apps/alpha/template.yml b/samples/sample-mono-repo/apps/alpha/template.yml index d66f763f5..d16ce57ce 100644 --- a/samples/sample-mono-repo/apps/alpha/template.yml +++ b/samples/sample-mono-repo/apps/alpha/template.yml @@ -1,5 +1,5 @@ -# // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# // SPDX-License-Identifier: Apache-2.0 +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 AWSTemplateFormatVersion: '2010-09-09' Description: ADF CloudFormation Sample Template (Mono Repo/App A) diff --git a/samples/sample-mono-repo/apps/beta/buildspec.yml b/samples/sample-mono-repo/apps/beta/buildspec.yml index 1d6fbb406..db78d3ddb 100644 --- a/samples/sample-mono-repo/apps/beta/buildspec.yml +++ b/samples/sample-mono-repo/apps/beta/buildspec.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + version: 0.2 env: diff --git a/samples/sample-mono-repo/apps/beta/params/global.yml b/samples/sample-mono-repo/apps/beta/params/global.yml index cad0c8edf..a6155e8b6 100644 --- a/samples/sample-mono-repo/apps/beta/params/global.yml +++ b/samples/sample-mono-repo/apps/beta/params/global.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + Tags: Repository: sample-mono-repo App: Sample Mono Repo Beta diff --git a/samples/sample-mono-repo/apps/beta/template.yml b/samples/sample-mono-repo/apps/beta/template.yml index dcecce2c1..1dc45fcb1 100644 --- a/samples/sample-mono-repo/apps/beta/template.yml +++ b/samples/sample-mono-repo/apps/beta/template.yml @@ -1,5 +1,5 @@ -# // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# // SPDX-License-Identifier: Apache-2.0 +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 AWSTemplateFormatVersion: '2010-09-09' Description: ADF CloudFormation Sample Template (Mono Repo/App B) diff --git a/samples/sample-rdk-rules/buildspec.yml b/samples/sample-rdk-rules/buildspec.yml index cff95a70d..92b691e34 100644 --- a/samples/sample-rdk-rules/buildspec.yml +++ b/samples/sample-rdk-rules/buildspec.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + version: 0.2 phases: install: diff --git a/samples/sample-rdk-rules/config-rules/EC2_CHECKS_TERMINATION_PROTECTION_ADF/EC2_CHECKS_TERMINATION_PROTECTION_ADF.py b/samples/sample-rdk-rules/config-rules/EC2_CHECKS_TERMINATION_PROTECTION_ADF/EC2_CHECKS_TERMINATION_PROTECTION_ADF.py index 9fec25f97..49cdabbdf 100644 --- a/samples/sample-rdk-rules/config-rules/EC2_CHECKS_TERMINATION_PROTECTION_ADF/EC2_CHECKS_TERMINATION_PROTECTION_ADF.py +++ b/samples/sample-rdk-rules/config-rules/EC2_CHECKS_TERMINATION_PROTECTION_ADF/EC2_CHECKS_TERMINATION_PROTECTION_ADF.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + import json import sys import datetime diff --git a/samples/sample-rdk-rules/config-rules/EC2_CHECKS_TERMINATION_PROTECTION_ADF/EC2_CHECKS_TERMINATION_PROTECTION_ADF_test.py b/samples/sample-rdk-rules/config-rules/EC2_CHECKS_TERMINATION_PROTECTION_ADF/EC2_CHECKS_TERMINATION_PROTECTION_ADF_test.py index dd0c4cfb5..c158fee04 100644 --- a/samples/sample-rdk-rules/config-rules/EC2_CHECKS_TERMINATION_PROTECTION_ADF/EC2_CHECKS_TERMINATION_PROTECTION_ADF_test.py +++ b/samples/sample-rdk-rules/config-rules/EC2_CHECKS_TERMINATION_PROTECTION_ADF/EC2_CHECKS_TERMINATION_PROTECTION_ADF_test.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + import sys import unittest from unittest.mock import MagicMock diff --git a/samples/sample-rdk-rules/lambda_helper.py b/samples/sample-rdk-rules/lambda_helper.py index 651e8d39e..b2aa42020 100644 --- a/samples/sample-rdk-rules/lambda_helper.py +++ b/samples/sample-rdk-rules/lambda_helper.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + import argparse import json import os diff --git a/samples/sample-serverless-app/build/generate_parameters.sh b/samples/sample-serverless-app/build/generate_parameters.sh index bd4e78bc3..f3ee980ed 100755 --- a/samples/sample-serverless-app/build/generate_parameters.sh +++ b/samples/sample-serverless-app/build/generate_parameters.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + set -e aws s3 cp s3://$S3_BUCKET_NAME/adf-build/ adf-build/ --recursive --quiet diff --git a/samples/sample-serverless-app/buildspec.yml b/samples/sample-serverless-app/buildspec.yml index 40de04f0b..b35e18af0 100644 --- a/samples/sample-serverless-app/buildspec.yml +++ b/samples/sample-serverless-app/buildspec.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + version: 0.2 phases: diff --git a/samples/sample-serverless-app/handler.py b/samples/sample-serverless-app/handler.py index 26fdb835f..c867a9dd0 100644 --- a/samples/sample-serverless-app/handler.py +++ b/samples/sample-serverless-app/handler.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + import json def lambda_handler(event, context): diff --git a/samples/sample-serverless-app/template.yml b/samples/sample-serverless-app/template.yml index 197834926..f772429dd 100644 --- a/samples/sample-serverless-app/template.yml +++ b/samples/sample-serverless-app/template.yml @@ -1,5 +1,5 @@ -# // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# // SPDX-License-Identifier: Apache-2.0 +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 AWSTemplateFormatVersion: '2010-09-09' Transform: AWS::Serverless-2016-10-31 diff --git a/samples/sample-service-catalog-product/buildspec.yml b/samples/sample-service-catalog-product/buildspec.yml index 6a1fec8e0..ded1b65a2 100644 --- a/samples/sample-service-catalog-product/buildspec.yml +++ b/samples/sample-service-catalog-product/buildspec.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + version: 0.2 phases: diff --git a/samples/sample-service-catalog-product/params/global.yml b/samples/sample-service-catalog-product/params/global.yml index 92719d56b..d5f55239d 100644 --- a/samples/sample-service-catalog-product/params/global.yml +++ b/samples/sample-service-catalog-product/params/global.yml @@ -1,2 +1,5 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + Parameters: ProductXTemplateURL: 'upload:eu-central-1:productX/template.yml' diff --git a/samples/sample-service-catalog-product/productX/template.yml b/samples/sample-service-catalog-product/productX/template.yml index 04480a4e2..4f2ea5a7c 100644 --- a/samples/sample-service-catalog-product/productX/template.yml +++ b/samples/sample-service-catalog-product/productX/template.yml @@ -1,5 +1,5 @@ -# // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# // SPDX-License-Identifier: Apache-2.0 +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 AWSTemplateFormatVersion: '2010-09-09' Description: ADF CloudFormation Sample Service Catalog Product diff --git a/samples/sample-service-catalog-product/template.yml b/samples/sample-service-catalog-product/template.yml index 741bcbaa8..2d3836706 100644 --- a/samples/sample-service-catalog-product/template.yml +++ b/samples/sample-service-catalog-product/template.yml @@ -1,5 +1,5 @@ -# // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# // SPDX-License-Identifier: Apache-2.0 +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 AWSTemplateFormatVersion: "2010-09-09" Description: ADF CloudFormation Sample Template (Service Catalog Product) diff --git a/samples/sample-terraform/buildspec.yml b/samples/sample-terraform/buildspec.yml index 81fb6aa8b..c7be30f9b 100644 --- a/samples/sample-terraform/buildspec.yml +++ b/samples/sample-terraform/buildspec.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + version: 0.2 env: diff --git a/samples/sample-terraform/params/global.yml b/samples/sample-terraform/params/global.yml index 3243d2830..58c190cfa 100644 --- a/samples/sample-terraform/params/global.yml +++ b/samples/sample-terraform/params/global.yml @@ -1,2 +1,5 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + Parameters: ProjectName: "sample-terraform" diff --git a/samples/sample-terraform/tf/backend.tf b/samples/sample-terraform/tf/backend.tf index 12c0dbe52..96e4287f3 100644 --- a/samples/sample-terraform/tf/backend.tf +++ b/samples/sample-terraform/tf/backend.tf @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + terraform { backend "s3" {} } diff --git a/samples/sample-terraform/tf/main.tf b/samples/sample-terraform/tf/main.tf index dc4c6d66b..33cc22072 100644 --- a/samples/sample-terraform/tf/main.tf +++ b/samples/sample-terraform/tf/main.tf @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + data "aws_partition" "current" {} terraform { diff --git a/samples/sample-terraform/tf/s3.tf b/samples/sample-terraform/tf/s3.tf index 68730ecb1..cf620317b 100644 --- a/samples/sample-terraform/tf/s3.tf +++ b/samples/sample-terraform/tf/s3.tf @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + resource "aws_s3_bucket" "s3" { bucket = "my-tf-test-bucket-${var.TARGET_REGION}-${var.TARGET_ACCOUNT_ID}" acl = "private" diff --git a/samples/sample-terraform/tf/variables.tf b/samples/sample-terraform/tf/variables.tf index c2c60d78e..c9d85614d 100644 --- a/samples/sample-terraform/tf/variables.tf +++ b/samples/sample-terraform/tf/variables.tf @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + variable "TARGET_ACCOUNT_ID" { type = string } diff --git a/samples/sample-terraform/tf_apply.yml b/samples/sample-terraform/tf_apply.yml index ba76c5bab..5fce1c595 100644 --- a/samples/sample-terraform/tf_apply.yml +++ b/samples/sample-terraform/tf_apply.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + version: 0.2 env: diff --git a/samples/sample-terraform/tf_destroy.yml b/samples/sample-terraform/tf_destroy.yml index 08f1d4a58..d2352753f 100644 --- a/samples/sample-terraform/tf_destroy.yml +++ b/samples/sample-terraform/tf_destroy.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + version: 0.2 env: diff --git a/samples/sample-terraform/tf_plan.yml b/samples/sample-terraform/tf_plan.yml index d492eb111..b84e9e98e 100644 --- a/samples/sample-terraform/tf_plan.yml +++ b/samples/sample-terraform/tf_plan.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + version: 0.2 env: diff --git a/samples/sample-terraform/tf_scan.yml b/samples/sample-terraform/tf_scan.yml index 94b69c36a..dc2838f57 100644 --- a/samples/sample-terraform/tf_scan.yml +++ b/samples/sample-terraform/tf_scan.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + version: 0.2 phases: diff --git a/samples/sample-vpc/buildspec.yml b/samples/sample-vpc/buildspec.yml index 6a1fec8e0..ded1b65a2 100644 --- a/samples/sample-vpc/buildspec.yml +++ b/samples/sample-vpc/buildspec.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + version: 0.2 phases: diff --git a/samples/sample-vpc/params/banking-production.yml b/samples/sample-vpc/params/banking-production.yml index 4dc7da870..751758b2b 100644 --- a/samples/sample-vpc/params/banking-production.yml +++ b/samples/sample-vpc/params/banking-production.yml @@ -1,2 +1,5 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + Parameters: Environment: production diff --git a/samples/sample-vpc/params/global.yml b/samples/sample-vpc/params/global.yml index 9d8e4432c..8c77df36f 100644 --- a/samples/sample-vpc/params/global.yml +++ b/samples/sample-vpc/params/global.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + Parameters: CostCenter: '123' Environment: testing diff --git a/samples/sample-vpc/template.yml b/samples/sample-vpc/template.yml index f9fe737c4..3bbf0ba77 100644 --- a/samples/sample-vpc/template.yml +++ b/samples/sample-vpc/template.yml @@ -1,5 +1,5 @@ -# // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# // SPDX-License-Identifier: Apache-2.0 +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 AWSTemplateFormatVersion: '2010-09-09' Description: ADF CloudFormation Sample Template (VPC) - Designed to be launched into a region with 3 availability zones diff --git a/src/lambda_codebase/__init__.py b/src/lambda_codebase/__init__.py index b0f3b0cc9..a1d0ef7b3 100644 --- a/src/lambda_codebase/__init__.py +++ b/src/lambda_codebase/__init__.py @@ -1,2 +1,2 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 diff --git a/src/lambda_codebase/account/handler.py b/src/lambda_codebase/account/handler.py index 4dfb47b13..c75d08d2f 100644 --- a/src/lambda_codebase/account/handler.py +++ b/src/lambda_codebase/account/handler.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/account/main.py b/src/lambda_codebase/account/main.py index cc855d58a..2edfc93eb 100644 --- a/src/lambda_codebase/account/main.py +++ b/src/lambda_codebase/account/main.py @@ -1,5 +1,6 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 + """ The Account main that is called when ADF is installed to initially create the deployment account if required. diff --git a/src/lambda_codebase/account/pytest.ini b/src/lambda_codebase/account/pytest.ini index 5ee647716..ac18618ea 100644 --- a/src/lambda_codebase/account/pytest.ini +++ b/src/lambda_codebase/account/pytest.ini @@ -1,2 +1,5 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + [pytest] testpaths = tests diff --git a/src/lambda_codebase/account/tests/__init__.py b/src/lambda_codebase/account/tests/__init__.py index c3f81ad2b..014883ae9 100644 --- a/src/lambda_codebase/account/tests/__init__.py +++ b/src/lambda_codebase/account/tests/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/account/tests/test_main.py b/src/lambda_codebase/account/tests/test_main.py index fb5e83821..3ee29eadc 100644 --- a/src/lambda_codebase/account/tests/test_main.py +++ b/src/lambda_codebase/account/tests/test_main.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/account_bootstrap.py b/src/lambda_codebase/account_bootstrap.py index a7a610552..54e212d1d 100644 --- a/src/lambda_codebase/account_bootstrap.py +++ b/src/lambda_codebase/account_bootstrap.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/account_processing/__init__.py b/src/lambda_codebase/account_processing/__init__.py index e69de29bb..014883ae9 100644 --- a/src/lambda_codebase/account_processing/__init__.py +++ b/src/lambda_codebase/account_processing/__init__.py @@ -0,0 +1,4 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + +# pylint: skip-file diff --git a/src/lambda_codebase/account_processing/configure_account_alias.py b/src/lambda_codebase/account_processing/configure_account_alias.py index 2a6e8a272..f24dcbc69 100644 --- a/src/lambda_codebase/account_processing/configure_account_alias.py +++ b/src/lambda_codebase/account_processing/configure_account_alias.py @@ -1,4 +1,4 @@ -# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/account_processing/configure_account_ou.py b/src/lambda_codebase/account_processing/configure_account_ou.py index ac4bd7f47..31a127856 100644 --- a/src/lambda_codebase/account_processing/configure_account_ou.py +++ b/src/lambda_codebase/account_processing/configure_account_ou.py @@ -1,4 +1,4 @@ -# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/account_processing/configure_account_regions.py b/src/lambda_codebase/account_processing/configure_account_regions.py index caa0d1f89..d81a5793d 100644 --- a/src/lambda_codebase/account_processing/configure_account_regions.py +++ b/src/lambda_codebase/account_processing/configure_account_regions.py @@ -1,4 +1,4 @@ -# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/account_processing/configure_account_tags.py b/src/lambda_codebase/account_processing/configure_account_tags.py index d995c4a0f..3b0c6308e 100644 --- a/src/lambda_codebase/account_processing/configure_account_tags.py +++ b/src/lambda_codebase/account_processing/configure_account_tags.py @@ -1,4 +1,4 @@ -# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/account_processing/create_account.py b/src/lambda_codebase/account_processing/create_account.py index 25335a916..ab4368228 100644 --- a/src/lambda_codebase/account_processing/create_account.py +++ b/src/lambda_codebase/account_processing/create_account.py @@ -1,4 +1,4 @@ -# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/account_processing/delete_default_vpc.py b/src/lambda_codebase/account_processing/delete_default_vpc.py index 877c44ef5..9cd3309a5 100644 --- a/src/lambda_codebase/account_processing/delete_default_vpc.py +++ b/src/lambda_codebase/account_processing/delete_default_vpc.py @@ -1,4 +1,4 @@ -# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/account_processing/get_account_regions.py b/src/lambda_codebase/account_processing/get_account_regions.py index ec099c074..76487153a 100644 --- a/src/lambda_codebase/account_processing/get_account_regions.py +++ b/src/lambda_codebase/account_processing/get_account_regions.py @@ -1,4 +1,4 @@ -# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/account_processing/process_account_files.py b/src/lambda_codebase/account_processing/process_account_files.py index 25f60a127..32996fce3 100644 --- a/src/lambda_codebase/account_processing/process_account_files.py +++ b/src/lambda_codebase/account_processing/process_account_files.py @@ -1,4 +1,4 @@ -# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/account_processing/pytest.ini b/src/lambda_codebase/account_processing/pytest.ini index 77e1fbea9..821ea5cec 100644 --- a/src/lambda_codebase/account_processing/pytest.ini +++ b/src/lambda_codebase/account_processing/pytest.ini @@ -1,7 +1,9 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + [pytest] testpaths = tests addopts = --cov=./src/lambda_codebase/account_processing/ --cov-fail-under=50 --cov-report term [coverage:run] omit = tests/ - diff --git a/src/lambda_codebase/account_processing/register_account_for_support.py b/src/lambda_codebase/account_processing/register_account_for_support.py index 3b251984e..77921181f 100644 --- a/src/lambda_codebase/account_processing/register_account_for_support.py +++ b/src/lambda_codebase/account_processing/register_account_for_support.py @@ -1,4 +1,4 @@ -# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/account_processing/tests/__init__.py b/src/lambda_codebase/account_processing/tests/__init__.py index e69de29bb..014883ae9 100644 --- a/src/lambda_codebase/account_processing/tests/__init__.py +++ b/src/lambda_codebase/account_processing/tests/__init__.py @@ -0,0 +1,4 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + +# pylint: skip-file diff --git a/src/lambda_codebase/account_processing/tests/test_account_alias.py b/src/lambda_codebase/account_processing/tests/test_account_alias.py index 3ee0a988d..fba971772 100644 --- a/src/lambda_codebase/account_processing/tests/test_account_alias.py +++ b/src/lambda_codebase/account_processing/tests/test_account_alias.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + """ Tests the account alias configuration lambda """ diff --git a/src/lambda_codebase/account_processing/tests/test_account_creation.py b/src/lambda_codebase/account_processing/tests/test_account_creation.py index 19ec0c47a..3204e3165 100644 --- a/src/lambda_codebase/account_processing/tests/test_account_creation.py +++ b/src/lambda_codebase/account_processing/tests/test_account_creation.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + """ Tests the account creation lambda """ diff --git a/src/lambda_codebase/account_processing/tests/test_account_file_processing.py b/src/lambda_codebase/account_processing/tests/test_account_file_processing.py index 7e7e9ced8..a35aa3daa 100644 --- a/src/lambda_codebase/account_processing/tests/test_account_file_processing.py +++ b/src/lambda_codebase/account_processing/tests/test_account_file_processing.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + """ Tests the account file processing lambda """ diff --git a/src/lambda_codebase/account_processing/tests/test_account_tags.py b/src/lambda_codebase/account_processing/tests/test_account_tags.py index ba7b8327f..1700d6e6d 100644 --- a/src/lambda_codebase/account_processing/tests/test_account_tags.py +++ b/src/lambda_codebase/account_processing/tests/test_account_tags.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + """ Tests the account tag configuration lambda """ diff --git a/src/lambda_codebase/account_processing/tests/test_configure_account_regions.py b/src/lambda_codebase/account_processing/tests/test_configure_account_regions.py index 1d3b8f0ff..0896f120b 100644 --- a/src/lambda_codebase/account_processing/tests/test_configure_account_regions.py +++ b/src/lambda_codebase/account_processing/tests/test_configure_account_regions.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + """ Tests the account alias configuration lambda """ diff --git a/src/lambda_codebase/account_processing/tests/test_get_default_regions.py b/src/lambda_codebase/account_processing/tests/test_get_default_regions.py index aba7cc319..ed8ec5744 100644 --- a/src/lambda_codebase/account_processing/tests/test_get_default_regions.py +++ b/src/lambda_codebase/account_processing/tests/test_get_default_regions.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + """ Tests the account tag configuration lambda """ diff --git a/src/lambda_codebase/cross_region_bucket/handler.py b/src/lambda_codebase/cross_region_bucket/handler.py index 019b6d625..636e296c0 100644 --- a/src/lambda_codebase/cross_region_bucket/handler.py +++ b/src/lambda_codebase/cross_region_bucket/handler.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/cross_region_bucket/main.py b/src/lambda_codebase/cross_region_bucket/main.py index c02f45d8c..ae1223471 100644 --- a/src/lambda_codebase/cross_region_bucket/main.py +++ b/src/lambda_codebase/cross_region_bucket/main.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/deployment_account_config.py b/src/lambda_codebase/deployment_account_config.py index 61b32ca3c..4da722330 100644 --- a/src/lambda_codebase/deployment_account_config.py +++ b/src/lambda_codebase/deployment_account_config.py @@ -1,8 +1,8 @@ -# pylint: skip-file - -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 +# pylint: skip-file + """ Executes as part of the bootstrap process when the Deployment Account is initially created and moved into its OU. This step creates a AWS diff --git a/src/lambda_codebase/determine_event.py b/src/lambda_codebase/determine_event.py index 7879584a6..93beada6b 100644 --- a/src/lambda_codebase/determine_event.py +++ b/src/lambda_codebase/determine_event.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/event.py b/src/lambda_codebase/event.py index c16e323f5..1bd49f03a 100644 --- a/src/lambda_codebase/event.py +++ b/src/lambda_codebase/event.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/generic_account_config.py b/src/lambda_codebase/generic_account_config.py index d33e8548e..fdb0c8cb2 100644 --- a/src/lambda_codebase/generic_account_config.py +++ b/src/lambda_codebase/generic_account_config.py @@ -1,7 +1,6 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 - """ Executes for any account that has been Bootstrapped other than the Deployment Account. diff --git a/src/lambda_codebase/initial_commit/adf.yml.j2 b/src/lambda_codebase/initial_commit/adf.yml.j2 index c034bee11..c649d3f8d 100644 --- a/src/lambda_codebase/initial_commit/adf.yml.j2 +++ b/src/lambda_codebase/initial_commit/adf.yml.j2 @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + accounts: - account_full_name: {{ DeploymentAccountFullName }} organizational_unit_path: /deployment diff --git a/src/lambda_codebase/initial_commit/adfconfig.yml.j2 b/src/lambda_codebase/initial_commit/adfconfig.yml.j2 index 87b467d3c..4f7d8b15a 100644 --- a/src/lambda_codebase/initial_commit/adfconfig.yml.j2 +++ b/src/lambda_codebase/initial_commit/adfconfig.yml.j2 @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + roles: cross-account-access: {{ CrossAccountAccessRole }} # ^ The role by ADF to assume cross account access @@ -35,4 +38,3 @@ config: #org: # Optional: Use this variable to define the AWS Organization in case of staged multi-organization ADF deployments #stage: dev - diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/example-global-iam.yml b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/example-global-iam.yml index ae5b38415..b9cde40be 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/example-global-iam.yml +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/example-global-iam.yml @@ -1,5 +1,6 @@ -# // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# // SPDX-License-Identifier: Apache-2.0 +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + AWSTemplateFormatVersion: "2010-09-09" Description: ADF CloudFormation Template (Global) for IAM in the Deployment Account diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/global.yml b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/global.yml index 9f16c5655..56bd7df2a 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/global.yml +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/global.yml @@ -1,5 +1,5 @@ -# // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# // SPDX-License-Identifier: Apache-2.0 +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 AWSTemplateFormatVersion: "2010-09-09" Transform: "AWS::Serverless-2016-10-31" diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/__init__.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/__init__.py index b0f3b0cc9..014883ae9 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/__init__.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/__init__.py @@ -1,2 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 + +# pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/determine_default_branch/determine_default_branch.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/determine_default_branch/determine_default_branch.py index 39faed35d..e2b846cf1 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/determine_default_branch/determine_default_branch.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/determine_default_branch/determine_default_branch.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + """ The Determine Default Branch Logic that is called when ADF is installed or updated to determine the default branch for the given repository. diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/determine_default_branch/handler.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/determine_default_branch/handler.py index 1f91a49cc..1f5001733 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/determine_default_branch/handler.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/determine_default_branch/handler.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + """ The Determine Default Branch Handler that is called when ADF is installed or updated to determine the default branch for the repository. diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/determine_default_branch/pytest.ini b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/determine_default_branch/pytest.ini index 5ee647716..ac18618ea 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/determine_default_branch/pytest.ini +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/determine_default_branch/pytest.ini @@ -1,2 +1,5 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + [pytest] testpaths = tests diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/determine_default_branch/tests/__init__.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/determine_default_branch/tests/__init__.py index e164948b0..b4473968c 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/determine_default_branch/tests/__init__.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/determine_default_branch/tests/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/determine_default_branch/tests/test_determine_default_branch.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/determine_default_branch/tests/test_determine_default_branch.py index b28ee44ef..49fc2a977 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/determine_default_branch/tests/test_determine_default_branch.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/determine_default_branch/tests/test_determine_default_branch.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/enable_cross_account_access.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/enable_cross_account_access.py index 394a8fb09..42e9390dc 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/enable_cross_account_access.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/enable_cross_account_access.py @@ -1,7 +1,6 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 - """ Enables the connection between the deployment account and the account that is being bootstrapped. diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/iam_cfn_deploy_role_policy.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/iam_cfn_deploy_role_policy.py index 71b00df30..2a0f596f8 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/iam_cfn_deploy_role_policy.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/iam_cfn_deploy_role_policy.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/handler.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/handler.py index e6c08969a..531b27467 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/handler.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/handler.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + """ The Initial Commit Handler that is called when ADF is installed to commit the initial pipelines repository content. diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/initial_commit.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/initial_commit.py index b272800f8..399674c02 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/initial_commit.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/initial_commit.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + """ The Initial Commit main that is called when ADF is installed to commit the initial pipelines repository content. diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/pipelines_repository/example-deployment_map.yml b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/pipelines_repository/example-deployment_map.yml index 3aea151a5..2dfde29df 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/pipelines_repository/example-deployment_map.yml +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/pipelines_repository/example-deployment_map.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + pipelines: - name: sample-iam # The name of your pipeline (by default, this will match the name of your repository) default_providers: diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/pytest.ini b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/pytest.ini index a1f7eb0aa..8207b6d1f 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/pytest.ini +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/pytest.ini @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + [pytest] testpaths = tests norecursedirs = pipelines_repository diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/tests/__init__.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/tests/__init__.py index e164948b0..b4473968c 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/tests/__init__.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/tests/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/tests/test_initial_commit.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/tests/test_initial_commit.py index e92766901..aaa63b61e 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/tests/test_initial_commit.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/tests/test_initial_commit.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/create_or_update_rule.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/create_or_update_rule.py index 91059b6d9..15865ed89 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/create_or_update_rule.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/create_or_update_rule.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + """ Pipeline Management Lambda Function Creates or Updates an Event Rule for forwarding events diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/create_repository.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/create_repository.py index ed4bba604..b004bcc9d 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/create_repository.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/create_repository.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + """ Pipeline Management Lambda Function Creates or Updates a CodeCommit Repository diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/generate_pipeline_inputs.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/generate_pipeline_inputs.py index d9dab9926..17407af0c 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/generate_pipeline_inputs.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/generate_pipeline_inputs.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + """ Pipeline Management Lambda Function Generates Pipeline Inputs diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/identify_out_of_date_pipelines.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/identify_out_of_date_pipelines.py index b13fea98d..54c7d111f 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/identify_out_of_date_pipelines.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/identify_out_of_date_pipelines.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + """ Pipeline Management Lambda Function Compares pipeline definitions in S3 to the definitions stored in SSM Param Store. diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/process_deployment_map.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/process_deployment_map.py index 7cdf94251..53106c61c 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/process_deployment_map.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/process_deployment_map.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + """ Pipeline Management Lambda Function Triggered by new Deployment Maps in S3 Bucket. diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/store_pipeline_definition.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/store_pipeline_definition.py index 232007868..2ed481d17 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/store_pipeline_definition.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/store_pipeline_definition.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + """ Pipeline Management Lambda Function Stores pipeline input from prior function to S3. diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/templates/codecommit.yml b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/templates/codecommit.yml index 8de489a9a..6842f6968 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/templates/codecommit.yml +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/templates/codecommit.yml @@ -1,5 +1,5 @@ -# // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# // SPDX-License-Identifier: Apache-2.0 +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 Parameters: RepoName: diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/templates/events.yml b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/templates/events.yml index b4f2f18f2..a03fde62b 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/templates/events.yml +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/templates/events.yml @@ -1,5 +1,5 @@ -# // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# // SPDX-License-Identifier: Apache-2.0 +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 Parameters: DeploymentAccountId: diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pytest.ini b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pytest.ini index 190a5b381..8387b3960 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pytest.ini +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pytest.ini @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + [pytest] testpaths = tests norecursedirs = initial_commit determine_default_branch diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/slack.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/slack.py index 113ce3b34..bb5563fb0 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/slack.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/slack.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/tests/__init__.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/tests/__init__.py index c3f81ad2b..014883ae9 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/tests/__init__.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/tests/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/tests/stubs/__init__.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/tests/stubs/__init__.py index c3f81ad2b..014883ae9 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/tests/stubs/__init__.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/tests/stubs/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/tests/stubs/slack.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/tests/stubs/slack.py index 499f4a3ae..0b131fffc 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/tests/stubs/slack.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/tests/stubs/slack.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/tests/stubs/stub_iam.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/tests/stubs/stub_iam.py index e4fe578d9..f7f994397 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/tests/stubs/stub_iam.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/tests/stubs/stub_iam.py @@ -1,4 +1,4 @@ -# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/tests/test_iam_cfn_deploy_role_policy.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/tests/test_iam_cfn_deploy_role_policy.py index fd399e15c..be5c1eb66 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/tests/test_iam_cfn_deploy_role_policy.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/tests/test_iam_cfn_deploy_role_policy.py @@ -1,4 +1,4 @@ -# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/tests/test_slack.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/tests/test_slack.py index b2156d9b4..60c44b81d 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/tests/test_slack.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/tests/test_slack.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/update_pipelines.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/update_pipelines.py index a5f236c47..d2039f896 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/update_pipelines.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/update_pipelines.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/pipeline_management.yml b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/pipeline_management.yml index 0bf5f1d68..86769c7fd 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/pipeline_management.yml +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/pipeline_management.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 + AWSTemplateFormatVersion: '2010-09-09' Transform: 'AWS::Serverless-2016-10-31' Description: ADF CloudFormation Stack for processing deployment maps. diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/regional.yml b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/regional.yml index 3b7bb0e77..e6542a62f 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/regional.yml +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/regional.yml @@ -1,5 +1,5 @@ -# // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# // SPDX-License-Identifier: Apache-2.0 +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 AWSTemplateFormatVersion: "2010-09-09" Description: ADF CloudFormation Template (Regional) for Deployment Account diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/example-global-iam.yml b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/example-global-iam.yml index 44499dd09..f252b240f 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/example-global-iam.yml +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/example-global-iam.yml @@ -1,5 +1,5 @@ -# // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# // SPDX-License-Identifier: Apache-2.0 +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 AWSTemplateFormatVersion: "2010-09-09" Description: ADF CloudFormation Template (Global) for IAM in the Target Accounts diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/global.yml b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/global.yml index bac3f6ea5..d94667439 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/global.yml +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/global.yml @@ -1,5 +1,5 @@ -# // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# // SPDX-License-Identifier: Apache-2.0 +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 AWSTemplateFormatVersion: "2010-09-09" Description: >- diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/__init__.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/__init__.py index 61d3bb7f5..9342a95d3 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/__init__.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/config.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/config.py index 99d3e33a5..9af699045 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/config.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/config.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """Config module used as part of bootstrap_repository diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/global.yml b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/global.yml index 426e6a473..204b1ffe0 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/global.yml +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/global.yml @@ -1,5 +1,5 @@ -# // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# // SPDX-License-Identifier: Apache-2.0 +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 AWSTemplateFormatVersion: "2010-09-09" Description: >- diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/main.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/main.py index c4ce3777f..713300c82 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/main.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/main.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/organization_policy.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/organization_policy.py index 55e4dd167..bab013907 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/organization_policy.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/organization_policy.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/src/__init__.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/src/__init__.py index 8f1a9c905..e3e81189d 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/src/__init__.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/src/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """__init__ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/src/account.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/src/account.py index 8c031b8f3..a6dcbce8d 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/src/account.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/src/account.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/src/configparser.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/src/configparser.py index b363c1f8c..e52561f43 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/src/configparser.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/src/configparser.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/src/support.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/src/support.py index ea025dd48..8fa29643a 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/src/support.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/src/support.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + """Support module used throughout the ADF """ from enum import Enum diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/src/vpc.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/src/vpc.py index 7e98775c1..e707c725a 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/src/vpc.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/provisioner/src/vpc.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/__init__.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/__init__.py index b0f3b0cc9..a1d0ef7b3 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/__init__.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/__init__.py @@ -1,2 +1,2 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/base_resolver.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/base_resolver.py index f7fa54c26..7f37f431b 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/base_resolver.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/base_resolver.py @@ -1,4 +1,4 @@ -# Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/__init__.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/__init__.py index b0f3b0cc9..a1d0ef7b3 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/__init__.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/__init__.py @@ -1,2 +1,2 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/__init__.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/__init__.py index b0f3b0cc9..a1d0ef7b3 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/__init__.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/__init__.py @@ -1,2 +1,2 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_chatbot.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_chatbot.py index a7c0cc839..d5234cf1d 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_chatbot.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_chatbot.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """Construct related to Notifications Codepipeline Input diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_cloudformation.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_cloudformation.py index 2aa73a1e7..1cf13dcc6 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_cloudformation.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_cloudformation.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """Construct related to CloudFormation Input diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_codebuild.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_codebuild.py index 05a0975fa..68548bf80 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_codebuild.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_codebuild.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """Construct related to CodeBuild Input diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_codecommit.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_codecommit.py index b82820e0f..228e61a4d 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_codecommit.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_codecommit.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """Construct related to CodeCommit Input diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_codepipeline.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_codepipeline.py index 530a7ef0c..5b345bca2 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_codepipeline.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_codepipeline.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """Construct related to CodePipeline Action Input diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_codestar.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_codestar.py index bad0a618d..f7bbc1cab 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_codestar.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_codestar.py @@ -1,7 +1,7 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 -"""Construct related to CodeStarConnection Codepipeline Input +"""Construct related to CodeStarConnection CodePipeline Input """ import os diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_events.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_events.py index d57ed3613..7d9a24b85 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_events.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_events.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """Construct related to Events Input diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_github.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_github.py index 51493a2ad..86b79ed2e 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_github.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_github.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """Construct related to Github Codepipeline Input diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_jenkins.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_jenkins.py index fe6c680a4..6cd41595d 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_jenkins.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_jenkins.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """Construct related to Jenkins Codepipeline Input diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_notifications.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_notifications.py index 849a352b6..405295349 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_notifications.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_notifications.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """Construct related to Notifications Codepipeline Input diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_s3.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_s3.py index 28571fd15..f65454456 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_s3.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_s3.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """Construct related to S3 Codepipeline Input diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/tests/__init__.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/tests/__init__.py index 07b802c79..1d92ed61a 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/tests/__init__.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/tests/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/tests/adf_codepipeline_test_constants.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/tests/adf_codepipeline_test_constants.py index 3e001c199..c067113d2 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/tests/adf_codepipeline_test_constants.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/tests/adf_codepipeline_test_constants.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file @@ -15,4 +15,3 @@ }, 'name': 'name', } - diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/tests/test_adf_codebuild_buildspec.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/tests/test_adf_codebuild_buildspec.py index 50860bf21..ddd1da9ea 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/tests/test_adf_codebuild_buildspec.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/tests/test_adf_codebuild_buildspec.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/tests/test_adf_codebuild_determine_build_image.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/tests/test_adf_codebuild_determine_build_image.py index 80007b5e5..564468588 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/tests/test_adf_codebuild_determine_build_image.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/tests/test_adf_codebuild_determine_build_image.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/tests/test_adf_codepipeline_generate.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/tests/test_adf_codepipeline_generate.py index c59eb3cb2..6cc9868df 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/tests/test_adf_codepipeline_generate.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/tests/test_adf_codepipeline_generate.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/tests/test_adf_codepipeline_input_artifacts.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/tests/test_adf_codepipeline_input_artifacts.py index 28b314da2..a3b9938f0 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/tests/test_adf_codepipeline_input_artifacts.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/tests/test_adf_codepipeline_input_artifacts.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/tests/test_adf_codepipeline_output_artifacts.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/tests/test_adf_codepipeline_output_artifacts.py index 2d1842e46..323d89bb2 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/tests/test_adf_codepipeline_output_artifacts.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/tests/test_adf_codepipeline_output_artifacts.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_stacks/__init__.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_stacks/__init__.py index e69de29bb..b0f3b0cc9 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_stacks/__init__.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_stacks/__init__.py @@ -0,0 +1,2 @@ +# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: MIT-0 diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_stacks/tests/__init__.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_stacks/tests/__init__.py index e69de29bb..b0f3b0cc9 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_stacks/tests/__init__.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_stacks/tests/__init__.py @@ -0,0 +1,2 @@ +# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# SPDX-License-Identifier: MIT-0 diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/clean_pipelines.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/clean_pipelines.py index 22b0e8ca0..c8d590414 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/clean_pipelines.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/clean_pipelines.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/execute_pipeline_stacks.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/execute_pipeline_stacks.py index 6f55e9f76..0a3d7e5a6 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/execute_pipeline_stacks.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/execute_pipeline_stacks.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/generate_pipeline_stacks.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/generate_pipeline_stacks.py index 9c89e4f7b..f8be9b66e 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/generate_pipeline_stacks.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/generate_pipeline_stacks.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/pytest.ini b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/pytest.ini index 8f8453628..7b81dc156 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/pytest.ini +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/pytest.ini @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + [pytest] testpaths = cdk_constructs/tests diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/generate_params.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/generate_params.py index e9d858845..106f7b25e 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/generate_params.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/generate_params.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/__init__.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/__init__.py index b0f3b0cc9..a1d0ef7b3 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/__init__.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/__init__.py @@ -1,2 +1,2 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/describe_codepipeline_trigger.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/describe_codepipeline_trigger.py index bdc82cbdb..e4a8c79c4 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/describe_codepipeline_trigger.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/describe_codepipeline_trigger.py @@ -1,5 +1,6 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 + """ Describe CodePipeline trigger. diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/package_transform.sh b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/package_transform.sh index c325be39e..1e5a50d30 100755 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/package_transform.sh +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/package_transform.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash -# + +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + # This script will package all source code and send it to an S3 bucket in each region # where the lambda needs to be deployed to. # diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/pytest.ini b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/pytest.ini index 015e8596c..7f245564d 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/pytest.ini +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/pytest.ini @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + [pytest] testpaths = tests norecursedirs = terraform diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/retrieve_organization_accounts.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/retrieve_organization_accounts.py index e96c7aec1..4c9db8780 100755 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/retrieve_organization_accounts.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/retrieve_organization_accounts.py @@ -1,6 +1,9 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + """ retrieve_organization_accounts.py diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/sts.sh b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/sts.sh index db04f6f67..15431fa9c 100755 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/sts.sh +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/sts.sh @@ -1,5 +1,8 @@ #!/usr/bin/env bash +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + if [ -z "$AWS_PARTITION" ]; then AWS_PARTITION="aws" fi diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/sync_to_s3.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/sync_to_s3.py index 750711158..76259a024 100755 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/sync_to_s3.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/sync_to_s3.py @@ -1,5 +1,6 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 + """ Sync files to an S3 Bucket. diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/terraform/adf_terraform.sh b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/terraform/adf_terraform.sh index d9635ab73..5584e129e 100755 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/terraform/adf_terraform.sh +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/terraform/adf_terraform.sh @@ -1,4 +1,8 @@ #!/usr/bin/env bash + +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + PATH=$PATH:$(pwd) export PATH CURRENT=$(pwd) diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/terraform/get_accounts.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/terraform/get_accounts.py index 5d6fd2376..369253aca 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/terraform/get_accounts.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/terraform/get_accounts.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/terraform/install_terraform.sh b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/terraform/install_terraform.sh index 2715eec71..c356484e6 100755 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/terraform/install_terraform.sh +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/terraform/install_terraform.sh @@ -1,4 +1,8 @@ #!/usr/bin/env bash + +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + set -e apt-get install --assume-yes jq diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/tests/__init__.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/tests/__init__.py index e164948b0..b4473968c 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/tests/__init__.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/tests/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/tests/test_sync_to_s3.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/tests/test_sync_to_s3.py index e1b9a6813..d36d0e261 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/tests/test_sync_to_s3.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/tests/test_sync_to_s3.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + import os from typing import Mapping from pathlib import Path diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/pytest.ini b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/pytest.ini index 68298b1c8..e0c0e9d56 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/pytest.ini +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/pytest.ini @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + [pytest] testpaths = tests norecursedirs = python cdk helpers diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/__init__.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/__init__.py index b0f3b0cc9..a1d0ef7b3 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/__init__.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/__init__.py @@ -1,2 +1,2 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/cache.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/cache.py index b6f0acd5f..f5753d9f8 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/cache.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/cache.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/cloudformation.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/cloudformation.py index 39d466838..53e1f9dda 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/cloudformation.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/cloudformation.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """CloudFormation module used throughout the ADF diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/cloudwatch.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/cloudwatch.py index 57a228e63..47ff44ae0 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/cloudwatch.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/cloudwatch.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + """ Standardized class for pushing CloudWatch metric data to a service within the ADF Namespace """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/codepipeline.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/codepipeline.py index 83316c93e..e20eb6b46 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/codepipeline.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/codepipeline.py @@ -1,5 +1,4 @@ - -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """CodePipeline module used throughout the ADF diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/deployment_map.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/deployment_map.py index aee2077a8..72c147f04 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/deployment_map.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/deployment_map.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/errors.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/errors.py index 4b9467f05..4d11bf6ba 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/errors.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/errors.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/list_utils.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/list_utils.py index 88d0ed81d..735254000 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/list_utils.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/list_utils.py @@ -1,4 +1,4 @@ -# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/logger.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/logger.py index a83774d59..fcc446cb3 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/logger.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/logger.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """Primary Logging Configuration Function diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/organizations.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/organizations.py index f3d6907fc..c6afb6d20 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/organizations.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/organizations.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/paginator.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/paginator.py index 910ebd62c..bb02a7c8c 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/paginator.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/paginator.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/parameter_store.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/parameter_store.py index 690656dbf..995c65a4f 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/parameter_store.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/parameter_store.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """Parameter Store module used throughout the ADF diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/partition.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/partition.py index d1bb2a0cb..30050db40 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/partition.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/partition.py @@ -1,5 +1,6 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 + """Partition. A partition is a group of AWS Regions. This module provides a helper function diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/pipeline.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/pipeline.py index 46d5daa6e..8f85e7893 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/pipeline.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/pipeline.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/pytest.ini b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/pytest.ini index 5ee647716..ac18618ea 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/pytest.ini +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/pytest.ini @@ -1,2 +1,5 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + [pytest] testpaths = tests diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/repo.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/repo.py index cb188d6f0..f2ce6cbec 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/repo.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/repo.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/rule.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/rule.py index 7fd419d3d..92f616f02 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/rule.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/rule.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/s3.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/s3.py index 0dc264739..805501a3a 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/s3.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/s3.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/schema_validation.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/schema_validation.py index c78209c88..4682f0aab 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/schema_validation.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/schema_validation.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/stepfunctions.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/stepfunctions.py index 90cd3d1ee..45d23f1ca 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/stepfunctions.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/stepfunctions.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/sts.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/sts.py index 0337eba71..03ce5f4f8 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/sts.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/sts.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """STS module used throughout the ADF diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/target.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/target.py index 303fc2bda..7994bbf75 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/target.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/target.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/__init__.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/__init__.py index 0e037559d..ff17ed0d6 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/__init__.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/__init__.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/__init__.py index b0f3b0cc9..a1d0ef7b3 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/__init__.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/__init__.py @@ -1,2 +1,2 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_cloudformation.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_cloudformation.py index d2d26db99..dce8e35f8 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_cloudformation.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_cloudformation.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_codepipeline.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_codepipeline.py index e99c1d502..b9a4c3043 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_codepipeline.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_codepipeline.py @@ -1,7 +1,6 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 - """ Stubs for testing codepipeline.py """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_deployment_map.yml b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_deployment_map.yml index ab0d69d0c..60935a07b 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_deployment_map.yml +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_deployment_map.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + pipelines: - name: sample-iam # The name of your pipeline (by default, this will match the name of your repository) default_providers: diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_event.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_event.py index 87f2bb7ac..5f50e8a2d 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_event.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_event.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_kms.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_kms.py index e6684549d..e121939be 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_kms.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_kms.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_organizations.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_organizations.py index dd7a38c2c..371941cb6 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_organizations.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_organizations.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_parameter_store.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_parameter_store.py index 559a58f8f..f61c15d64 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_parameter_store.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_parameter_store.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_s3.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_s3.py index 135b460f3..412249320 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_s3.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_s3.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_step_functions.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_step_functions.py index 6467ded72..116e03ff7 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_step_functions.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_step_functions.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_target.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_target.py index f9364a906..529d17c86 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_target.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_target.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_cache.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_cache.py index 18faa5839..1e8d614d4 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_cache.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_cache.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_cloudformation.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_cloudformation.py index 3a767c846..27bcf7f4a 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_cloudformation.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_cloudformation.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_codepipeline.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_codepipeline.py index 91a2c2134..b3bb7f6fd 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_codepipeline.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_codepipeline.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_deployment_map.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_deployment_map.py index 5e62ce2ba..2aac0d2a9 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_deployment_map.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_deployment_map.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_list_utils.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_list_utils.py index 1f942cea5..e9c8d3957 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_list_utils.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_list_utils.py @@ -1,4 +1,4 @@ -# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_organizations.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_organizations.py index 050102377..65dc72b83 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_organizations.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_organizations.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_parameter_store.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_parameter_store.py index f8e3d277a..9fa25ef7e 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_parameter_store.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_parameter_store.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_partition.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_partition.py index 9b514a9b3..f2a42cf80 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_partition.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_partition.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + """Tests for partition.py Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_pipeline.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_pipeline.py index 8d99173a5..f752f065b 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_pipeline.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_pipeline.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_s3.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_s3.py index ede5eb654..a017b74a7 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_s3.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_s3.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_schema_validation.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_schema_validation.py index 683122b83..4b4aeef1a 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_schema_validation.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_schema_validation.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + """ Tests for schema validation """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_step_functions.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_step_functions.py index f7c85ab66..71d0ffe03 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_step_functions.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_step_functions.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_target.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_target.py index c23c8c1e7..89bee9ccb 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_target.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_target.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/thread.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/thread.py index 5bd26f98a..02e73ab7e 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/thread.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/thread.py @@ -1,7 +1,6 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 - # pylint: skip-file from threading import Thread diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/resolver.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/resolver.py index a4dcc9982..997e5b133 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/resolver.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/resolver.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/resolver_param_store.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/resolver_param_store.py index 22e966fb1..bd61d28ce 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/resolver_param_store.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/resolver_param_store.py @@ -1,4 +1,4 @@ -# Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/resolver_stack_output.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/resolver_stack_output.py index 5ceefa4f3..d82ceb803 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/resolver_stack_output.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/resolver_stack_output.py @@ -1,4 +1,4 @@ -# Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/resolver_upload.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/resolver_upload.py index 86dcba5f6..65eebee51 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/resolver_upload.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/resolver_upload.py @@ -1,4 +1,4 @@ -# Copyright 2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/templates/codecommit.yml b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/templates/codecommit.yml index 8f501919c..f6b975a4d 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/templates/codecommit.yml +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/templates/codecommit.yml @@ -1,5 +1,5 @@ -# // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# // SPDX-License-Identifier: Apache-2.0 +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 Parameters: RepoName: diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/templates/events.yml b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/templates/events.yml index 7032af664..06aa630e0 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/templates/events.yml +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/templates/events.yml @@ -1,5 +1,5 @@ -# // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# // SPDX-License-Identifier: Apache-2.0 +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 Parameters: DeploymentAccountId: diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/tests/__init__.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/tests/__init__.py index ba34ad097..92a8497fd 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/tests/__init__.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/tests/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/tests/stubs/__init__.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/tests/stubs/__init__.py index 566bebd0c..3655638a8 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/tests/stubs/__init__.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/tests/stubs/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/tests/stubs/parameter_environment_acceptance_tag_project_a.yml b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/tests/stubs/parameter_environment_acceptance_tag_project_a.yml index 9883080a7..3fd0428b6 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/tests/stubs/parameter_environment_acceptance_tag_project_a.yml +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/tests/stubs/parameter_environment_acceptance_tag_project_a.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + Parameters: Environment: acceptance diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/tests/stubs/stub_cfn_global.yml b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/tests/stubs/stub_cfn_global.yml index f7a5aeedd..65b849060 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/tests/stubs/stub_cfn_global.yml +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/tests/stubs/stub_cfn_global.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + Parameters: Environment: "testing" MySpecialValue: "resolve:/values/some_value" diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/tests/test_generate_params.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/tests/test_generate_params.py index 4697f2854..d3ee80324 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/tests/test_generate_params.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/tests/test_generate_params.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/store_config.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/store_config.py index bd3bc7b43..6a29bbbb8 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/store_config.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/store_config.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/tests/__init__.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/tests/__init__.py index e164948b0..b4473968c 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/tests/__init__.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/tests/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/tests/stubs/stub_adfconfig.yml b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/tests/stubs/stub_adfconfig.yml index fd0479334..5a2da20ae 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/tests/stubs/stub_adfconfig.yml +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/tests/stubs/stub_adfconfig.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + roles: cross-account-access: some_role diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/tests/test_config.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/tests/test_config.py index 11f6f19e8..58edb2bd1 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/tests/test_config.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/tests/test_config.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/tests/test_main.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/tests/test_main.py index 18c33e1c4..839b81f3e 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/tests/test_main.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/tests/test_main.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/example-adfconfig.yml b/src/lambda_codebase/initial_commit/bootstrap_repository/example-adfconfig.yml index 62b177abd..c7c774445 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/example-adfconfig.yml +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/example-adfconfig.yml @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + roles: cross-account-access: OrganizationAccountAccessRole # ^ The role by ADF to assume cross account access diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/pytest.ini b/src/lambda_codebase/initial_commit/bootstrap_repository/pytest.ini index bafa7f6ef..88cf3750c 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/pytest.ini +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/pytest.ini @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + [pytest] env = ACCOUNT_ID="123456789012" diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/tox.ini b/src/lambda_codebase/initial_commit/bootstrap_repository/tox.ini index c6ab5d9f3..d3bb64611 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/tox.ini +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/tox.ini @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + # tox (https://tox.readthedocs.io/) is a tool for running tests # in multiple virtualenvs. This configuration file will run the # test suite on all supported python versions. To use it, "pip install tox" diff --git a/src/lambda_codebase/initial_commit/handler.py b/src/lambda_codebase/initial_commit/handler.py index 5e639af03..a292bb2f9 100644 --- a/src/lambda_codebase/initial_commit/handler.py +++ b/src/lambda_codebase/initial_commit/handler.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + """ The Initial Commit Handler that is called when ADF is installed to commit the initial bootstrap repository content. diff --git a/src/lambda_codebase/initial_commit/initial_commit.py b/src/lambda_codebase/initial_commit/initial_commit.py index 9cc2ad320..00df901de 100644 --- a/src/lambda_codebase/initial_commit/initial_commit.py +++ b/src/lambda_codebase/initial_commit/initial_commit.py @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + """ The Initial Commit main that is called when ADF is installed to commit the initial bootstrap repository content. diff --git a/src/lambda_codebase/initial_commit/pytest.ini b/src/lambda_codebase/initial_commit/pytest.ini index fd32c132e..7c52b357a 100644 --- a/src/lambda_codebase/initial_commit/pytest.ini +++ b/src/lambda_codebase/initial_commit/pytest.ini @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: MIT-0 + [pytest] testpaths = tests norecursedirs = bootstrap_repository diff --git a/src/lambda_codebase/initial_commit/tests/__init__.py b/src/lambda_codebase/initial_commit/tests/__init__.py index e164948b0..b4473968c 100644 --- a/src/lambda_codebase/initial_commit/tests/__init__.py +++ b/src/lambda_codebase/initial_commit/tests/__init__.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/initial_commit/tests/test_initial_commit.py b/src/lambda_codebase/initial_commit/tests/test_initial_commit.py index 104b7fc75..25e7f2892 100644 --- a/src/lambda_codebase/initial_commit/tests/test_initial_commit.py +++ b/src/lambda_codebase/initial_commit/tests/test_initial_commit.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 # pylint: skip-file diff --git a/src/lambda_codebase/moved_to_root.py b/src/lambda_codebase/moved_to_root.py index 80dc7f6cc..4b3a0f8cd 100644 --- a/src/lambda_codebase/moved_to_root.py +++ b/src/lambda_codebase/moved_to_root.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/organization/handler.py b/src/lambda_codebase/organization/handler.py index a4e96fbb3..76a76c723 100644 --- a/src/lambda_codebase/organization/handler.py +++ b/src/lambda_codebase/organization/handler.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/organization/main.py b/src/lambda_codebase/organization/main.py index a02f632c2..241b6cc6d 100644 --- a/src/lambda_codebase/organization/main.py +++ b/src/lambda_codebase/organization/main.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/organization_unit/handler.py b/src/lambda_codebase/organization_unit/handler.py index 761674640..2019c557a 100644 --- a/src/lambda_codebase/organization_unit/handler.py +++ b/src/lambda_codebase/organization_unit/handler.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/organization_unit/main.py b/src/lambda_codebase/organization_unit/main.py index fdb3ce318..52bf9876d 100644 --- a/src/lambda_codebase/organization_unit/main.py +++ b/src/lambda_codebase/organization_unit/main.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/lambda_codebase/wait_until_complete.py b/src/lambda_codebase/wait_until_complete.py index 2587f9643..a957ca457 100644 --- a/src/lambda_codebase/wait_until_complete.py +++ b/src/lambda_codebase/wait_until_complete.py @@ -1,4 +1,4 @@ -# Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. +# Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 """ diff --git a/src/template.yml b/src/template.yml index fba734adf..35af1cc3d 100644 --- a/src/template.yml +++ b/src/template.yml @@ -1,5 +1,5 @@ -# // Copyright 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# // SPDX-License-Identifier: Apache-2.0 +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 AWSTemplateFormatVersion: "2010-09-09" Transform: "AWS::Serverless-2016-10-31" diff --git a/tox.ini b/tox.ini index 5c274c325..bfa0bf282 100644 --- a/tox.ini +++ b/tox.ini @@ -1,3 +1,6 @@ +# Copyright Amazon.com Inc. or its affiliates. +# SPDX-License-Identifier: Apache-2.0 +# # tox (https://tox.readthedocs.io/) is a tool for running tests # in multiple virtualenvs. This configuration file will run the # test suite on all supported python versions. To use it, "pip install tox" From 738dc7b3f2ad000750202fe6553b1862fc6c17b4 Mon Sep 17 00:00:00 2001 From: Simon Kok Date: Mon, 8 Apr 2024 16:30:46 +0200 Subject: [PATCH 2/8] Feat static bootstrap stack names (#712) * Feat change to static bootstrap stack names **Why?** Initially, ADF would generate bootstrap stack names that included the name of the OU at the end. For example, for an OU named banking, it would generate the global `adf-global-base-banking` stack. This, however, makes it harder to harden ADF. As it would need access rights to deploy and manage CloudFormation stacks with a wildcard at the end. Instead of listing a limited number of stack names. Additionally, it makes it harder to write an SCP to limit who can update these stacks as well. **What?** * Instead of using the OU name, the bootstrap stacks will be named: `adf-(global|regional)-base-bootstrap`. * Exception being the `adf-(global|regional)-base-deployment` stack, as this stack contains the resources that ADF needs to operate. As well as the `adf-global-base-adf-build` stack that gets deployed to the management account. Renaming these stacks would require uninstalling ADF and reinstalling it from scratch. Hence these are kept as-is. * Tightened the IAM policies that grant access to manage the bootstrap stacks. * Added a functionality to delete deprecated stacks automatically and upgrade to the new stack name via the `aws-deployment-framework-bootstrap` pipeline. * When a deprecated bootstrap stack is deleted, it will first delete the global-iam stack if required. As the global-iam stack adds policies to the roles that are created in the bootstrap stack. Therefore, the global-iam stack should be removed before the bootstrap stack can be deleted in the global region. * Fix CloudFormation Stack/ChangeSet waiter error capture, to report back the account, region, and stack name that ran into a failure when needed. * Fix /adf_version param lookup to /adf/adf_version --- .../bootstrap_repository/adf-build/global.yml | 25 +- .../bootstrap_repository/adf-build/main.py | 3 + .../adf-build/shared/python/cloudformation.py | 226 ++++++++- .../shared/python/parameter_store.py | 2 +- .../python/tests/stubs/stub_cloudformation.py | 108 ++++ .../python/tests/test_cloudformation.py | 467 +++++++++++++++++- .../python/tests/test_parameter_store.py | 2 + src/template.yml | 33 +- 8 files changed, 823 insertions(+), 43 deletions(-) diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/global.yml b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/global.yml index 204b1ffe0..210b3b935 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/global.yml +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/global.yml @@ -86,11 +86,12 @@ Resources: - cloudformation:CreateChangeSet - cloudformation:CreateStack - cloudformation:CreateUploadBucket - - cloudformation:DeleteStack - cloudformation:DeleteChangeSet - - cloudformation:DescribeStacks + - cloudformation:DeleteStack - cloudformation:DescribeChangeSet + - cloudformation:DescribeStacks - cloudformation:ExecuteChangeSet + - cloudformation:ListStacks - cloudformation:SetStackPolicy - cloudformation:SignalResource - cloudformation:UpdateStack @@ -125,15 +126,16 @@ Resources: - !Sub "arn:${AWS::Partition}:ssm:*:${AWS::AccountId}:parameter/adf/*" - Effect: Allow Action: - - iam:CreateRole - iam:CreatePolicy - - iam:UpdateAssumeRolePolicy + - iam:CreateRole + - iam:DeleteRole + - iam:DeleteRolePolicy - iam:GetRole - iam:GetRolePolicy - - iam:DeleteRole - - iam:TagRole - iam:PutRolePolicy - - iam:DeleteRolePolicy + - iam:TagRole + - iam:UntagRole + - iam:UpdateAssumeRolePolicy Resource: - !Sub "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/adf-cloudformation-role" - !Sub "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/adf-cloudformation-deployment-role" @@ -141,7 +143,14 @@ Resources: - !Sub "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/adf-automation-role" - !Sub "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/adf-readonly-automation-role" - !Sub "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/adf-update-cross-account-access-role" - - !Sub "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/${CrossAccountAccessRole}" - !Sub "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/adf-terraform-role" + - Effect: "Allow" + Action: + - iam:DeleteRole + - iam:DeleteRolePolicy + - iam:UntagRole + Resource: + - !Sub "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/${CrossAccountAccessRole}" + - !Sub "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/${CrossAccountAccessRole}-readonly" Roles: - !Ref OrganizationsRole diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/main.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/main.py index 713300c82..66859803e 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/main.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/main.py @@ -310,6 +310,7 @@ def worker_thread( account_id=account_id ) try: + cloudformation.delete_deprecated_base_stacks() cloudformation.create_stack() if region == config.deployment_account_region: cloudformation.create_iam_stack() @@ -498,6 +499,7 @@ def main(): # pylint: disable=R0915 s3_key_path="adf-bootstrap/" + account_path, account_id=deployment_account_id ) + cloudformation.delete_deprecated_base_stacks() cloudformation.create_stack() update_deployment_account_output_parameters( deployment_account_region=config.deployment_account_region, @@ -520,6 +522,7 @@ def main(): # pylint: disable=R0915 s3_key_path='adf-build', account_id=ACCOUNT_ID ) + cloudformation.delete_deprecated_base_stacks() cloudformation.create_stack() threads = [] account_ids = [ diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/cloudformation.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/cloudformation.py index 53e1f9dda..40d50a03f 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/cloudformation.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/cloudformation.py @@ -8,7 +8,7 @@ import re import os -from botocore.exceptions import WaiterError, ClientError +from botocore.exceptions import WaiterError, ClientError, ValidationError from botocore.config import Config import tenacity @@ -27,6 +27,9 @@ # A stack name can contain only alphanumeric characters (case sensitive) # and hyphens. CFN_UNACCEPTED_CHARS = re.compile(r"[^-a-zA-Z0-9]") +ADF_GLOBAL_IAM_STACK_NAME = 'adf-global-base-iam' +ADF_GLOBAL_BOOTSTRAP_STACK_NAME = 'adf-global-base-bootstrap' +ADF_GLOBAL_ADF_BUILD_STACK_NAME = 'adf-global-base-adf-build' class StackProperties: @@ -62,6 +65,30 @@ class StackProperties: 'DELETE_IN_PROGRESS': 'stack_delete_complete', 'REVIEW_IN_PROGRESS': 'change_set_create_complete', } + all_except_deleted_states = [ + 'CREATE_IN_PROGRESS', + 'CREATE_FAILED', + 'CREATE_COMPLETE', + 'ROLLBACK_IN_PROGRESS', + 'ROLLBACK_FAILED', + 'ROLLBACK_COMPLETE', + 'DELETE_IN_PROGRESS', + 'DELETE_FAILED', + 'UPDATE_IN_PROGRESS', + 'UPDATE_COMPLETE_CLEANUP_IN_PROGRESS', + 'UPDATE_COMPLETE', + 'UPDATE_FAILED', + 'UPDATE_ROLLBACK_IN_PROGRESS', + 'UPDATE_ROLLBACK_FAILED', + 'UPDATE_ROLLBACK_COMPLETE_CLEANUP_IN_PROGRESS', + 'UPDATE_ROLLBACK_COMPLETE', + 'REVIEW_IN_PROGRESS', + 'IMPORT_IN_PROGRESS', + 'IMPORT_COMPLETE', + 'IMPORT_ROLLBACK_IN_PROGRESS', + 'IMPORT_ROLLBACK_FAILED', + 'IMPORT_ROLLBACK_COMPLETE', + ] def __init__( self, @@ -109,9 +136,22 @@ def get_parameters(self): return [] def _get_stack_name(self): - raw_stack_name = f'adf-{self._get_geo_prefix()}-base-{self.ou_name}' + stack_suffix = ( + self.ou_name if self.ou_name in ['deployment', 'adf-build'] + else 'bootstrap' + ) + raw_stack_name = f'adf-{self._get_geo_prefix()}-base-{stack_suffix}' return CFN_UNACCEPTED_CHARS.sub("-", raw_stack_name) + def _get_valid_stack_names(self): + valid_stack_names = [self._get_stack_name()] + if self.region == self.deployment_account_region: + valid_stack_names.append(ADF_GLOBAL_IAM_STACK_NAME) + valid_stack_names.append(ADF_GLOBAL_BOOTSTRAP_STACK_NAME) + valid_stack_names.append(ADF_GLOBAL_ADF_BUILD_STACK_NAME) + + return valid_stack_names + class WaitException(Exception): pass @@ -196,7 +236,7 @@ def _wait_stack(self, waiter_type, stack_name): 'MaxAttempts': 45 } ) - except ClientError as client_error: + except (WaiterError, ClientError) as client_error: LOGGER.error( "%s in %s - Failed to wait for stack %s error %s", self.account_id, @@ -226,14 +266,18 @@ def _wait_change_set(self): 'MaxAttempts': 20 } ) - except ClientError as client_error: - LOGGER.error( - "%s in %s - Failed to wait for change set of %s error %s", - self.account_id, - self.region, - self.stack_name, - client_error, - ) + except (WaiterError, ClientError) as error: + if not CloudFormation._change_set_failed_due_to_empty( + error.last_response["Status"], + error.last_response["StatusReason"], + ): + LOGGER.error( + "%s in %s - Failed to wait for change set of %s error %s", + self.account_id, + self.region, + self.stack_name, + error, + ) raise def _get_waiter_type(self): @@ -450,7 +494,7 @@ def create_iam_stack(self): self.template_url = self.s3.fetch_s3_url( self._create_template_path(self.s3_key_path, 'global-iam') ) - self.stack_name = 'adf-global-base-iam' + self.stack_name = ADF_GLOBAL_IAM_STACK_NAME self._wait_if_in_progress() waiter = self._get_waiter_type() create_change_set = self._create_change_set() @@ -496,17 +540,153 @@ def get_stack_regional_outputs(self): } def delete_all_base_stacks(self, wait_override=False): - for stack in paginator(self.client.list_stacks): - if bool( - re.search( - 'adf-(global|regional)-base', - stack.get('StackName'))): - if stack.get( - 'StackStatus') in StackProperties.clean_stack_status: - LOGGER.warning( - 'Removing Stack: %s', - stack.get('StackName')) - self.delete_stack(stack.get('StackName'), wait_override) + self._delete_base_stacks( + wait_override=wait_override, + ) + + def delete_deprecated_base_stacks(self): + self._delete_base_stacks( + wait_override=True, + deprecated_only=True, + ) + + def _delete_base_stacks( + self, + wait_override=False, + deprecated_only=False, + ): + deleted_any = False + bootstrap_stack_found = False + for stack in paginator( + self.client.list_stacks, + StackStatusFilter=StackProperties.all_except_deleted_states, + ): + matches_search = bool( + re.search( + 'adf-(global|regional)-base', + stack.get('StackName'), + ) + ) + if not matches_search: + continue + if len(stack.get('ParentId', '')) > 0: + # Skip nested stacks + continue + + if deleted_any and stack.get('StackName') == ADF_GLOBAL_IAM_STACK_NAME: + # We deleted the IAM stack already + continue + + should_be_deleted = ( + not deprecated_only + or stack.get('StackName') not in self._get_valid_stack_names() + ) + if not should_be_deleted: + if stack.get('StackName') != ADF_GLOBAL_IAM_STACK_NAME: + bootstrap_stack_found = True + continue + + if stack.get('StackStatus') == 'DELETE_COMPLETE': + # Nothing to do here + continue + + LOGGER.debug( + 'Base stack should be deleted: %s', + stack.get('StackName'), + ) + + should_delete_iam_stack = ( + not deleted_any + and self.region == self.deployment_account_region + and stack.get('StackName') != ADF_GLOBAL_IAM_STACK_NAME + ) + if should_delete_iam_stack: + # Remove the IAM stack before deleting an ADF global stack + # If we are deleting a bootstrap stack, we need to assume this + # might hosts the roles that get policies attached by the + # global-iam stack. Since the policies need to be deleted + # before one can delete the role, we need to delete the global + # IAM stack first. + self._delete_iam_stack_if_exists() + + self._delete_stack_or_instruct_user( + stack_name=stack.get('StackName'), + stack_status=stack.get('StackStatus'), + wait_override=wait_override, + ) + deleted_any = True + + if deprecated_only and not bootstrap_stack_found and not deleted_any: + # If we did not find any bootstrap stack but we did run into the + # global IAM stack, then we should delete the global IAM stack. + # As the policies that the CloudFormation stack manages would + # need to be recreated and applied to new IAM Roles as created + # by a upcoming bootstrap stack. + self._delete_iam_stack_if_exists() + + def _get_stack_status(self, name): + try: + LOGGER.debug( + "%s in %s - Retrieve stack status of: %s", + self.account_id, + self.region, + name, + ) + response = self.client.describe_stacks( + StackName=name, + ) + if response and len(response.get('Stacks', [])) > 0: + return response['Stacks'][0]['StackStatus'] + return None + except (ClientError, ValidationError) as error: + if error.response['Error']['Code'] == 'ValidationError': + LOGGER.debug( + "%s in %s - Stack does not exist: %s", + self.account_id, + self.region, + name, + ) + # If the stack does not exist, a ValidationError is raised. + return None # None implies missing + LOGGER.error( + "%s in %s - Retrieve stack status of: %s failed (%s): %s", + self.account_id, + self.region, + name, + error.response['Error']['Code'], + error.response['Error']['Message'], + ) + raise + + def _delete_iam_stack_if_exists(self): + iam_stack_status = self._get_stack_status(ADF_GLOBAL_IAM_STACK_NAME) + if iam_stack_status: + self._delete_stack_or_instruct_user( + stack_name=ADF_GLOBAL_IAM_STACK_NAME, + stack_status=iam_stack_status, + wait_override=True, + ) + + def _delete_stack_or_instruct_user( + self, + stack_name, + stack_status, + wait_override, + ): + clean_stack_status = ( + stack_status in StackProperties.clean_stack_status + ) + if clean_stack_status: + LOGGER.warning('Removing stack: %s', stack_name) + self.delete_stack(stack_name, wait_override) + return + + LOGGER.warning( + 'Please remove stack %s manually, state %s implies that it ' + 'cannot be deleted automatically', + stack_name, + stack_status, + ) def get_stack_output(self, value): try: diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/parameter_store.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/parameter_store.py index 995c65a4f..e3fee9fc3 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/parameter_store.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/parameter_store.py @@ -94,7 +94,7 @@ def _build_param_name(name, adf_only=True): slash_name = name if name.startswith('/') else f"/{name}" add_prefix = ( adf_only - and not slash_name.startswith(PARAMETER_PREFIX) + and not slash_name.startswith(f"{PARAMETER_PREFIX}/") ) param_prefix = PARAMETER_PREFIX if add_prefix else '' return f"{param_prefix}{slash_name}" diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_cloudformation.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_cloudformation.py index dce8e35f8..68f849a38 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_cloudformation.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_cloudformation.py @@ -19,3 +19,111 @@ 'StackStatus': 'CREATE_IN_PROGRESS' }] } + +list_stacks = { + 'StackSummaries': [ + { + # Should be filtered out, not a ADF base stack + 'StackName': 'adf-different-stack', + 'StackStatus': 'CREATE_COMPLETE', + }, + { + # Should be filtered out when deleting deprecated base stacks + # This is current, not deprecated + 'StackName': 'adf-global-base-bootstrap', + 'StackStatus': 'CREATE_COMPLETE', + }, + { + # Should be filtered out when deleting deprecated base stacks + # This is current, but should only exist in non global regions. + 'StackName': 'adf-regional-base-bootstrap', + 'StackStatus': 'CREATE_COMPLETE', + }, + { + # Should be filtered out when deleting deprecated base stacks + # This is current, but should only exist in the global deployment + # account. + 'StackName': 'adf-global-base-deployment', + 'StackStatus': 'CREATE_COMPLETE', + }, + { + # Should be filtered out when deleting deprecated base stacks + # This is current, but should only exist in the global deployment + # account. + 'StackName': ( + 'adf-global-base-deployment-PipelineManagementApplication-156BTR33REGR' + ), + 'StackStatus': 'CREATE_COMPLETE', + 'ParentId': 'Unique-Stack-Id', + }, + { + # Should be deprecated when deleting deprecated base stacks + 'StackName': 'adf-global-base-deployment-SomeOtherStack', + 'StackStatus': 'CREATE_COMPLETE', + }, + { + # Should be deprecated when deleting deprecated base stacks + 'StackName': 'adf-global-base-bootstrap-SomeNestedStack', + 'StackStatus': 'CREATE_COMPLETE', + 'ParentId': 'Unique-Stack-Id', + }, + { + # Should be filtered out when deleting deprecated base stacks + # This is current, but should only exist in the global management + # account. + 'StackName': 'adf-global-base-adf-build', + 'StackStatus': 'CREATE_COMPLETE', + }, + { + # Should be filtered out when deleting deprecated base stacks + # This is current, not deprecated + 'StackName': 'adf-global-base-iam', + 'StackStatus': 'CREATE_COMPLETE', + }, + { + # Using a deprecated OU name in the base stack name, should be + # deleted when deleting deprecated base stacks. + 'StackName': 'adf-global-base-dev', + 'StackStatus': 'CREATE_COMPLETE', + }, + { + # Using a deprecated OU name in the base stack name, should be + # deleted when deleting deprecated base stacks. + # Note the stack status, this should print a warning instead + # of deleting it. + 'StackName': 'adf-global-base-test', + 'StackStatus': 'CREATE_FAILED', + }, + { + # Using a deprecated OU name in the base stack name, should be + # deleted when deleting deprecated base stacks. + # Note the stack status, this should print a warning instead + # of deleting it. + 'StackName': 'adf-global-base-acceptance', + 'StackStatus': 'ROLLBACK_FAILED', + }, + { + # Using a deprecated OU name in the base stack name, should be + # deleted when deleting deprecated base stacks. + 'StackName': 'adf-global-base-prod', + 'StackStatus': 'UPDATE_COMPLETE', + }, + { + # Using a deprecated OU name in the base stack name, should be + # deleted when deleting deprecated base stacks. + # Note the stack status, this should print a warning instead + # of deleting it. + 'StackName': 'adf-global-base-some-ou', + 'StackStatus': 'CREATE_IN_PROGRESS', + }, + { + # Using a deprecated OU name in the base stack name, should be + # deleted when deleting deprecated base stacks. + # Note the stack status, this should print a warning instead + # of deleting it. + 'StackName': 'adf-global-base-some-old-ou', + 'StackStatus': 'DELETE_COMPLETE', + }, + ], + 'NextToken': 'string', +} diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_cloudformation.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_cloudformation.py index 27bcf7f4a..fd1203aa7 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_cloudformation.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_cloudformation.py @@ -5,9 +5,10 @@ import os import boto3 -from pytest import fixture +from botocore.stub import Stubber +from pytest import fixture, raises from stubs import stub_cloudformation -from mock import Mock +from mock import Mock, call, patch from cloudformation import CloudFormation, StackProperties from s3 import S3 @@ -40,7 +41,7 @@ def global_cls(): stack_name=None, template_url='https://some/path/global.yml', s3=None, - s3_key_path='/some/location', + s3_key_path='adf-bootstrap/some-ou', account_id=123 ) @@ -58,7 +59,67 @@ def test_global_get_geo_prefix(global_cls): def test_global_get_stack_name(global_cls): - assert global_cls.stack_name == 'adf-global-base-location' + assert global_cls.stack_name == 'adf-global-base-bootstrap' + + +def test_global_build_get_stack_name(): + cfn = CloudFormation( + region='us-east-1', + deployment_account_region='us-east-1', + role=boto3, + wait=False, + stack_name=None, + template_url='https://some/path/global.yml', + s3=None, + s3_key_path='adf-build', + account_id=123 + ) + assert cfn.stack_name == 'adf-global-base-adf-build' + + +def test_global_deployment_get_stack_name(): + cfn = CloudFormation( + region='us-east-1', + deployment_account_region='us-east-1', + role=boto3, + wait=False, + stack_name=None, + template_url='https://some/path/global.yml', + s3=None, + s3_key_path='adf-bootstrap/deployment', + account_id=123 + ) + assert cfn.stack_name == 'adf-global-base-deployment' + + +def test_regional_deployment_get_stack_name(): + cfn = CloudFormation( + region='eu-west-1', + deployment_account_region='us-east-1', + role=boto3, + wait=False, + stack_name=None, + template_url='https://some/path/global.yml', + s3=None, + s3_key_path='adf-bootstrap/deployment', + account_id=123 + ) + assert cfn.stack_name == 'adf-regional-base-deployment' + + +def test_regional_target_get_stack_name(): + cfn = CloudFormation( + region='eu-west-1', + deployment_account_region='us-east-1', + role=boto3, + wait=False, + stack_name=None, + template_url='https://some/path/global.yml', + s3=None, + s3_key_path='adf-bootstrap/some/ou/path', + account_id=123 + ) + assert cfn.stack_name == 'adf-regional-base-bootstrap' def test_get_stack_regional_outputs(global_cls): @@ -103,10 +164,404 @@ def test_get_waiter_type_create_complete(global_cls): def test_get_stack_name_remove_unaccepted_chars(): for unaccepted_char in [' ', '%', '$', '*']: props = StackProperties( - region='eu-west-1', + region='eu-central-1', deployment_account_region='eu-west-1', stack_name=None, s3=None, s3_key_path='/some/weird{}location'.format(unaccepted_char), ) - assert props._get_stack_name() == 'adf-global-base-weird-location' + assert props._get_stack_name() == 'adf-regional-base-bootstrap' + + +@patch('cloudformation.LOGGER') +def test_describe_stack_status_success(logger, global_cls): + global_cls.client = Mock() + global_cls.client.describe_stacks.return_value = { + "Stacks": [ + { + 'StackName': 'adf-global-base-iam', + 'StackStatus': 'CREATE_COMPLETE', + }, + ], + } + response = global_cls._get_stack_status('adf-global-base-iam') + assert response == 'CREATE_COMPLETE' + global_cls.client.describe_stacks.assert_has_calls([ + call(StackName='adf-global-base-iam'), + ]) + assert global_cls.client.describe_stacks.call_count == 1 + logger.error.assert_not_called() + + +@patch('cloudformation.LOGGER') +def test_describe_stack_status_empty_stack_list(logger, global_cls): + global_cls.client = Mock() + global_cls.client.describe_stacks.return_value = { + "Stacks": [] + } + response = global_cls._get_stack_status('adf-global-base-iam') + assert response is None + global_cls.client.describe_stacks.assert_has_calls([ + call(StackName='adf-global-base-iam'), + ]) + assert global_cls.client.describe_stacks.call_count == 1 + logger.error.assert_not_called() + + +@patch('cloudformation.LOGGER') +def test_describe_stack_status_empty_response(logger, global_cls): + global_cls.client = Mock() + global_cls.client.describe_stacks.return_value = None + response = global_cls._get_stack_status('adf-global-base-iam') + assert response is None + global_cls.client.describe_stacks.assert_has_calls([ + call(StackName='adf-global-base-iam'), + ]) + assert global_cls.client.describe_stacks.call_count == 1 + logger.error.assert_not_called() + + +@patch('cloudformation.LOGGER') +def test_describe_stack_status_raises_validation_error(logger, global_cls): + client = boto3.client('cloudformation') + stubber = Stubber(client) + stubber.add_client_error('describe_stacks', service_error_code='ValidationError') + stubber.activate() + global_cls.client = client + response = global_cls._get_stack_status('adf-global-base-iam') + assert response is None + logger.error.assert_not_called() + + +@patch('cloudformation.LOGGER') +def test_describe_stack_status_raises_other_error(logger, global_cls): + client = boto3.client('cloudformation') + stubber = Stubber(client) + stubber.add_client_error('describe_stacks', service_error_code='ClientError') + stubber.activate() + global_cls.client = client + with raises(Exception): + global_cls._get_stack_status('adf-global-base-iam') + logger.error.assert_has_calls([ + call( + "%s in %s - Retrieve stack status of: %s failed (%s): %s", + global_cls.account_id, + global_cls.region, + 'adf-global-base-iam', + 'ClientError', + '', + ) + ]) + + +@patch('cloudformation.LOGGER') +@patch("cloudformation.paginator") +def test_delete_all_base_stacks(paginator_mock, logger, global_cls): + global_cls.client = Mock() + paginator_mock.return_value = stub_cloudformation.list_stacks.get('StackSummaries') + global_cls.client.describe_stacks.return_value = { + "Stacks": [ + { + 'StackName': 'adf-global-base-iam', + 'StackStatus': 'CREATE_COMPLETE', + }, + ], + } + global_cls.delete_all_base_stacks() + global_cls.client.delete_stack.assert_has_calls([ + call(StackName='adf-global-base-iam'), + call(StackName='adf-global-base-bootstrap'), + call(StackName='adf-regional-base-bootstrap'), + call(StackName='adf-global-base-deployment'), + call(StackName='adf-global-base-deployment-SomeOtherStack'), + call(StackName='adf-global-base-adf-build'), + call(StackName='adf-global-base-dev'), + call(StackName='adf-global-base-test'), + call(StackName='adf-global-base-acceptance'), + call(StackName='adf-global-base-prod'), + ]) + assert global_cls.client.delete_stack.call_count == 10 + logger.warning.assert_has_calls([ + call('Removing stack: %s', 'adf-global-base-iam'), + # ^ We are deploying in a global region, not regional + call('Removing stack: %s', 'adf-global-base-bootstrap'), + call('Removing stack: %s', 'adf-regional-base-bootstrap'), + call('Removing stack: %s', 'adf-global-base-deployment'), + call('Removing stack: %s', 'adf-global-base-deployment-SomeOtherStack'), + call('Removing stack: %s', 'adf-global-base-adf-build'), + call('Removing stack: %s', 'adf-global-base-dev'), + call('Removing stack: %s', 'adf-global-base-test'), + call('Removing stack: %s', 'adf-global-base-acceptance'), + call('Removing stack: %s', 'adf-global-base-prod'), + call( + 'Please remove stack %s manually, state %s implies that it ' + 'cannot be deleted automatically', + 'adf-global-base-some-ou', + 'CREATE_IN_PROGRESS', + ), + ]) + + +@patch('cloudformation.LOGGER') +@patch("cloudformation.paginator") +def test_delete_deprecated_base_stacks_some_deletions(paginator_mock, logger, global_cls): + global_cls.client = Mock() + paginator_mock.return_value = stub_cloudformation.list_stacks.get('StackSummaries') + global_cls.client.describe_stacks.return_value = { + "Stacks": [ + { + 'StackName': 'adf-global-base-iam', + 'StackStatus': 'CREATE_COMPLETE', + }, + ], + } + global_cls.delete_deprecated_base_stacks() + global_cls.client.delete_stack.assert_has_calls([ + call(StackName='adf-global-base-iam'), + call(StackName='adf-regional-base-bootstrap'), + # ^ We are deploying in a global region, not regional + call(StackName='adf-global-base-deployment'), + # ^ We are not in the deployment OU with this CloudFormation instance + call(StackName='adf-global-base-deployment-SomeOtherStack'), + call(StackName='adf-global-base-dev'), + call(StackName='adf-global-base-test'), + call(StackName='adf-global-base-acceptance'), + call(StackName='adf-global-base-prod'), + ]) + assert global_cls.client.delete_stack.call_count == 8 + logger.warning.assert_has_calls([ + call('Removing stack: %s', 'adf-global-base-iam'), + # ^ As we delete a bootstrap stack we need to recreate the IAM stack, + # hence deleting it. + call('Removing stack: %s', 'adf-regional-base-bootstrap'), + # ^ We are deploying in a global region, not regional + call('Removing stack: %s', 'adf-global-base-deployment'), + # ^ We are not in the deployment OU with this CloudFormation instance + call('Removing stack: %s', 'adf-global-base-deployment-SomeOtherStack'), + call('Removing stack: %s', 'adf-global-base-dev'), + call('Removing stack: %s', 'adf-global-base-test'), + call('Removing stack: %s', 'adf-global-base-acceptance'), + call('Removing stack: %s', 'adf-global-base-prod'), + call( + 'Please remove stack %s manually, state %s implies that it ' + 'cannot be deleted automatically', + 'adf-global-base-some-ou', + 'CREATE_IN_PROGRESS', + ), + ]) + + +@patch('cloudformation.LOGGER') +@patch("cloudformation.paginator") +def test_delete_deprecated_base_stacks_management_account_adf_build(paginator_mock, logger): + global_cls = CloudFormation( + region='us-east-1', + deployment_account_region='us-east-1', + role=boto3, + wait=False, + stack_name=None, + template_url='https://some/path/global.yml', + s3=None, + s3_key_path='adf-build', + account_id=123 + ) + global_cls.client = Mock() + paginator_mock.return_value = stub_cloudformation.list_stacks.get('StackSummaries') + global_cls.client.describe_stacks.return_value = { + "Stacks": [ + { + 'StackName': 'adf-global-base-iam', + 'StackStatus': 'CREATE_COMPLETE', + }, + ], + } + global_cls.delete_deprecated_base_stacks() + global_cls.client.delete_stack.assert_has_calls([ + call(StackName='adf-global-base-iam'), + call(StackName='adf-regional-base-bootstrap'), + # ^ We are deploying in a global region, not regional + call(StackName='adf-global-base-deployment'), + # ^ We are not in the deployment OU with this CloudFormation instance + call(StackName='adf-global-base-deployment-SomeOtherStack'), + call(StackName='adf-global-base-dev'), + call(StackName='adf-global-base-test'), + call(StackName='adf-global-base-acceptance'), + call(StackName='adf-global-base-prod'), + ]) + assert global_cls.client.delete_stack.call_count == 8 + logger.warning.assert_has_calls([ + call('Removing stack: %s', 'adf-global-base-iam'), + # ^ As we delete a bootstrap stack we need to recreate the IAM stack, + # hence deleting it. + call('Removing stack: %s', 'adf-regional-base-bootstrap'), + # ^ We are deploying in a global region, not regional + call('Removing stack: %s', 'adf-global-base-deployment'), + # ^ We are not in the deployment OU with this CloudFormation instance + call('Removing stack: %s', 'adf-global-base-deployment-SomeOtherStack'), + call('Removing stack: %s', 'adf-global-base-dev'), + call('Removing stack: %s', 'adf-global-base-test'), + call('Removing stack: %s', 'adf-global-base-acceptance'), + call('Removing stack: %s', 'adf-global-base-prod'), + call( + 'Please remove stack %s manually, state %s implies that it ' + 'cannot be deleted automatically', + 'adf-global-base-some-ou', + 'CREATE_IN_PROGRESS', + ), + ]) + + +@patch('cloudformation.LOGGER') +@patch("cloudformation.paginator") +def test_delete_deprecated_base_stacks_no_iam(paginator_mock, logger, global_cls): + global_cls.client = Mock() + paginator_mock.return_value = list(filter( + lambda stack: stack.get('StackName') != 'adf-global-base-iam', + stub_cloudformation.list_stacks.get('StackSummaries'), + )) + global_cls.client.describe_stacks.return_value = { + "Stacks": [], + } + global_cls.delete_deprecated_base_stacks() + global_cls.client.delete_stack.assert_has_calls([ + call(StackName='adf-regional-base-bootstrap'), + # ^ We are deploying in a global region, not regional + call(StackName='adf-global-base-deployment'), + # ^ We are not in the deployment OU with this CloudFormation instance + call(StackName='adf-global-base-deployment-SomeOtherStack'), + call(StackName='adf-global-base-dev'), + call(StackName='adf-global-base-test'), + call(StackName='adf-global-base-acceptance'), + call(StackName='adf-global-base-prod'), + ]) + assert global_cls.client.delete_stack.call_count == 7 + logger.warning.assert_has_calls([ + call('Removing stack: %s', 'adf-regional-base-bootstrap'), + # ^ We are deploying in a global region, not regional + call('Removing stack: %s', 'adf-global-base-deployment'), + # ^ We are not in the deployment OU with this CloudFormation instance + call('Removing stack: %s', 'adf-global-base-deployment-SomeOtherStack'), + call('Removing stack: %s', 'adf-global-base-dev'), + call('Removing stack: %s', 'adf-global-base-test'), + call('Removing stack: %s', 'adf-global-base-acceptance'), + call('Removing stack: %s', 'adf-global-base-prod'), + call( + 'Please remove stack %s manually, state %s implies that it ' + 'cannot be deleted automatically', + 'adf-global-base-some-ou', + 'CREATE_IN_PROGRESS', + ), + ]) + + +@patch('cloudformation.LOGGER') +@patch("cloudformation.paginator") +def test_delete_deprecated_base_stacks_all_valid(paginator_mock, logger, global_cls): + global_cls.client = Mock() + paginator_mock.return_value = list(filter( + lambda stack: stack.get('StackName') in [ + 'adf-global-base-bootstrap', + 'adf-global-base-iam', + ], + stub_cloudformation.list_stacks.get('StackSummaries'), + )) + global_cls.client.describe_stacks.return_value = { + "Stacks": [ + { + 'StackName': 'adf-global-base-iam', + 'StackStatus': 'CREATE_COMPLETE', + }, + ], + } + global_cls.delete_deprecated_base_stacks() + global_cls.client.delete_stack.assert_not_called() + logger.warning.assert_not_called() + + +@patch('cloudformation.LOGGER') +@patch("cloudformation.paginator") +def test_delete_deprecated_base_stacks_only_iam(paginator_mock, logger, global_cls): + global_cls.client = Mock() + paginator_mock.return_value = list(filter( + lambda stack: stack.get('StackName') in [ + 'adf-global-base-iam', + ], + stub_cloudformation.list_stacks.get('StackSummaries'), + )) + global_cls.client.describe_stacks.return_value = { + "Stacks": [ + { + 'StackName': 'adf-global-base-iam', + 'StackStatus': 'CREATE_COMPLETE', + }, + ], + } + global_cls.delete_deprecated_base_stacks() + global_cls.client.delete_stack.assert_has_calls([ + call(StackName='adf-global-base-iam'), + ]) + assert global_cls.client.delete_stack.call_count == 1 + logger.warning.assert_has_calls([ + call('Removing stack: %s', 'adf-global-base-iam'), + # ^ As the IAM stack cannot live on its own, it should be deleted + ]) + + +@patch('cloudformation.LOGGER') +@patch("cloudformation.paginator") +def test_delete_deprecated_base_stacks_regional(paginator_mock, logger, regional_cls): + regional_cls.client = Mock() + regional_list_stacks = list(map( + lambda stack: { + **stack, + "StackName": ( + stack.get("StackName") + .replace("regional", "tmp") + .replace("global", "regional") + .replace("tmp", "global") + ), + }, + stub_cloudformation.list_stacks.get('StackSummaries'), + )) + regional_list_stacks.append({ + 'StackName': 'adf-global-base-iam', + 'StackStatus': 'CREATE_COMPLETE', + }) + paginator_mock.return_value = regional_list_stacks + regional_cls.client.describe_stacks.return_value = { + "Stacks": [], + } + regional_cls.delete_deprecated_base_stacks() + regional_cls.client.delete_stack.assert_has_calls([ + call(StackName='adf-global-base-bootstrap'), + # ^ We are deploying in a non-global + call(StackName='adf-regional-base-deployment'), + # ^ We are not in the deployment OU with this CloudFormation instance + call(StackName='adf-regional-base-deployment-SomeOtherStack'), + call(StackName='adf-regional-base-adf-build'), + call(StackName='adf-regional-base-iam'), + call(StackName='adf-regional-base-dev'), + call(StackName='adf-regional-base-test'), + call(StackName='adf-regional-base-acceptance'), + call(StackName='adf-regional-base-prod'), + ]) + assert regional_cls.client.delete_stack.call_count == 9 + logger.warning.assert_has_calls([ + call('Removing stack: %s', 'adf-global-base-bootstrap'), + # ^ We are deploying in a non-global + call('Removing stack: %s', 'adf-regional-base-deployment'), + # ^ We are not in the deployment OU with this CloudFormation instance + call('Removing stack: %s', 'adf-regional-base-deployment-SomeOtherStack'), + call('Removing stack: %s', 'adf-regional-base-adf-build'), + call('Removing stack: %s', 'adf-regional-base-iam'), + call('Removing stack: %s', 'adf-regional-base-dev'), + call('Removing stack: %s', 'adf-regional-base-test'), + call('Removing stack: %s', 'adf-regional-base-acceptance'), + call('Removing stack: %s', 'adf-regional-base-prod'), + call( + 'Please remove stack %s manually, state %s implies that it ' + 'cannot be deleted automatically', + 'adf-regional-base-some-ou', + 'CREATE_IN_PROGRESS', + ), + ]) diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_parameter_store.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_parameter_store.py index 9fa25ef7e..c9367d581 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_parameter_store.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_parameter_store.py @@ -26,6 +26,7 @@ def cls(): [ ('/adf/test', '/adf/test'), ('adf/test', '/adf/test'), + ('/adf_version', '/adf_version'), ('/test', '/test'), ('test', '/test'), ('/other/test', '/other/test'), @@ -44,6 +45,7 @@ def test_build_param_name_not_adf_only(input_name, output_path): [ ('/adf/test', '/adf/test'), ('adf/test', '/adf/test'), + ('/adf_version', '/adf/adf_version'), ('/test', '/adf/test'), ('test', '/adf/test'), ('/other/test', '/adf/other/test'), diff --git a/src/template.yml b/src/template.yml index 35af1cc3d..f772b75dd 100644 --- a/src/template.yml +++ b/src/template.yml @@ -1250,6 +1250,7 @@ Resources: Statement: - Effect: "Allow" Action: + - "cloudformation:ListStacks" - "logs:CreateLogGroup" - "logs:CreateLogStream" - "logs:PutLogEvents" @@ -1294,17 +1295,12 @@ Resources: - !Ref AccountBootstrappingStateMachine - Effect: "Allow" Action: - - "cloudformation:CreateStack" - "cloudformation:DescribeChangeSet" - "cloudformation:DeleteStack" - - "cloudformation:UpdateStack" - "cloudformation:CancelUpdateStack" - "cloudformation:ContinueUpdateRollback" - - "cloudformation:CreateChangeSet" - "cloudformation:DeleteChangeSet" - "cloudformation:DescribeStacks" - - "cloudformation:CreateUploadBucket" - - "cloudformation:ExecuteChangeSet" - "cloudformation:SetStackPolicy" - "cloudformation:SignalResource" - "cloudformation:UpdateTerminationProtection" @@ -1312,6 +1308,20 @@ Resources: - !Sub "arn:${AWS::Partition}:cloudformation:*:*:stack/adf-global-base-*/*" - !Sub "arn:${AWS::Partition}:cloudformation:*:*:stack/adf-regional-base-*/*" - !Sub "arn:${AWS::Partition}:cloudformation:*:${AWS::AccountId}:stack/adf-global-base-adf-build/*" + - Effect: "Allow" + Action: + - "cloudformation:CreateStack" + - "cloudformation:UpdateStack" + - "cloudformation:CreateChangeSet" + - "cloudformation:CreateUploadBucket" + - "cloudformation:ExecuteChangeSet" + Resource: + - !Sub "arn:${AWS::Partition}:cloudformation:${DeploymentAccountMainRegion}:*:stack/adf-global-base-bootstrap/*" + - !Sub "arn:${AWS::Partition}:cloudformation:${DeploymentAccountMainRegion}:*:stack/adf-global-base-iam/*" + - !Sub "arn:${AWS::Partition}:cloudformation:${DeploymentAccountMainRegion}:${DeploymentAccount.AccountId}:stack/adf-global-base-deployment/*" + - !Sub "arn:${AWS::Partition}:cloudformation:${DeploymentAccountMainRegion}:${AWS::AccountId}:stack/adf-global-base-adf-build/*" + - !Sub "arn:${AWS::Partition}:cloudformation:*:*:stack/adf-regional-base-bootstrap/*" + - !Sub "arn:${AWS::Partition}:cloudformation:*:${DeploymentAccount.AccountId}:stack/adf-regional-base-deployment/*" - Effect: "Allow" Action: - "s3:DeleteObject" @@ -1349,6 +1359,19 @@ Resources: Resource: - !Sub "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/${CrossAccountAccessRoleName}" - !Sub "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/${CrossAccountAccessRoleName}-readonly" + - Effect: "Allow" + Action: + - "iam:DeleteRole" + - "iam:DeleteRolePolicy" + - "iam:UntagRole" + Resource: + - !Sub "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/adf-automation-role" + - !Sub "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/adf-cloudformation-deployment-role" + - !Sub "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/adf-cloudformation-role" + - !Sub "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/adf-codecommit-role" + - !Sub "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/adf-readonly-automation-role" + - !Sub "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/adf-terraform-role" + - !Sub "arn:${AWS::Partition}:iam::${AWS::AccountId}:role/adf-update-cross-account-access-role" CodeCommitRepository: Type: AWS::CodeCommit::Repository From ccd6684d0dc6d7218ec92b34f091297c2b66630d Mon Sep 17 00:00:00 2001 From: Javy de Koning Date: Mon, 8 Apr 2024 18:53:06 +0200 Subject: [PATCH 3/8] minor doc fix (#707) Co-authored-by: Javy de Koning --- docs/pipeline-types-guide.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/pipeline-types-guide.md b/docs/pipeline-types-guide.md index 9bcd8312a..15b55efd0 100644 --- a/docs/pipeline-types-guide.md +++ b/docs/pipeline-types-guide.md @@ -5,7 +5,7 @@ - [Source Code](#source-code) - [adf-build/shared/cdk/cdk_stacks/custom_pipeline.py](#adf-buildsharedcdkcdk_stackscustom_pipelinepy) - [adf-build/shared/cdk/cdk_stacks/main.py](#adf-buildsharedcdkcdk_stacksmainpy) - - [adf-build/shared/schema_validation.py](#adf-buildsharedschema_validationpy) + - [adf-build/shared/python/schema_validation.py](#adf-buildsharedschema_validationpy) - [Using a custom pipeline type](#using-a-custom-pipeline-type) In order to enhance the flexibility of ADF, it is possible to define custom From 5d6e5ce2b4c0d01e670da0e2fd13e80bdab618a6 Mon Sep 17 00:00:00 2001 From: Javy de Koning Date: Mon, 8 Apr 2024 21:57:23 +0200 Subject: [PATCH 4/8] feat: BASH_SHFMT linter + linter fixes (#709) --- .editorconfig | 3 + .mega-linter.yml | 7 +- .../scripts/validate.sh | 2 +- .../scripts/install-codedeploy.sh | 33 ++- .../scripts/install-deps.sh | 6 +- .../sample-fargate-node-app/build/docker.sh | 3 +- .../shared/helpers/package_transform.sh | 26 ++- .../shared/helpers/terraform/adf_terraform.sh | 200 ++++++++---------- 8 files changed, 138 insertions(+), 142 deletions(-) diff --git a/.editorconfig b/.editorconfig index c7a938d82..9ace96ac9 100644 --- a/.editorconfig +++ b/.editorconfig @@ -56,3 +56,6 @@ max_line_length = 120 indent_style = tab indent_size = 4 tab_width = 4 + +[*.sh] +space_redirects = true diff --git a/.mega-linter.yml b/.mega-linter.yml index c89e80a57..29fb905a3 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -10,6 +10,7 @@ APPLY_FIXES: none # If you use ENABLE_LINTERS variable, all other linters will be disabled by default ENABLE_LINTERS: - BASH_EXEC + - BASH_SHFMT - CLOUDFORMATION_CFN_LINT - DOCKERFILE_HADOLINT - EDITORCONFIG_EDITORCONFIG_CHECKER @@ -30,16 +31,20 @@ FILEIO_REPORTER: false # Install plugin for list handling. JSON_PRETTIER_PRE_COMMANDS: - - command: "npm install prettier-plugin-multiline-arrays@3.0.0" + - command: "npm install prettier-plugin-multiline-arrays@3.0.4" cwd: "workspace" CLOUDFORMATION_CFN_LINT_CONFIG_FILE: '.cfnlintrc' CLOUDFORMATION_CFN_LINT_FILE_EXTENSIONS: [".yml", ".yaml"] + EDITORCONFIG_EDITORCONFIG_CHECKER_CONFIG_FILE: '.ecrc.json' + MARKDOWN_MARKDOWN_LINK_CHECK_ARGUMENTS: '-q' MARKDOWN_MARKDOWNLINT_DISABLE_ERRORS: false + SPELL_CSPELL_ARGUMENTS: '--gitignore --no-progress --show-suggestions' SPELL_CSPELL_FILE_EXTENSIONS: ["*"] + TERRAFORM_TFLINT_UNSECURED_ENV_VARIABLES: - GITHUB_TOKEN diff --git a/samples/sample-ec2-java-app-codedeploy/scripts/validate.sh b/samples/sample-ec2-java-app-codedeploy/scripts/validate.sh index be90adf22..527866678 100755 --- a/samples/sample-ec2-java-app-codedeploy/scripts/validate.sh +++ b/samples/sample-ec2-java-app-codedeploy/scripts/validate.sh @@ -7,7 +7,7 @@ echo "Waiting for 15 seconds before checking health.." sleep 15 status_code=$(curl --write-out %{http_code} --silent --output /dev/null http://localhost:80) -if [[ "$status_code" -ne 200 ]] ; then +if [[ "$status_code" -ne 200 ]]; then echo "App is not healthy - $status_code" exit 1 else diff --git a/samples/sample-ec2-with-codedeploy/scripts/install-codedeploy.sh b/samples/sample-ec2-with-codedeploy/scripts/install-codedeploy.sh index 68191cc9f..3523b17db 100755 --- a/samples/sample-ec2-with-codedeploy/scripts/install-codedeploy.sh +++ b/samples/sample-ec2-with-codedeploy/scripts/install-codedeploy.sh @@ -7,10 +7,10 @@ set -xe ## Code Deploy Agent Bootstrap Script ## -exec > >(tee /var/log/user-data.log|logger -t user-data -s 2>/dev/console) 2>&1 +exec > >(tee /var/log/user-data.log | logger -t user-data -s 2> /dev/console) 2>&1 AUTOUPDATE=false -function installdep(){ +function installdep() { if [ ${PLAT} = "ubuntu" ]; then apt-get -y update # Satisfying even Ubuntu older versions. @@ -21,7 +21,7 @@ function installdep(){ fi } -function platformize(){ +function platformize() { # Linux OS detection if hash lsb_release; then echo "Ubuntu server OS detected" @@ -35,8 +35,7 @@ function platformize(){ fi } - -function execute(){ +function execute() { if [ ${PLAT} = "ubuntu" ]; then cd /tmp/ wget https://aws-codedeploy-${REGION}.s3.${REGION}.amazonaws.com/latest/install @@ -44,12 +43,12 @@ function execute(){ if ./install auto; then echo "Installation completed" - if ! ${AUTOUPDATE}; then - echo "Disabling Auto Update" - sed -i '/@reboot/d' /etc/cron.d/codedeploy-agent-update - chattr +i /etc/cron.d/codedeploy-agent-update - rm -f /tmp/install - fi + if ! ${AUTOUPDATE}; then + echo "Disabling Auto Update" + sed -i '/@reboot/d' /etc/cron.d/codedeploy-agent-update + chattr +i /etc/cron.d/codedeploy-agent-update + rm -f /tmp/install + fi exit 0 else echo "Installation script failed, please investigate" @@ -64,12 +63,12 @@ function execute(){ if ./install auto; then echo "Installation completed" - if ! ${AUTOUPDATE}; then - echo "Disabling auto update" - sed -i '/@reboot/d' /etc/cron.d/codedeploy-agent-update - chattr +i /etc/cron.d/codedeploy-agent-update - rm -f /tmp/install - fi + if ! ${AUTOUPDATE}; then + echo "Disabling auto update" + sed -i '/@reboot/d' /etc/cron.d/codedeploy-agent-update + chattr +i /etc/cron.d/codedeploy-agent-update + rm -f /tmp/install + fi exit 0 else echo "Installation script failed, please investigate" diff --git a/samples/sample-ec2-with-codedeploy/scripts/install-deps.sh b/samples/sample-ec2-with-codedeploy/scripts/install-deps.sh index 286723b72..d8f580a98 100755 --- a/samples/sample-ec2-with-codedeploy/scripts/install-deps.sh +++ b/samples/sample-ec2-with-codedeploy/scripts/install-deps.sh @@ -33,11 +33,13 @@ sudo useradd springboot sudo chsh -s /sbin/nologin springboot # forward port 80 to 8080 -echo " +echo " + ProxyRequests Off ProxyPass / http://localhost:8080/ ProxyPassReverse / http://localhost:8080/ -" >> sudo /etc/httpd/conf/httpd.conf + +" | sudo tee -a /etc/httpd/conf/httpd.conf > /dev/null # start the httpd service now and stop it until userdata sudo service httpd start diff --git a/samples/sample-fargate-node-app/build/docker.sh b/samples/sample-fargate-node-app/build/docker.sh index 00af49e54..01a3dc7f0 100755 --- a/samples/sample-fargate-node-app/build/docker.sh +++ b/samples/sample-fargate-node-app/build/docker.sh @@ -14,4 +14,5 @@ docker tag $REPOSITORY_URI:latest $REPOSITORY_URI:$IMAGE_TAG docker push $REPOSITORY_URI:latest docker push $REPOSITORY_URI:$IMAGE_TAG -tmp=$(mktemp); jq --arg REPOSITORY_URI "$REPOSITORY_URI" --arg IMAGE_TAG "$IMAGE_TAG" '.Parameters.Image = $REPOSITORY_URI+":"+$IMAGE_TAG' params/global.json > "$tmp" && mv "$tmp" params/global.json +tmp=$(mktemp) +jq --arg REPOSITORY_URI "$REPOSITORY_URI" --arg IMAGE_TAG "$IMAGE_TAG" '.Parameters.Image = $REPOSITORY_URI+":"+$IMAGE_TAG' params/global.json > "$tmp" && mv "$tmp" params/global.json diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/package_transform.sh b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/package_transform.sh index 1e5a50d30..320fdccbb 100755 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/package_transform.sh +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/package_transform.sh @@ -14,16 +14,15 @@ set -e SKIP_BUILD=0 # Walk through the options passed to this script -for i in "$@" -do +for i in "$@"; do case $i in - --no-build) - SKIP_BUILD=1 - ;; - *) - echo "Unknown option: $i" - exit 1 - ;; + --no-build) + SKIP_BUILD=1 + ;; + *) + echo "Unknown option: $i" + exit 1 + ;; esac done @@ -37,16 +36,15 @@ fi # Get list of regions supported by this application echo "Determine which regions need to be prepared" -app_regions=`aws ssm get-parameters --names /adf/deployment/$ADF_DEPLOYMENT_MAP_SOURCE/$ADF_PROJECT_NAME/regions --with-decryption --output=text --query='Parameters[0].Value'` +app_regions=$(aws ssm get-parameters --names /adf/deployment/$ADF_DEPLOYMENT_MAP_SOURCE/$ADF_PROJECT_NAME/regions --with-decryption --output=text --query='Parameters[0].Value') # Convert json list to bash list (space delimited regions) -regions="`echo $app_regions | sed -e 's/\[\([^]]*\)\]/\1/g' | sed 's/,/ /g' | sed "s/'//g"`" +regions="$(echo $app_regions | sed -e 's/\[\([^]]*\)\]/\1/g' | sed 's/,/ /g' | sed "s/'//g")" -for region in $regions -do +for region in $regions; do if [ $CONTAINS_TRANSFORM ]; then echo "Packaging templates for region $region" ssm_bucket_name="/adf/cross_region/s3_regional_bucket/$region" - bucket=`aws ssm get-parameters --names $ssm_bucket_name --with-decryption --output=text --query='Parameters[0].Value'` + bucket=$(aws ssm get-parameters --names $ssm_bucket_name --with-decryption --output=text --query='Parameters[0].Value') sam package --s3-bucket $bucket --output-template-file $CODEBUILD_SRC_DIR/template_$region.yml --region $region else # If package is not needed, just copy the file for each region diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/terraform/adf_terraform.sh b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/terraform/adf_terraform.sh index 5584e129e..d0cc920eb 100755 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/terraform/adf_terraform.sh +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/terraform/adf_terraform.sh @@ -9,123 +9,111 @@ CURRENT=$(pwd) terraform --version echo "Terraform stage: $TF_STAGE" -tfinit(){ - # retrieve regional S3 bucket name from parameter store - S3_BUCKET_REGION_NAME=$(aws ssm get-parameter --name "/adf/cross_region/s3_regional_bucket/$AWS_REGION" --region "$AWS_DEFAULT_REGION" | jq .Parameter.Value | sed s/\"//g) - mkdir -p "${CURRENT}/tmp/${TF_VAR_TARGET_ACCOUNT_ID}-${AWS_REGION}" - cd "${CURRENT}/tmp/${TF_VAR_TARGET_ACCOUNT_ID}-${AWS_REGION}" || exit - cp -R "${CURRENT}"/tf/. "${CURRENT}/tmp/${TF_VAR_TARGET_ACCOUNT_ID}-${AWS_REGION}" - # if account related variables exist copy the folder in the work directory - if [ -d "${CURRENT}/tfvars/${TF_VAR_TARGET_ACCOUNT_ID}" ]; then - cp -R "${CURRENT}/tfvars/${TF_VAR_TARGET_ACCOUNT_ID}/." "${CURRENT}/tmp/${TF_VAR_TARGET_ACCOUNT_ID}-${AWS_REGION}" - fi - if [ -d "${CURRENT}/tfvars/${TF_VAR_TARGET_ACCOUNT_ID}/${AWS_REGION}" ]; then - cp -R "${CURRENT}/tfvars/${TF_VAR_TARGET_ACCOUNT_ID}/${AWS_REGION}"/. "${CURRENT}/tmp/${TF_VAR_TARGET_ACCOUNT_ID}-${AWS_REGION}" - fi - if [ -f "${CURRENT}/tfvars/global.auto.tfvars" ]; then - cp -R "${CURRENT}/tfvars/global.auto.tfvars" "${CURRENT}/tmp/${TF_VAR_TARGET_ACCOUNT_ID}-${AWS_REGION}" - fi - terraform init \ - -backend-config "bucket=$S3_BUCKET_REGION_NAME" \ - -backend-config "region=$AWS_REGION" \ - -backend-config "key=$ADF_PROJECT_NAME/$ACCOUNT_ID.tfstate" \ - -backend-config "dynamodb_table=adf-tflocktable" +tfinit() { + # retrieve regional S3 bucket name from parameter store + S3_BUCKET_REGION_NAME=$(aws ssm get-parameter --name "/adf/cross_region/s3_regional_bucket/$AWS_REGION" --region "$AWS_DEFAULT_REGION" | jq .Parameter.Value | sed s/\"//g) + mkdir -p "${CURRENT}/tmp/${TF_VAR_TARGET_ACCOUNT_ID}-${AWS_REGION}" + cd "${CURRENT}/tmp/${TF_VAR_TARGET_ACCOUNT_ID}-${AWS_REGION}" || exit + cp -R "${CURRENT}"/tf/. "${CURRENT}/tmp/${TF_VAR_TARGET_ACCOUNT_ID}-${AWS_REGION}" + # if account related variables exist copy the folder in the work directory + if [ -d "${CURRENT}/tfvars/${TF_VAR_TARGET_ACCOUNT_ID}" ]; then + cp -R "${CURRENT}/tfvars/${TF_VAR_TARGET_ACCOUNT_ID}/." "${CURRENT}/tmp/${TF_VAR_TARGET_ACCOUNT_ID}-${AWS_REGION}" + fi + if [ -d "${CURRENT}/tfvars/${TF_VAR_TARGET_ACCOUNT_ID}/${AWS_REGION}" ]; then + cp -R "${CURRENT}/tfvars/${TF_VAR_TARGET_ACCOUNT_ID}/${AWS_REGION}"/. "${CURRENT}/tmp/${TF_VAR_TARGET_ACCOUNT_ID}-${AWS_REGION}" + fi + if [ -f "${CURRENT}/tfvars/global.auto.tfvars" ]; then + cp -R "${CURRENT}/tfvars/global.auto.tfvars" "${CURRENT}/tmp/${TF_VAR_TARGET_ACCOUNT_ID}-${AWS_REGION}" + fi + terraform init \ + -backend-config "bucket=$S3_BUCKET_REGION_NAME" \ + -backend-config "region=$AWS_REGION" \ + -backend-config "key=$ADF_PROJECT_NAME/$ACCOUNT_ID.tfstate" \ + -backend-config "dynamodb_table=adf-tflocktable" - echo "Bucket: $S3_BUCKET_REGION_NAME" - echo "Region: $AWS_REGION" - echo "Key: $ADF_PROJECT_NAME/$ACCOUNT_ID.tfstate" - echo "DynamoDB table: adf-tflocktable" + echo "Bucket: $S3_BUCKET_REGION_NAME" + echo "Region: $AWS_REGION" + echo "Key: $ADF_PROJECT_NAME/$ACCOUNT_ID.tfstate" + echo "DynamoDB table: adf-tflocktable" } -tfplan(){ - DATE=$(date +%Y-%m-%d) - TS=$(date +%Y%m%d%H%M%S) - bash "${CURRENT}/adf-build/helpers/sts.sh" "${TF_VAR_TARGET_ACCOUNT_ID}" "${TF_VAR_TARGET_ACCOUNT_ROLE}" - set -o pipefail - terraform plan -out "${ADF_PROJECT_NAME}-${TF_VAR_TARGET_ACCOUNT_ID}" 2>&1 | tee -a "${ADF_PROJECT_NAME}-${TF_VAR_TARGET_ACCOUNT_ID}-${TS}.log" - set +o pipefail - # Save Terraform plan results to the S3 bucket - aws s3 cp "${ADF_PROJECT_NAME}-${TF_VAR_TARGET_ACCOUNT_ID}-${TS}.log" "s3://${S3_BUCKET_REGION_NAME}/${ADF_PROJECT_NAME}/tf-plan/${DATE}/${TF_VAR_TARGET_ACCOUNT_ID}/${ADF_PROJECT_NAME}-${TF_VAR_TARGET_ACCOUNT_ID}-${TS}.log" - echo "Path to terraform plan s3://$S3_BUCKET_REGION_NAME/$ADF_PROJECT_NAME/tf-plan/$DATE/$TF_VAR_TARGET_ACCOUNT_ID/$ADF_PROJECT_NAME-$TF_VAR_TARGET_ACCOUNT_ID-$TS.log" +tfplan() { + DATE=$(date +%Y-%m-%d) + TS=$(date +%Y%m%d%H%M%S) + bash "${CURRENT}/adf-build/helpers/sts.sh" "${TF_VAR_TARGET_ACCOUNT_ID}" "${TF_VAR_TARGET_ACCOUNT_ROLE}" + set -o pipefail + terraform plan -out "${ADF_PROJECT_NAME}-${TF_VAR_TARGET_ACCOUNT_ID}" 2>&1 | tee -a "${ADF_PROJECT_NAME}-${TF_VAR_TARGET_ACCOUNT_ID}-${TS}.log" + set +o pipefail + # Save Terraform plan results to the S3 bucket + aws s3 cp "${ADF_PROJECT_NAME}-${TF_VAR_TARGET_ACCOUNT_ID}-${TS}.log" "s3://${S3_BUCKET_REGION_NAME}/${ADF_PROJECT_NAME}/tf-plan/${DATE}/${TF_VAR_TARGET_ACCOUNT_ID}/${ADF_PROJECT_NAME}-${TF_VAR_TARGET_ACCOUNT_ID}-${TS}.log" + echo "Path to terraform plan s3://$S3_BUCKET_REGION_NAME/$ADF_PROJECT_NAME/tf-plan/$DATE/$TF_VAR_TARGET_ACCOUNT_ID/$ADF_PROJECT_NAME-$TF_VAR_TARGET_ACCOUNT_ID-$TS.log" } -tfapply(){ - terraform apply "${ADF_PROJECT_NAME}-${TF_VAR_TARGET_ACCOUNT_ID}" +tfapply() { + terraform apply "${ADF_PROJECT_NAME}-${TF_VAR_TARGET_ACCOUNT_ID}" } -tfplandestroy(){ - terraform plan -destroy -out "${ADF_PROJECT_NAME}-${TF_VAR_TARGET_ACCOUNT_ID}-destroy" +tfplandestroy() { + terraform plan -destroy -out "${ADF_PROJECT_NAME}-${TF_VAR_TARGET_ACCOUNT_ID}-destroy" } -tfdestroy(){ - terraform apply "${ADF_PROJECT_NAME}-${TF_VAR_TARGET_ACCOUNT_ID}-destroy" +tfdestroy() { + terraform apply "${ADF_PROJECT_NAME}-${TF_VAR_TARGET_ACCOUNT_ID}-destroy" } -tfrun(){ - export TF_VAR_TARGET_ACCOUNT_ID=$ACCOUNT_ID - echo "Running terraform $TF_STAGE on account $ACCOUNT_ID and region $REGION" - if [[ "$TF_STAGE" = "init" ]] - then - set -e - tfinit - set +e - elif [[ "$TF_STAGE" = "plan" ]] - then - set -e - tfinit - tfplan - set +e - elif [[ "$TF_STAGE" = "apply" ]] - then - set -e - tfinit - tfplan - tfapply - set +e - elif [[ "$TF_STAGE" = "destroy" ]] - then - set -e - tfinit - tfplandestroy - tfdestroy - set +e - else - echo "Invalid Terraform stage: TF_STAGE = $TF_STAGE" - exit 1 - fi +tfrun() { + export TF_VAR_TARGET_ACCOUNT_ID=$ACCOUNT_ID + echo "Running terraform $TF_STAGE on account $ACCOUNT_ID and region $REGION" + if [[ "$TF_STAGE" = "init" ]]; then + set -e + tfinit + set +e + elif [[ "$TF_STAGE" = "plan" ]]; then + set -e + tfinit + tfplan + set +e + elif [[ "$TF_STAGE" = "apply" ]]; then + set -e + tfinit + tfplan + tfapply + set +e + elif [[ "$TF_STAGE" = "destroy" ]]; then + set -e + tfinit + tfplandestroy + tfdestroy + set +e + else + echo "Invalid Terraform stage: TF_STAGE = $TF_STAGE" + exit 1 + fi } # if REGIONS is not defined as pipeline parameters use default region -if [[ -z "$REGIONS" ]] -then - REGIONS=$AWS_DEFAULT_REGION +if [[ -z "$REGIONS" ]]; then + REGIONS=$AWS_DEFAULT_REGION fi echo "List of target regions: $REGIONS" -for REGION in $(echo "$REGIONS" | sed "s/,/ /g") -do - AWS_REGION=$(echo -n "$REGION" | sed 's/^[ \t]*//;s/[ \t]*$//') # sed trims whitespaces - export TF_VAR_TARGET_REGION=$AWS_REGION - # if TARGET_ACCOUNTS and TARGET_OUS are not defined apply to all accounts - if [[ -z "$TARGET_ACCOUNTS" ]] && [[ -z "$TARGET_OUS" ]] - then - echo "Apply to all accounts" - for ACCOUNT_ID in $(jq '.[].AccountId' "${CURRENT}/accounts.json" | sed 's/"//g' ) - do - tfrun - done - fi +for REGION in $(echo "$REGIONS" | sed "s/,/ /g"); do + AWS_REGION=$(echo -n "$REGION" | sed 's/^[ \t]*//;s/[ \t]*$//') # sed trims whitespaces + export TF_VAR_TARGET_REGION=$AWS_REGION + # if TARGET_ACCOUNTS and TARGET_OUS are not defined apply to all accounts + if [[ -z "$TARGET_ACCOUNTS" ]] && [[ -z "$TARGET_OUS" ]]; then + echo "Apply to all accounts" + for ACCOUNT_ID in $(jq '.[].AccountId' "${CURRENT}/accounts.json" | sed 's/"//g'); do + tfrun + done + fi - if ! [[ -z "$TARGET_ACCOUNTS" ]] - then - # apply only on a subset of accounts (TARGET_ACCOUNTS) - echo "List of target account: $TARGET_ACCOUNTS" - for ACCOUNT_ID in $(echo "$TARGET_ACCOUNTS" | sed "s/,/ /g") - do - tfrun - done - fi + if ! [[ -z "$TARGET_ACCOUNTS" ]]; then + # apply only on a subset of accounts (TARGET_ACCOUNTS) + echo "List of target account: $TARGET_ACCOUNTS" + for ACCOUNT_ID in $(echo "$TARGET_ACCOUNTS" | sed "s/,/ /g"); do + tfrun + done + fi - if ! [[ -z "$TARGET_OUS" ]] - then - echo "List target OUs: $TARGET_OUS" - for ACCOUNT_ID in $(jq '.[].AccountId' "${CURRENT}/accounts_from_ous.json" | sed 's/"//g' ) - do - tfrun - done - fi + if ! [[ -z "$TARGET_OUS" ]]; then + echo "List target OUs: $TARGET_OUS" + for ACCOUNT_ID in $(jq '.[].AccountId' "${CURRENT}/accounts_from_ous.json" | sed 's/"//g'); do + tfrun + done + fi done From 3517078cb424361c63cf7654fb8c0363e45d1cae Mon Sep 17 00:00:00 2001 From: Simon Kok Date: Tue, 9 Apr 2024 12:47:09 +0200 Subject: [PATCH 5/8] Update CDK v2.136, SAM CLI 1.114, and others (#715) * Update CDK v2.136, SAM CLI 1.114, and others **Why?** To catch-up with the latest enhancements made in CDK and SAM CLI. **What?** Updated: * CDK to v2.136.0 * SAM CLI to v1.114.0 * And other packages to the most recent version that is compatible * Use yield-from as suggested by pylint --- requirements-dev.txt | 12 ++++++------ requirements.txt | 8 ++++---- samples/sample-rdk-rules/requirements.txt | 2 +- .../account_processing/requirements.txt | 2 +- .../determine_default_branch/requirements.txt | 2 +- .../lambda_codebase/initial_commit/requirements.txt | 4 ++-- .../adf-bootstrap/deployment/pipeline_management.yml | 2 +- .../adf-build/requirements-dev.txt | 4 ++-- .../bootstrap_repository/adf-build/requirements.txt | 12 ++++++------ .../adf-build/shared/helpers/requirements-dev.txt | 2 +- .../adf-build/shared/helpers/requirements.txt | 4 ++-- .../adf-build/shared/python/paginator.py | 3 +-- .../adf-build/shared/python/requirements.txt | 8 ++++---- .../adf-build/shared/requirements-dev.txt | 2 +- .../adf-build/shared/requirements.txt | 12 ++++++------ .../bootstrap_repository/requirements-dev.txt | 2 +- src/lambda_codebase/initial_commit/requirements.txt | 4 ++-- 17 files changed, 42 insertions(+), 43 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 0155bdfe2..6a9d257ee 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,9 +1,9 @@ -cfn-lint==0.83.8 +cfn-lint~=0.86.2 isort==5.13.2 mock==5.1.0 -pylint==3.0.3 -pytest~=7.4.4 -pytest-cov==4.1.0 -tox==4.11.4 -yamllint==1.33.0 +pylint==3.1.0 +pytest~=8.1.1 +pytest-cov==5.0.0 +tox==4.14.2 +yamllint==1.35.1 yq==3.2.3 diff --git a/requirements.txt b/requirements.txt index 16d7241c0..670914536 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,6 @@ -astroid==3.0.2 -aws-sam-cli==1.107.0 -boto3==1.34.17 -botocore==1.34.17 +astroid==3.1.0 +aws-sam-cli==1.114.0 +boto3==1.34.80 +botocore==1.34.80 pyyaml~=6.0.1 schema==0.7.5 diff --git a/samples/sample-rdk-rules/requirements.txt b/samples/sample-rdk-rules/requirements.txt index 942841010..e34a0b267 100644 --- a/samples/sample-rdk-rules/requirements.txt +++ b/samples/sample-rdk-rules/requirements.txt @@ -1,3 +1,3 @@ s3==3.0.0 -boto3==1.34.17 +boto3==1.34.80 argparse==1.4.0 diff --git a/src/lambda_codebase/account_processing/requirements.txt b/src/lambda_codebase/account_processing/requirements.txt index 8ba2e527e..2542bd380 100644 --- a/src/lambda_codebase/account_processing/requirements.txt +++ b/src/lambda_codebase/account_processing/requirements.txt @@ -1,2 +1,2 @@ -aws-xray-sdk==2.12.1 +aws-xray-sdk==2.13.0 pyyaml~=6.0.1 diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/determine_default_branch/requirements.txt b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/determine_default_branch/requirements.txt index 790ada691..70f2daef7 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/determine_default_branch/requirements.txt +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/determine_default_branch/requirements.txt @@ -1,2 +1,2 @@ -boto3==1.34.17 +boto3==1.34.80 cfn-custom-resource~=1.0.1 diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/requirements.txt b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/requirements.txt index 6cd53216a..aa81fab49 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/requirements.txt +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/requirements.txt @@ -1,4 +1,4 @@ Jinja2==3.1.3 -boto3==1.34.17 +boto3==1.34.80 cfn-custom-resource~=1.0.1 -markupsafe==2.1.3 +markupsafe==2.1.5 diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/pipeline_management.yml b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/pipeline_management.yml index 86769c7fd..074db0003 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/pipeline_management.yml +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/pipeline_management.yml @@ -689,7 +689,7 @@ Resources: python: 3.12 nodejs: 20 commands: - - npm install aws-cdk@2.119.0 -g -y --quiet --no-progress + - npm install aws-cdk@2.136.0 -g -y --quiet --no-progress - aws s3 cp s3://$SHARED_MODULES_BUCKET/adf-build/ ./adf-build/ --recursive --quiet - pip install -r adf-build/requirements.txt -q -t ./adf-build - chmod 755 adf-build/cdk/execute_pipeline_stacks.py adf-build/cdk/generate_pipeline_stacks.py diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/requirements-dev.txt b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/requirements-dev.txt index 3e91a948e..3bd6ffa05 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/requirements-dev.txt +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/requirements-dev.txt @@ -1,3 +1,3 @@ mock~=5.1.0 -pylint~=3.0.3 -pytest~=7.4.3 +pylint~=3.1.0 +pytest~=8.1.1 diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/requirements.txt b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/requirements.txt index 87f7a3a9e..484813f7a 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/requirements.txt +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/requirements.txt @@ -1,11 +1,11 @@ # Install libs here that you might want in AWS CodeBuild (On the management # account) -astroid==3.0.2 -aws-sam-cli==1.107.0 -boto3==1.34.17 -botocore==1.34.17 -pip~=23.3 +astroid==3.1.0 +aws-sam-cli==1.114.0 +boto3==1.34.80 +botocore==1.34.80 +pip~=24.0 pyyaml~=6.0.1 six~=1.16.0 tenacity==8.2.3 -urllib3~=2.0.7 +urllib3~=2.2.1 diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/requirements-dev.txt b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/requirements-dev.txt index 5f12e99ac..bcf35acca 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/requirements-dev.txt +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/requirements-dev.txt @@ -1 +1 @@ -pytest-env~=0.8.2 +pytest-env~=1.1.3 diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/requirements.txt b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/requirements.txt index 6107c7292..e14102aec 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/requirements.txt +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/helpers/requirements.txt @@ -1,4 +1,4 @@ -boto3==1.34.17 -botocore==1.34.17 +boto3==1.34.80 +botocore==1.34.80 docopt~=0.6.2 schema==0.7.5 diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/paginator.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/paginator.py index bb02a7c8c..27effebde 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/paginator.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/paginator.py @@ -11,5 +11,4 @@ def paginator(method, **kwargs): client = method.__self__ iterator = client.get_paginator(method.__name__) for page in iterator.paginate(**kwargs).result_key_iters(): - for result in page: - yield result + yield from page diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/requirements.txt b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/requirements.txt index 951e35b23..a648a3e39 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/requirements.txt +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/requirements.txt @@ -1,9 +1,9 @@ # Install libs here that you might want in the ADF Shared Python Lambda Layer -boto3==1.34.17 -botocore==1.34.17 +boto3==1.34.80 +botocore==1.34.80 pyyaml~=6.0.1 schema~=0.7.5 tenacity==8.2.3 -typing-extensions~=4.9.0 +typing-extensions~=4.11.0 urllib3~=1.26.18 ; python_version < "3.10" -urllib3~=2.0.7 ; python_version >= "3.10" +urllib3~=2.2.1 ; python_version >= "3.10" diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/requirements-dev.txt b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/requirements-dev.txt index c88fd67fb..7b30764d5 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/requirements-dev.txt +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/requirements-dev.txt @@ -1,2 +1,2 @@ mock~=5.1.0 -pytest~=7.4.0 +pytest~=8.1.1 diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/requirements.txt b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/requirements.txt index b7bd6f8f7..3afe43d35 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/requirements.txt +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/requirements.txt @@ -1,12 +1,12 @@ # Install libs here that you might want in AWS CodeBuild -aws-cdk-lib~=2.119.0 +aws-cdk-lib~=2.136.0 constructs>=10.0.0,<11.0.0 -aws-sam-cli==1.107.0 -boto3==1.34.17 -botocore==1.34.17 +aws-sam-cli==1.114.0 +boto3==1.34.80 +botocore==1.34.80 pyyaml~=6.0.1 schema~=0.7.5 tenacity==8.2.3 -typing-extensions~=4.9.0 +typing-extensions~=4.11.0 urllib3~=1.26.18 ; python_version < "3.10" -urllib3~=2.0.7 ; python_version >= "3.10" +urllib3~=2.2.1 ; python_version >= "3.10" diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/requirements-dev.txt b/src/lambda_codebase/initial_commit/bootstrap_repository/requirements-dev.txt index 0f2a5c5af..1dc5e24d3 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/requirements-dev.txt +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/requirements-dev.txt @@ -1 +1 @@ -tox==4.11.4 +tox==4.14.2 diff --git a/src/lambda_codebase/initial_commit/requirements.txt b/src/lambda_codebase/initial_commit/requirements.txt index 6cd53216a..aa81fab49 100644 --- a/src/lambda_codebase/initial_commit/requirements.txt +++ b/src/lambda_codebase/initial_commit/requirements.txt @@ -1,4 +1,4 @@ Jinja2==3.1.3 -boto3==1.34.17 +boto3==1.34.80 cfn-custom-resource~=1.0.1 -markupsafe==2.1.3 +markupsafe==2.1.5 From 8ad242d9724bf34721d9aa068018f3f761e0e095 Mon Sep 17 00:00:00 2001 From: Simon Kok Date: Tue, 9 Apr 2024 12:47:25 +0200 Subject: [PATCH 6/8] AWS CodeStar Connections name change to CodeConnections (#714) **Why?** The AWS CodeStar Connection service [changed its name to AWS CodeConnections](https://docs.aws.amazon.com/dtconsole/latest/userguide/rename.html). These changes will need to be made sooner or later. Since they would introduce breaking changes, this PR adds the name change so we can push it as part of the v4.0.0 release. **What?** * Renamed AWS CodeStar Connections to AWS CodeConnections. * Removed the GitHub source provider, as this was superseded by CodeStar Connections back in the day. With the upcoming major release, it would be a good time to sunset that legacy provider. * Added a CHANGELOG.md file, to track the breaking changes we introduce. I added all releases since v3.0.0, so the changes and release notes are readable in forks of ADF as well. * Removed SecretsManager permissions to AWS CodeBuild as these are not in use. * Fix [Markdown Linter config](https://github.com/DavidAnson/markdownlint/blob/b2305efafb034b1f328845aec9928b5363ffd646/lib/configuration.d.ts) so repeated headings are allowed if they are in different sections. --- .markdownlint.json | 10 +- CHANGELOG.md | 786 ++++++++++++++++++ docs/admin-guide.md | 165 ++-- docs/providers-guide.md | 113 +-- docs/samples-guide.md | 2 +- docs/user-guide.md | 31 +- linters/custom-adf-dict.txt | 14 + .../deployment/example-global-iam.yml | 75 +- .../adf-bootstrap/deployment/global.yml | 23 +- .../example-deployment_map.yml | 11 +- .../generate_pipeline_inputs.py | 16 +- .../deployment/pipeline_management.yml | 16 +- ...adf_codestar.py => adf_codeconnections.py} | 6 +- .../cdk/cdk_constructs/adf_codepipeline.py | 49 +- .../cdk/cdk_stacks/adf_default_pipeline.py | 20 +- .../shared/python/schema_validation.py | 31 +- .../tests/stubs/stub_deployment_map.yml | 11 +- .../python/tests/test_deployment_map.py | 6 +- .../python/tests/test_schema_validation.py | 43 +- 19 files changed, 1100 insertions(+), 328 deletions(-) create mode 100644 CHANGELOG.md rename src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/{adf_codestar.py => adf_codeconnections.py} (87%) diff --git a/.markdownlint.json b/.markdownlint.json index b8f0977bd..51f582372 100644 --- a/.markdownlint.json +++ b/.markdownlint.json @@ -2,11 +2,11 @@ "emphasis-style": { "style": "consistent" }, - "no-duplicate-header": { - "allow_different_nesting": true + "no-duplicate-heading": { + "siblings_only": true }, "heading-style": { - "style": "consistent" + "style": "atx" }, "ul-style": { "style": "dash" @@ -28,7 +28,9 @@ "ol-prefix": { "style": "one_or_ordered" }, - "no-inline-html": true, + "no-inline-html": { + "allowed_elements": [] + }, "no-emphasis-as-heading": { "punctuation": ".,;:!。,;:" }, diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..76bab46d2 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,786 @@ +# Changelog + +ADF releases follow the [Semantic Versioning +specification](https://semver.org/spec/v2.0.0.html). + +## Unreleased + +### Breaking changes + +#### New installer + +The dependencies that are bundled by the move to the AWS Cloud Development Kit +(CDK) v2 increased the deployment size of ADF. +Unfortunately it increased the deployment size beyond the limit that is +supported by the Serverless Application Repository (SAR). + +Hence a new installation mechanism is required. + +Please read the [installation +instructions](https://github.com/awslabs/aws-deployment-framework/blob/master/docs/installation-guide.md) +carefully. + +In case you are upgrading an existing installation of ADF, please consider +following the [upgrade steps as defined in the admin +guide](https://github.com/awslabs/aws-deployment-framework/blob/master/docs/admin-guide.md#updating-between-versions). + +#### CDK v2 + +ADF v4.0 is built on the AWS Cloud Development Kit (CDK) v2. Which is an +upgrade to CDK v1 that ADF relied on before. + +For most end-users, this change would not have an impact. +If, however, you made customizations to ADF it might require you to upgrade +these customizations to CDK v2 as well. + +#### CodeBuild default image + +As written in the [CodeBuild provider +docs](./docs/providers-guide.md#properties-3), it is a best-practice to define +the exact CodeBuild container image you would like to use for each pipeline. + +However, in case you rely on the default, in prior ADF releases it would +default to `UBUNTU_14_04_PYTHON_3_7_1`. This container image is no longer +supported. With ADF v4.0, the new default is `STANDARD_7_0`. +Also referred to as: `aws/codebuild/standard:7.0`. + +#### ADF Parameters in AWS Systems Manager Parameter Store + +Some of the parameters stored by ADF in AWS Systems Manager Parameter Store +were located at the root of the Parameter Store. This made it hard to maintain +and restrict access to the limited set of ADF specific parameters. + +With ADF v4.0, the parameters used by ADF are located under the `/adf/` prefix. +For example, `/adf/deployment_account_id`. + +If an application or customization to ADF relies on one of these parameters +they will need to be updated to include this prefix. Unless the application +code relies on ADF's ParameterStore class, in that case it will automatically +prefix the `/adf/` to all parameters read or written. + +With the changes in the IAM policies, ADF's access is restricted to the `/adf/` +prefix. This, unfortunately implies that old parameters are not deleted when +you update your installation of ADF. There is no cost associated to these +parameters, so you can leave them as is. +Feel free to delete the old parameters. + +The parameters that are managed by ADF that got their path changed are: + +For the __management account__, in the __AWS Organizations region__ +(`us-east-1`, or `us-gov-west-1`): + +| Old Parameter Path | New Parameter Path | +|------------------------------|-------------------------------------| +| `/adf_log_level` | `/adf/adf_log_level` | +| `/adf_version` | `/adf/adf_version` | +| `/bucket_name` | `/adf/bucket_name` | +| `/confit` | `/adf/config` | +| `/cross_account_access_role` | `/adf/cross_account_access_role` | +| `/deployment_account_id` | `/adf/deployment_account_id` | +| `/deployment_account_region` | `/adf/deployment_account_region` | +| `/kms_arn` | `/adf/kms_arn` | +| `/notification_channel` | `/adf/notification_channel` | +| `/organization_id` | `/adf/organization_id` | +| `/protected` | `/adf/protected` | +| `/scp` | `/adf/scp` | +| `/shared_modules_bucket` | `/adf/shared_modules_bucket` | +| `/tagging-policy` | `/adf/tagging_policy` | +| `/target_regions` | `/adf/target_regions` | + +For the __management account__, in __other ADF regions__: + +| Old Parameter Path | New Parameter Path | +|------------------------------|-------------------------------------| +| `/adf_version` | `/adf/adf_version` | +| `/bucket_name` | `/adf/bucket_name` | +| `/cross_account_access_role` | `/adf/cross_account_access_role` | +| `/deployment_account_id` | `/adf/deployment_account_id` | +| `/kms_arn` | `/adf/kms_arn` | + +For the __deployment account__, in __the deployment region__: + +| Old Parameter Path | New Parameter Path | +|------------------------------|-------------------------------------| +| `/adf_log_level` | `/adf/adf_log_level` | +| `/adf_version` | `/adf/adf_version` | +| `/auto_create_repositories` | `/adf/scm/auto_create_repositories` | +| `/cross_account_access_role` | `/adf/cross_account_access_role` | +| `/default_scm_branch` | `/adf/scm//default_scm_branch` | +| `/deployment_account_bucket` | `/adf/deployment_account_bucket` | +| `/master_account_id` | `/adf/management_account_id` | +| `/notification_endpoint` | `/adf/notification_endpoint` | +| `/notification_type` | `/adf/notification_type` | +| `/organization_id` | `/adf/organization_id` | + +For the __deployment account__, in __other ADF regions__: + +| Old Parameter Path | New Parameter Path | +|------------------------------|-------------------------------------| +| `/adf_log_level` | `/adf/adf_log_level` | +| `/adf_version` | `/adf/adf_version` | +| `/cross_account_access_role` | `/adf/cross_account_access_role` | +| `/deployment_account_bucket` | `/adf/deployment_account_bucket` | +| `/master_account_id` | `/adf/management_account_id` | +| `/notification_endpoint` | `/adf/notification_endpoint` | +| `/notification_type` | `/adf/notification_type` | +| `/organization_id` | `/adf/organization_id` | + +For a __target account__, in __each ADF region__: + +| Old Parameter Path | New Parameter Path | +|------------------------------|-------------------------------------| +| `/bucket_name` | `/adf/bucket_name` | +| `/deployment_account_id` | `/adf/deployment_account_id` | +| `/kms_arn` | `/adf/kms_arn` | + +#### AWS CodeStar Connections OAuth Token support dropped + +ADF v4.0 discontinued the support for the OAuth Token stored in +SSM Parameter Store. As this method is not advised to be used by CodePipeline, +and might leave the OAuth Token accessible to other users of the deployment +account. As this is not a security best practice, ADF v4.0 no longer supports +it. + +To upgrade, please read the [Administrator Guide on Using AWS CodeConnections +for Bitbucket, GitHub, or +GitLab](./docs/admin-guide.md#using-aws-codeconnections-for-bitbucket-github-github-enterprise-or-gitlab). + +#### AWS CodeStar Connections changed to AWS CodeConnections + +The AWS CodeStar Connection service [changed its name to AWS +CodeConnections](https://docs.aws.amazon.com/dtconsole/latest/userguide/rename.html). + +If you configured a CodeStar Connection before, you can continue to use that. +You do not need to update the CodeStar policy as defined in the +`aws-deployment-framework-bootstrap/adf-bootstrap/deployment/global-iam.yml` +stack. + +However, please update the pipeline definitions in your deployment map files. +The changes you need to make are renaming the source +provider from `codestar` to `codeconnections`. +Also update the `codestar_connection_path` source property to +`codeconnections_param_path`. + +Both of these changes can be seen in the following example: + +```yaml +pipelines: + - name: sample-vpc + default_providers: + source: + # provider: codestar + provider: codeconnections + properties: + # codestar_connection_path: /adf/my_connection_arn_param + codeconnections_param_path: /adf/my_connection_arn_param +``` + +If you are upgrading from the GitHub OAuth token or otherwise require a new +source code connection, please proceed with the AWS CodeConnections +configuration as defined in the +[Admin Guide - Using AWS CodeConnections for Bitbucket, GitHub, or +GitLab](./docs/admin-guide.md#using-aws-codeconnections-for-bitbucket-github-or-gitlab). + +--- + +## v3.2.0 + +__Please note__: this update refactored the account creation and pipeline +generation to use Step Functions. Thereby, the process to track how the update +progresses and how you could validate its operation changed. +Please read [the docs on updating +ADF](https://github.com/awslabs/aws-deployment-framework/blob/3ae94baf6908a6f25177ea21cd2f2e0d3a5b808b/docs/admin-guide.md). + +We are thankful to the community that helped enhance ADF. +With this release, we decided to list the contributions per author (listed in +alphabetical order) within each section. Highlighting the great contributions +and enhancements that were made by them. + +### Features + +apogorielov: + +- Add ability to override the default branch for all source code providers #370. + +benbridts: + +- Allow top-level keys starting with `x-` or `x_` in deployment maps to add + support for YAML anchors #347. + +dsudduth: + +- Fix AWS partition reference, adding support for AWS Gov Cloud #381, + closes #332. + +ivan-aws: + +- Add ability to use CodeStar sources in deployment map #312. +- Add support to configure object ACL with S3 put object calls #412. + +pozeus: + +- Add support for CodeBuild to pull from docker hub #349, requested in #196. + +srabidoux: + +- Add support for account-specific SCP deployments #395. + +stemons: + +- Add support for Terraform deployments #397, closes #259, implements #114. + +StewartW: + +- Add ChatBot support for notifications, lifting the limit on pipelines that + notify through Slack #367, closes 257, closes 297. +- Add support for pipeline triggers #392, closes #372. +- Add ability to define CodeCommit artifact format #389, closes #387. +- Add deployment waves for targets, removing the manual effort to spread 50 + accounts per stage #358, closes #290, implements #128, closes #296, + closes #250, closes #427. +- Add support to exclude specific account ids from a target group #358, + closes #145. + +sbkok: + +- Add ability to disable trigger on changes for S3/CC/GH source providers #357: + - Allows starting the pipeline only upon a `completion_trigger` event, + closes #308. + - Allows you to disable reacting to the Github webhook, closes #337. +- Add support to change the default branch on ADF bootstrap and pipelines + repositories #508. +- Add support for CodeBuild to run inside a VPC #517. +- Refactor `generate_params.py` helper, adding support for per parameter/tag + resolution from specific to least specific params file #559, closes #452, + closes #294. +- Add support for CodeStar CodeBuild clone ref, allowing to work on git commits + in CodeBuild in pipelines #563. +- Allow CloudFormation parameter file name configuration per target #565. + +### Fixes + +benbridts: + +- Remove unacceptable characters from CloudFormation Stack names #346. + +dependabot: + +- Bump ejs from 2.6.1 to 3.1.7 in Fargate node sample application #480. +- Bump express from 4.16.4 to 4.17.3 in Fargate node sample application #555. + +javydekoning: + +- Fix resource reference in Step Function state machine policy #461, + closes #460. +- Fix string should be array reference in Event Bridge Rule #456, closes #455. +- Bump Jinja2 and Boto3 versions to 3.1.1 and 1.21.31 respectively #457, + closes #454. +- Ensure account alias is configured or fail #465, closes #242. +- Fix account file processing and add debug logging #459, closes #458. + +mhdaehnert: + +- Separate artifact storage bucket for CodePipeline and CodeBuild to improve + parallel execution #271, closes #270. + +Nr18: + +- Fix S3 object ownership controls #448, closes #447. +- Fix param overrides functionality to support using the same source #446, + closes #445. + +rickardl: + +- Support paginator for parameters and empty descriptions in moved to root + lambda #273, fixes #272. + +tylergohl: + +- Add retry for InvalidTemplateError and GenericAccountConfigureError #384, + closes #383. + +StewartW: + +- Fix deployment account Step Function time outs #401, closes #400. +- Fix incorrect step name in step function #406. +- Update get account region function to use opted-in regions to #423, + closes #420. +- Reduce adf-codepipeline-role policy size when ADF deploys to many regions + #475, closes #474. + +sbkok: + +- Add missing requirements file for shared python helpers, fixes use of + `retrieve_organization_accounts.py` helper #352. +- Fix duplicate notification endpoint setup in pipeline generation #362. +- Fix specifying the tag on CodeBuild repository image to use #377, + closes #374. +- Fix permission to set Support Subscription upon account creation #402, + closes #379. +- Fix duplicated steps in Account Bootstrap Step Function #414. +- Fix global-iam example comment explaining where it is deployed #421. +- Fix use of correct region for AWS Organizations API depending on the + partition it runs in #485. +- Fix correct use of build/deploy parameters for CodeBuild provider #489, + closes #488. +- Fix account processing to be part of our SAR distribution #487. +- Fix Makefile use of find command on macOS #497, closes #473. +- Fix update process to only flag helpers as executable #499. +- Fix correct use of partitions #502. +- Fix use of NodeJS 14 with Standard 5.0 CodeBuild containers #500, + closes #385. +- Fix MarkupSafe to v2.0.1 as v2.1 breaks compatibility with Jinja2<3.0.0 #498, + closes #467, closes #441. +- Fix use of separate container image per target #501, closes #382. +- Fix wrapt version dependency #504. +- Fix syncing deployment map files to S3 when needed #506. +- Fix missing permission on cross-account org read-only role #509. +- Fix permission to update termination protection on pipeline stacks #511. +- Fix ADF state machines #514, closes #513. +- Fix updating account alias when needed #515. +- Fix tenacity version dependency #520. +- Fix Step Function input file syncing to upload only when content changed + #530, part of #518. +- Fix pipeline generation policies #533. +- Fix repository creation permission in pipeline management #536. +- Fix stale pipeline deletion #535. +- Fix account creation wait for bootstrap to complete #537, closes #518. +- Fix initial commit implementation #534. +- Fix account bootstrap on organization unit move #539. +- Fix IAM Tag permissions #545. +- Fix initial commit on new/fresh install #544. +- Fix ADF Config storage, needs to be stored before used the first time #548. +- Fix pipeline regeneration upon account move #550, closes #549. +- Fix syncing to S3 in the root of the bucket #558. +- Fix CodePipeline source account id lookup to support missing account id for + providers like CodeStar #561. +- Fix CreateRolePolicy permissions on global.yml bootstrap stacks #564. +- Fix clean-up of stale deployment map files in the pipeline bucket #562. +- Fix CodePipeline references to a specific config per stage over a default + provider config #565. +- Fix executable flags of helper scripts #573. +- Fix CloudFormation permissions to update the pipeline notification SNS topic + subscriptions #572. +- Fix permissions to enable CodeBuild as a deployment provider #571. +- Fix typos in pipeline management logical id #567. +- Fix generate_params.py pipeline regions lookup #584. +- Fix bootstrapping in non-protected OUs only #590. + +### Improvements + +benbridts: + +- Clean up of protected organization unit error message #353. +- Improvements to the Serverless Application Repository template #343, + closes #342. + +javydekoning: + +- Add CloudFormation linting using cfn-lint #466, closes #464. +- Replace Travis with GitHub Actions #481. +- Add YAML linting using yamllint #470, closes #463. +- Fix yamllint findings #482. +- Upgrade to CDK v1.168, pylint v2.13 and others #486. +- Add MegaLint to organize execution of all linters configured #492, part of + #491. +- Fix linting issues in RDK sample #495. +- Fix editor config linting #516, part of #491. +- Improve docs, add markdown linting, and change master account to management + account in docs #521, part of #491. +- Improve code and docs by adding CSpell checks to enforce correct spelling + #574. +- Improve CSpell linter output #578. + +Nr18: + +- Encrypt SNS topic using ADF's CMK KMS Key #429, closes #422. +- Define CodeCommit description in deployment maps #469, closes #468. + +ntwobike: + +- Add RDK sample to deploy custom Config rules #451. + +skycolangelom: + +- Fix retry logic for DescribeRegions while creating new accounts #238, + rebased and improved in #348. +- Fix deleting default VPC when it is non-empty #238, rebased + improved in + #348. + +StewartW: + +- Add pipeline type parameters to enable support for other pipelines in the + future #285, closes #185. +- Add Bootstrap Repository Pipeline high-level overview documentation from a + tech perspective #393, closes #211. +- Refactor Account management to use a Step Function #394. +- Reduce number of IAM API calls during cross-account access setup process + #408. +- Refactor Pipeline management to use a Step Function, added tech diagrams + #424, closes #211. +- Add in role paths for new account management roles #523. +- Fix MegaLint style error #531. +- Add deployment map source to SSM Params to identify out-of-date pipelines + #525. +- Add retry logic on pipeline generation RunCDK stage when CodeBuild is + throttled #580. + +sbkok: + +- Upgrade urlize from v2.11.2 to v2.11.3 #341. +- Lock down buckets created by ADF, block public access #350. +- Improve ADF version references in the main template #351. +- Upgrade dependencies (CDK to v1.105, Pylint to v2.8.2, SAM CLI to v1.23.0, + and others) #364. +- Upgrade dependencies (CDK to v1.114, Pylint to v2.9.3, SAM CLI to v1.26.0, + and others) #376, closes #388. +- Improved error message with accounts yaml read failures #403, closes #213. +- Enable setting the log level when deploying from the SAR + adding a + troubleshoot ADF guide #409. +- Update docs to state the default branch used as the source #418. +- Change example email domains and account ids #416. +- Update to CDK v1.137, pylint v2.12, and others to latest available #417. +- Upgrade to Python 3.9 #415. +- Add editorconfig to repository #483. +- Refactor line lengths and code style #490. +- Update CDK, use of NodeJS 16 where possible, and CodeBuild Standard 5.0 + images #496, closes #291. +- Only invoke pipeline deletion when needed #510. +- Add reference to Step Function Pipeline Management state machine from + pipelines CodeBuild execution #512. +- Add retry logic to Step Function Lambda invocations and improved log messages + #513, closes #371. +- Make consistent use of Id in pipeline management implementation #532. +- Add account creation in-progress retry logic, fixes + SubscriptionRequiredException #540, closes #519, fixes #366. +- Add retries to account bootstrap process #543, closes #366. +- Update to CDK v1.181.1 and others #553. +- Improve readability of pipeline generation executions in the newly introduced + pipeline generation state machine #557. +- Improve parameter validation on install/update of ADF, improving + install/update experience #554. +- Update to CDK v1.182.0 #560. +- Improve adf-pipelines CodeBuild permissions to start state machines + and optimized CodeBuild machine type #569. +- Add CodeBuild VPC permissions to default permissions to easy provisioning + pipelines inside VPCs #570. +- Improve policy names in adf-bootstrap example global-iam.yml files to be + unique #568. +- Improve code readability of CodeBuild class through refactoring #566. +- Update ADF update process and troubleshooting documentation #576. +- Improve CloudFormation error reporting in the + aws-deployment-framework-bootstrap pipeline #582. +- Reduce number of cross-account access IAM API calls #581. +- Add exponential back-off retries on Enable Cross-Account Access state + machine #581. +- Refactor and tighten roles used by Enable Cross-Account Access state + machine #581. +- Do not retry pipeline generation if an account is not found or the deployment + map is invalid #583. +- Refactor pipeline management pipeline input generation and execution #584. + +Many thanks to our community for driving this release. And special thanks to +apogorielov, benbridts, dsudduth, ivan-aws, javydekoning, mhdaehnert, Nr18, +ntwobike, pozeus, rickardl, skycolangelom, srabidoux, stemons, StewartW, +and tylergohl for contributing new features and improvements to ADF! + +--- + +## v3.1.2 + +### Fixes + +- Fix use of the `resolve:` intrinsic function on the first parameter + in the parameter files, #336. + +--- + +## v3.1.1 + +### Fixes + +- Fixes `timeout` and `environment_variables` to be used when defined in the + default CodeBuild Deployment provider properties #307, closes #306. +- Fixes intrinsic functions for account_region param files #333, closes #147. +- Fixes use of deployment from source directly when build stage is disabled + #334, closes #236 and closes #318. + +--- + +## v3.1.0 + +### Features + +- Adds Enterprise Support to account creation process #233, closes #232: + - ADF will raise a ticket to add the account to an existing AWS support + subscription when an account is created. As a prerequisite, your + organization management account must already have enterprise support + activated. +- Adds nested deployment map support #266 and #328, closes #265: + - This enables usage of sub directories within the deployment_maps folder. + +### Fixes + +- Fixes specific role usage to be used in Build and Deploy only #295. +- Corrects removing pipelines anchor in docs #279. +- Fixes CI builds due to isort version mismatch #284. +- Fixes error handling of generate_params intrinsic upload function #277, + closes #276. +- Fixes spec_inline attribute of CodeBuild in docs #289. +- Fixes provider spec_inline support of CodeBuild in #293. +- Fixes supported list of intrinsic upload path styles, enables usage of s3-url + and s3-key-only #275, closes #299. +- Fixes create deployment account concurrency failure #287, closes #280. +- Fixes approval stage usage, by limiting specific role usage to Build and + Deploy steps #295. +- Fixes yarnpkg GPG #313, closes #325. +- Removes dependency on botocore.vendored.requests #326, closes #324. + +### Improvements + +- Improves docs on providers and their properties #274. +- Separates pipeline cleanup from input generation script #288. +- Upgrades Python from v3.7 to v3.8 #313. +- Upgrades CodeBuild image from "aws/codebuild/standard:2.0" to + "aws/codebuild/standard:5.0" #313, closes #267, closes #300. +- Upgrades CDK from v1.32 to v1.88 #313, closes #292. + +Many thanks to our community for driving this release. And special thanks to +@StewartW for contributing new features to ADF! + +--- + +## v3.0.6 + +### Fixes + +- Account Alias’ are no longer automatically created as the accounts full name. +- Adding in additional wait time for account creation process (Temporary Fix) + +### Improvements + +- CDK Version 1.25 -> 1.32 +- Adding ability to tag pipelines (example included in docs) +- Adding in CloudFormation:* in global-iam-example.yml for target accounts. + +--- + +## v3.0.5 + +### Fixes + +- Fix CodeBuild use specific image in target stage #253. +- Fix import references of export to output key #248. +- Fix CodeBuild assume role to generate parameters #247. + +### Improvements + +- Adds s3-key-only style #249. + +--- + +## v3.0.4 + +### Fixes + +- Fix CloudFormation deployment role generation. +- Fix overwrite of deployment/global-iam.yml #227. +- Fix IAM for retrieve organization accounts helper #229. +- Fix IAM for package transform helper to function #228. +- Version lock missing CDK dependencies #225. + +### Improvements + +- Add S3-URI and S3-URL as upload path styles #224. +- Allow adf-automation-role policy to grant + cloudformation:UpdateTerminationProtection #222. + +--- + +## v3.0.3 + +### Fixes + +- Fix CodeCommit usage in pipelines. +- Fix CodeBuild usage in pipelines with correct default values. + +--- + +## v3.0.2 [YANKED] + +This release was yanked, as deploying it caused various issues with the default +CodeBuild and CodeCommit pipeline resources. These issues are fixed in v3.0.3. + +--- + +## v3.0.1 + +### Fixes + +- Fixed SCP and Tagging Policy files to use relative paths #212. + +--- + +## v3.0.0 + +This release is specifically focused two main topics: *Security* and +*Account provisioning*. + +### Security + +In this release we are limiting default IAM policies to ensure pipeline phases +such as custom deployments or build phases cannot be used to elevate ones own +permissions. To ensure strict separation of concerns and enforce high standards +around IAM we have created two new IAM Role that lives on each AWS Account +within the organization. These role are created in the global.yml +*(base stack)* of each account and are used for the following purposes: + +**adf-automation-role:** + +> When creating pipelines in ADF there are certain things that are required to +> be setup on multiple different accounts. For example, the source account +> requires a repository on it, and also a CloudWatch event. Previously the +> CodeBuild role would assume the adf-cloudformation-deployment-role in the +> target account and create the required CloudFormation stack. This pattern +> allowed the adf-codebuild-role to much power and thus we have removed this +> link. + +This new role (`adf-automation-role`) is assumed by CodeBuild in the +`aws-deployment-framework-pipelines` pipeline exclusively and cannot be +assumed by the standard *(other)* deployment pipelines. + +**adf-readonly-automation-role:** + +> When CodeBuild runs as part of a standard deployment pipeline +> *(anything other than `aws-deployment-framework-pipelines`)* it uses the +> role: `adf-codebuild-role` by default. +> The `adf-codebuild-role` has access to assume this new role +> (`adf-readonly-automation-role`) on each account within the organization. +> It assumes this role when running certain intrinsic functions +> such as import or resolve which allow values to be retrieved from other +> AWS Accounts within the organization. Previously, CodeBuild would assume the +> adf-cloudformation-deployment-role to retrieve these values which can have +> many actions allowed making it inappropriate to assume. + +This change effectively lowers the amount of permissions the default +`adf-codebuild-role` has. Prior to this release, using CodeBuild as a deployment +stage would also default to the `adf-codebuild-role` which would allow the +deployment stage more accesses than intended. From this release onward, +CodeBuild stages will default to the `adf-codebuild-role`. However, since this +role has very limited access, it will most likely require the user to define a +custom role in order to assume and deploy resources into other accounts. + +For example, if you wanted to deploy some resources with Terraform, or run +"cdk deploy" you would need to provide an IAM role that has been created which +has the required permissions to do so. For more information on how to create +such as role, see the commented out `adf-custom-deploy-role` in the +`example-global-iam.yml`. + +### Account Provisioning + +Until this release ADF has not had a streamlined automated way to create and +move AWS accounts into organizational units. With 3.0.0 we are introducing an +account provisioner concept that handles the creation and OU location of AWS +Accounts in a declarative format. As part of the bootstrap repository we have +created a new root folder titled adf-accounts, this folder contains definition +files *(yaml)* that describe AWS accounts along with an assortment of +properties. The bootstrap pipeline automation component (in CodeBuild) will +parse the files and create or move the accounts into their defined state. +This allows for end to end creation, bootstrapping and pipeline generation of +an AWS account *(all from code!)*. For more information on this process and a +breakdown of the file properties and syntax itself see the admin guide +*(also see `readme.md` in the `adf-accounts` folder)*. + +### Inter OU Moving of AWS Accounts + +Moving accounts between two OU's will now trigger the previous base stack to be +removed and the new base stack aligned with that Organizational Unit to be +applied. + +### Tagging Policies + +With this release, ADF enables streamlined automation and management of Tagging +Policies via AWS Organizations. Tagging Policies can now be applied to OU's in +the same manner as Service Control Policies could be in prior versions. +Using a tagging-policy.json file in a specific folder of the bootstrap +repository that matches to your organization structure enables the tagging +policy for the specific OU. Read more about how tagging policies work +[here](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_tag-policies.html) +and see the example-tagging-policy.json in the bootstrap repo for a simple +reference. + +### Separation of adf-cloudformation-deployment-role IAM Policy + +Moving forward we have decided to move the adf-cloudformation-deployment-role +policy out of the global.yml and into a new file called `global-iam.yml`, +this change hopes to simplify and create a separation between the global.yml +which contains resources related to ADF in general as opposed to the new file +(global-iam.yml) which relates to what can and cannot be deployed into the +account that applies that specific base stack. The new global-iam.yml file is +searched for recursively in the same fashion other global.yml or regional.yml +files. + +### Other changes + +- Resolved #196 - Support for custom CodeBuild images *(You can now use custom + build images in your build or deploy actions with CodeBuild. See user-guide + for more information and examples.)* +- Resolved #198 - Parameter Store is no longer used for the state of the + pipeline definition, this has been moved to S3. +- Resolved #191 - Simple check to determine region is correct when deploying + from SAR. +- Resolved #189 - Enable flag for build stage bug fixed, now works as intended. +- Resolved #180 - error handling has been fixed to correct this. +- Resolved #178 - ADF Account provisioning is here! +- Resolved #177 - Upgrades will not touch the global-iam.yml file which holds + the cloudformation-deployment-role-policy. +- Resolved #188 - Removed hard-coded branch name from source account CloudWatch + event. +- Resolved #148 - Base stack *(iam and bootstrap)* are removed and re-added + based on inter OU account moves. +- cdk version bumped to 1.2.0 +- removed hard coding of master branch on PR event action on source accounts. + +### Upgrading from 2.x to 3.x + +With the change to 3.0 we have decided to move the bootstrap content +(`templates/scps`) in the bootstrap repository into its own folder +(`adf-bootstrap`). Since the bootstrap folder path is changing from the root of +the repository into the `adf-bootstrap` folder, you will need to move your +existing folder structure (`.yml/scp` files) into the new format. When +deploying ADF 3.x from the SAR a Pull Request will get made against the +bootstrap repository as per normal upgrade process. The 3.0 PR will move the +ADF specific content including the deployment folder into the new structure, +if you have significantly altered the `global/regional.yml` for the deployment +account be sure to adjust this as intended prior to merging it to the main +branch. + +If you require to make alterations to the structure of the folders/templates +simply pull the 3.0 branch down and add in your existing folder/OU structure +as desired with the `adf-bootstrap` folder as the new root and push back into +the branch. + +With the 3.0 change there is also an `example-global-iam.yml` file that is +included in the root of the `adf-bootstrap` folder. This file should be renamed +to `global-iam.yml` and distributed into the folders/OUs that you intend to +have CloudFormation deploy resources into. This is required in order to define +what actions the role on the target accounts will have access to when deploying +CloudFormation resources via CodePipeline. + +Steps to perform for the upgrade process: + +- Deploy ADF. +- Once deployed, navigate to CodeCommit, pull down the branch for 3.0. + In your editor, update your folder organizational structure *(if you have + one)* into the `adf-bootstrap` folder. *(this folder is the new "root" for + bootstrapping)*. Ensure you are getting the new content from the deployment + folder. +- Ensure you are bringing in the new content from the global.yml file in 3.0 + release, the two roles and their associated policies (`adf-automation-role`, + `adf-readonly-automation-role`). +- Rename the `example-global-iam.yml` to `global-iam.yml` and ensure its policy + suits your needs and that it is in the correct folder structure that suits + your organization security requirements. *(this file now holds the policy for + what CFN can do on target accounts)* +- Push the updated content back to the branch and merge if all looks to be + correct. diff --git a/docs/admin-guide.md b/docs/admin-guide.md index be88a8f58..5cb9acfa0 100644 --- a/docs/admin-guide.md +++ b/docs/admin-guide.md @@ -20,9 +20,9 @@ - [Bootstrapping Recommendations](#bootstrapping-recommendations) - [Pipelines](#pipelines) - [Pipeline Parameters](#pipeline-parameters) - - [Using CodeStar Connections for Bitbucket, GitHub, or GitHub - Enterprise](#using-codestar-connections-for-bitbucket-github-or-github-enterprise) - - [Using GitHub with an OAuth token](#using-github-with-an-oauth-token) + - [Using AWS CodeConnections for Bitbucket, GitHub, or + GitLab](#using-aws-codeconnections-for-bitbucket-github-or-gitlab) + - [AWS CodeStar Connection](#aws-codestar-connection) - [Chaining Pipelines](#chaining-pipelines) - [Service Control Policies](#service-control-policies) - [Tagging Policies](#tagging-policies) @@ -282,7 +282,8 @@ SCPs or CloudFormation templates that ADF will apply. The Deployment Account is the gatekeeper for all deployments throughout an Organization. Once the baselines have been applied to your accounts via the bootstrapping process, the Deployment account connects the dots by taking -source code and resources from a repository _(e.g. GitHub, CodeCommit or S3)_ +source code and resources from a repository _(e.g. CodeCommit, S3, or external +via AWS CodeConnections or an AWS CodeStar Connection)_ and into the numerous target accounts and regions as defined in the deployment map files via AWS CodePipeline. @@ -557,15 +558,15 @@ pipelines: Here is an example of passing in a parameter to a pipeline to override the default branch that is used to trigger the pipeline from, this time using -a CodeStar Connection to Bitbucket, GitHub, or GitHub Enterprise as a source -_(No need for `source_account_id`)_. +an AWS CodeConnections link to Bitbucket, GitHub, or GitLab as a +source _(No need for `source_account_id`)_. ```yaml pipelines: - name: vpc # The GitHub repo would have this name default_providers: source: - provider: codestar + provider: codeconnections properties: branch: dev/feature # Optional, name property will be used if repository is not specified @@ -580,7 +581,7 @@ pipelines: # It is recommended to add a Tag like CreatedBy with the user that # created it. So it is clear this parameter is not managed by ADF # itself. - codestar_connection_path: /adf/my_codestar_connection_param + code_connection_path: /adf/my_aws_codeconnections_param targets: - /security # Shorthand example ``` @@ -629,50 +630,63 @@ globally unique we need some way to define which bucket we want to deploy our `output.zip` into at a stage level. The way we accomplish this is we can pass in `properties` in the form of `key/value` into the stage itself. -#### Using CodeStar Connections for Bitbucket, GitHub, or GitHub Enterprise +#### Using AWS CodeConnections for Bitbucket, GitHub, or GitLab -**Please note:** This is the preferred method to setup GitHub as your source -provider. +**Please note:** This is the preferred method to setup external sources. +If you have configured an AWS CodeStar Connection before and wonder how-to +set it up again, please read the [AWS CodeStar Connection +steps](#aws-codestar-connection). -**Prerequisite:** To enable CodeStar Connections to be used the following step -is required: +**Prerequisite:** To enable AWS CodeConnections to be used the following steps +are required: -- Rename file `example-global-iam.yml` to `global-iam.yml` in the following - path `aws-deployment-framework-bootstrap/adf-bootstrap/deployment/` and - ensure the CloudFormation resources `CodeStarConnectionPolicy` is no longer - commented out. - **Please note:** the use of `deployment` at the end) +- Navigate to the `aws-deployment-framework-bootstrap` repository, specifically + the `/adf-bootstrap/deployment/` folder (notice the `deployment` OU folder at + the end). +- There should be a `global-iam.yml` file in that folder. If not, please rename + or copy the `example-global-iam.yml` file to `global-iam.yml` to proceed. +- Inside the `global-iam.yml` file ensure the CloudFormation resources + named `CodeConnectionsPolicy` is no longer commented out. -**Important note**: `CodeStarConnectionPolicy` IAM policy is a sample. +**Important note**: `CodeConnectionsPolicy` IAM policy is a sample. Please make sure you update this policy and scope it properly for the use cases you want to support. -In order for a pipeline to be connected to Bitbucket, GitHub, or GitHub -Enterprise you will need to setup an CodeStar Connection first. +In order for a pipeline to be connected to Bitbucket, GitHub, or GitLab +you will need to setup AWS CodeConnections first. Please follow the [steps as described in the AWS Developer Tools documentation](https://docs.aws.amazon.com/dtconsole/latest/userguide/connections.html) -on how-to setup a new Connection with your code repository. +on how-to setup a new connection with your code repository. Once the connection is created you can store the Connection ARN into the Deployment Account with AWS Systems Manager Parameter Store. +Before you proceed, please check the Connection ARN of the connection you +configured. Depending on the method and creation time of the connection it +might have created a CodeStar Connection instead. If it did, the ARN will +include the `codestar` keyword. If so, please proceed with the steps described +in the [AWS CodeStar Connection](#aws-codestar-connection) first before you +continue. + Please use the `/adf/` prefix for this parameter. For example: `/adf/my_source_connection_param` As ADF has read access to parameters that start with `/adf/`. -Once the values are stored, you can create the Repository in GitHub as per -normal. Once its created you no further steps are required on GitHub's side, -just update your [deployment map](user-guide.md#deployment-map) to use the new -source type and push to the deployment account. Here is an example of a -deployment map with a single pipeline from GitHub, in this case the repository -on GitHub must be named 'vpc'. +Once the values are stored, you can create the Repository in your external +source provider (Bitbucket, GitHub, or GitLab) as per normal. +Once the repository is ready, no further steps are required on the external +source provider's side, just update your +[deployment map](user-guide.md#deployment-map) to use the new source type and +push to the deployment account. Here is an example of a +deployment map with a single pipeline from an external source provider, in this +case the external repository must be named 'vpc'. ```yaml pipelines: - name: vpc default_providers: source: - provider: github + provider: codeconnections properties: # Optional, name property will be used if repository is not specified repository: example-vpc @@ -688,56 +702,57 @@ pipelines: # itself. # # Example content of the parameter, plain ARN as a simple string: - # arn:aws:codestar-connections:eu-west-1:111111111111:connection/11111111-2222-3333-4444-555555555555 - codestar_connection_path: /adf/my_github_connection_arn_param + # arn:aws:codeconnections:eu-west-1:111111111111:connection/11111111-2222-3333-4444-555555555555 + codeconnections_param_path: /adf/my_github_connection_arn_param targets: - /security ``` -#### Using GitHub With An OAuth Token - -**Important note:** Before you continue. It is important to understand that -this method is not advised to be used by CodePipeline. Instead, please follow -the instructions to setup a CodeStar connection to pull the code from GitHub. -Please read the [Using CodeStar Connections for Bitbucket, GitHub, or GitHub -Enterprise section](#using-codestar-connections-for-bitbucket-github-or-github-enterprise). - -In order for a pipeline to be connected to GitHub you will need to create a -Personal Access Token in GitHub that allows its connection to AWS CodePipeline. -You can read more about creating a Token -[here](https://docs.aws.amazon.com/codepipeline/latest/userguide/GitHub-rotate-personal-token-CLI.html). -Once the token has been created you can store that in AWS Secrets Manager on -the Deployment Account. The Webhook Secret is a value you define and store in -AWS Secrets Manager with a path of `/adf/my_teams_token`. By Default, ADF only -has read access to Secrets with a path that starts with `/adf/`. - -Once the values are stored, you can create the Repository in GitHub as per -normal. Once its created you do not need to do anything else on GitHub's side -just update your [deployment map](user-guide.md#deployment-map) to use the new -source type and push to the deployment account. Here is an example of a -deployment map with a single pipeline from GitHub, in this case the repository -on GitHub must be named 'vpc'. - -```yaml -pipelines: - - name: vpc - default_providers: - source: - provider: github - properties: - # Optional, name property will be used if repository is not specified - repository: example-vpc - owner: bundyfx - # The path in AWS Secrets Manager that holds the GitHub Oauth token, - # ADF only has access to /adf/ prefix in Secrets Manager - oauth_token_path: /adf/github_token - # The field (key) name of the json object stored in AWS Secrets - # Manager that holds the Oauth token. - # e.g. {"token": "123"} - json_field: token - targets: - - /security -``` +#### AWS CodeStar Connection + +**Please note:** Only proceed with the steps in this document if you have an +existing AWS CodeStar Connection you like to maintain. With the [announcement +of the AWS CodeStar Connection to AWS CodeConnections name +change](https://aws.amazon.com/about-aws/whats-new/2024/03/aws-codeconnections-formerly-codestar-connections/) +the preferred method to link GitHub, GitLab, Bitbucket, and other sources is +AWS CodeConnections. You do not need to replace the AWS CodeStar Connection +with an AWS CodeConnections resource if you have one already. According to the +service documentation it will continue to be supported via the new AWS +CodeConnections API without requiring further changes in ADF's config or the +deployment maps. + +If you are about to setup a new connection to an external source code provider, +please consider following the [AWS CodeConnections +steps](#using-aws-codeconnections-for-bitbucket-github-or-gitlab) +instead. + +**Prerequisite:** To enable an AWS CodeStar Connection to be used the following +steps are required: + +- Navigate to the `aws-deployment-framework-bootstrap` repository, specifically + the `/adf-bootstrap/deployment/` folder (notice the `deployment` OU folder at + the end). +- There should be a `global-iam.yml` file in that folder. If not, please rename + or copy the `example-global-iam.yml` file to `global-iam.yml` to proceed. +- Inside the `global-iam.yml` file ensure the CloudFormation resources + named `CodeConnectionsPolicy` is no longer commented out. +- Also make sure the CodeStar actions are no longer commented out. + +**Important note**: `CodeConnectionsPolicy` IAM policy is a sample. +Please make sure you update this policy and scope it properly for the use cases +you want to support. We recommend that you leave this policy name as +`CodeConnectionsPolicy`, even though you are setting up a +`CodeStar Connection`. This will make it easier to detect required updates if +these would-be introduced by future ADF versions. + +The remaining steps are the same as configuring an AWS CodeConnections +setup. So please follow the next steps as documented in the +[Using AWS CodeConnections for Bitbucket, GitHub, or GitLab +section](#using-aws-codeconnections-for-bitbucket-github-or-gitlab). + +**Please note: While the AWS CodeConnections source provider name is +`codeconnections`, if the configured connection ARN refers to an AWS CodeStar +Connection it will set that up instead. #### Chaining Pipelines diff --git a/docs/providers-guide.md b/docs/providers-guide.md index e7f45f0de..5f4fd6707 100644 --- a/docs/providers-guide.md +++ b/docs/providers-guide.md @@ -1,8 +1,5 @@ # Providers Guide - - - Provider types and their properties can be defined as default config for a pipeline. But also at the stage level of a pipeline to structure the source, build, test, approval, deploy or invoke actions. @@ -20,39 +17,37 @@ Providers and Actions. - [Source](#source) - [CodeCommit](#codecommit) - [Properties](#properties) - - [GitHub](#github) - - [Properties](#properties-1) - [S3](#s3) + - [Properties](#properties-1) + - [CodeConnections](#codeconnections) - [Properties](#properties-2) - - [CodeStar](#codestar) - - [Properties](#properties-3) - [Build](#build) - [CodeBuild](#codebuild) - - [Properties](#properties-4) + - [Properties](#properties-3) - [Jenkins](#jenkins) - - [Properties](#properties-5) + - [Properties](#properties-4) - [Deploy](#deploy) - [Approval](#approval) - - [Properties](#properties-6) + - [Properties](#properties-5) - [CodeBuild](#codebuild-1) - - [Properties](#properties-7) + - [Properties](#properties-6) - [CodeDeploy](#codedeploy) - - [Properties](#properties-8) + - [Properties](#properties-7) - [CloudFormation](#cloudformation) - - [Properties](#properties-9) + - [Properties](#properties-8) - [Lambda](#lambda) - - [Properties](#properties-10) + - [Properties](#properties-9) - [Service Catalog](#service-catalog) - - [Properties](#properties-11) + - [Properties](#properties-10) - [S3](#s3-1) - - [Properties](#properties-12) + - [Properties](#properties-11) ## Source ```yaml default_providers: source: - provider: codecommit|github|s3|codestar + provider: codecommit|s3|codeconnections properties: # All provider specific properties go here. ``` @@ -113,44 +108,6 @@ Provider type: `codecommit`. - NB: The `CODEBUILD_CLONE_REF` value can only be used by CodeBuild downstream actions. -### GitHub - -Use GitHub as a source to trigger your pipeline. -The repository can also be hosted in another account. - -Provider type: `github`. - -#### Properties - -- *repository* - *(String)* defaults to name of the pipeline. - - The GitHub repository name. For example, for the ADF repository it would be - `aws-deployment-framework`. -- *branch* - *(String)* default to configured [adfconfig.yml: - config/scm/default-scm-branch](./admin-guide.md#adfconfig). - - The Branch on the GitHub repository to use to trigger this specific - pipeline. -- *owner* - *(String)* **(required)** - - The name of the GitHub user or organization who owns the GitHub repository. - For example, for the ADF repository that would be: `awslabs`. -- *oauth_token_path* - *(String)* **(required)** - - The OAuth token path in AWS Secrets Manager on the Deployment Account that - holds the GitHub OAuth token used to create the web hook as part of the - pipeline. Read the CodePipeline documentation for more [information on - configuring GitHub - OAuth](https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-GitHub.html#action-reference-GitHub-auth). -- *json_field* - *(String)* **(required)** - - The name of the JSON key in the object that is stored in AWS Secrets Manager - that holds the OAuth Token. -- *trigger_on_changes* - *(Boolean)* default: `True`. - - Whether CodePipeline should release a change and trigger the pipeline. When - set to False, you either need to trigger the pipeline manually, through a - schedule, or through the completion of another pipeline. - - This **disables the triggering** of changes when **set to False**. - - It will not deploy the web hook that GitHub would otherwise use to trigger - the pipeline on changes. - - **By default**, it will trigger deploy the web hook and trigger on changes - using web hook call executed by GitHub. - ### S3 S3 can be used as the source for a pipeline too. **Please note:** you can use @@ -180,43 +137,52 @@ Provider type: `s3`. CodePipeline. Monitoring the S3 object so it can trigger a release when an update took place. -### CodeStar +### CodeConnections -Use CodeStar as a source to trigger your pipeline. The source action retrieves +Use CodeConnections as a source to trigger your pipeline. The source action retrieves code changes when a pipeline is manually executed or when a webhook event is -sent from the source provider. CodeStar Connections currently supports the +sent from the source provider. AWS CodeConnections supports various external +source providers: following third-party repositories: -- Bitbucket -- GitHub and GitHub Enterprise Cloud +- Bitbucket Cloud +- GitHub +- GitHub Enterprise Cloud - GitHub Enterprise Server +- GitLab.com +- GitLab self-managed -The AWS CodeStar connection needs to already exist and be in the "Available" -Status. To use the AWS CodeStar Connection with ADF, its arn needs to be stored +You can find an updated list of the +[external source providers AWS CodeConnections supports +here](https://docs.aws.amazon.com/dtconsole/latest/userguide/welcome-connections.html#welcome-connections-supported-providers) + +The AWS CodeConnections needs to exist and be in the "Available" Status. +To use the AWS CodeConnections with ADF, its ARN needs to be stored in AWS Systems Manager Parameter Store in the deployment account's main region (see details below). Read the CodePipeline documentation for more -[information on how to setup the connection](https://docs.aws.amazon.com/dtconsole/latest/userguide/getting-started-connections.html). +[information on how-to setup the connection](https://docs.aws.amazon.com/dtconsole/latest/userguide/getting-started-connections.html). -Provider type: `codestar`. +Provider type: `codeconnections`. #### Properties - *repository* - *(String)* defaults to name of the pipeline. - - The CodeStar repository name. For example, for the ADF repository it would + - The repository name. For example, for the ADF repository it would be `aws-deployment-framework`. - *branch* - *(String)* default to configured [adfconfig.yml: config/scm/default-scm-branch](./admin-guide.md#adfconfig). - - The Branch on the third-party repository to use to trigger this specific - pipeline. + - The Branch on the repository to use to trigger this specific pipeline. - *owner* - *(String)* **(required)** - The name of the third-party user or organization who owns the third-party repository. For example, for the ADF repository that would be: `awslabs`. -- *codestar_connection_path* - *(String)* **(required)** - - The CodeStar Connection ARN token path in AWS Systems Manager Parameter - Store in the deployment account in the main region that holds the CodeStar - Connection ARN that will be used to download the source code and create the - web hook as part of the pipeline. Read the CodeStar Connections +- *codeconnections_param_path* - *(String)* **(required)** + - The CodeConnections ARN path in AWS Systems Manager (SSM) Parameter Store + in the deployment account in the main region that holds the CodeConnections + resource ARN that will be used to download the source code and create the + web hook as part of the pipeline. Read the CodeConnections documentation for more [information](https://docs.aws.amazon.com/dtconsole/latest/userguide/connections.html). + - If you are relying on an existing CodeStar connection, the SSM Parameter + should contain the AWS CodeStar Connection ARN instead. - *output_artifact_format* - *(String)* default: `CODE_ZIP` - The output artifact format. Values can be either `CODEBUILD_CLONE_REF` or `CODE_ZIP`. If unspecified, the default is `CODE_ZIP`. @@ -255,6 +221,9 @@ Provider type: `codebuild`. #### Properties - *image* *(String|Object)* - default: `STANDARD_7_0`. + - It is recommended to specify the container image your pipeline requires. + Relying on the default value might impact the pipeline in future updates + of ADF if the default were to change. - The Image that the AWS CodeBuild will use. Images can be found [here](https://docs.aws.amazon.com/cdk/api/latest/docs/@aws-cdk_aws-codebuild.LinuxBuildImage.html). - Image can also take an object that contains a reference to a public docker diff --git a/docs/samples-guide.md b/docs/samples-guide.md index bc5e0d39b..a1572b98a 100644 --- a/docs/samples-guide.md +++ b/docs/samples-guide.md @@ -27,7 +27,7 @@ In this guide, we will deploy a foundational VPC with associated resources along with a ECR Repository to hold our shared container images. Once the VPC is in place, we can deploy a ECS Cluster that will run our sample NodeJS application. -ADF supports multiple source types *(Github, CodeCommit, S3, CodeStar)* for +ADF supports multiple source types *(CodeCommit, S3, and CodeConnections)* for pipelines, in this example we will use AWS CodeCommit as the source for our pipelines. diff --git a/docs/user-guide.md b/docs/user-guide.md index d2e7da23d..fe11f003f 100644 --- a/docs/user-guide.md +++ b/docs/user-guide.md @@ -89,18 +89,28 @@ pipelines: - name: vpc default_providers: source: - provider: github + provider: codeconnections properties: # Optional, name property will be used if repository is not specified repository: my-github-vpc # Who owns this Github Repository - owner: bundyfx - # The path in AWS Secrets Manager that holds the GitHub Oauth token, - # ADF only has access to /adf/ prefix in Secrets Manager - oauth_token_path: /adf/github_token - # The field (key) name of the json object stored in AWS Secrets - # Manager that holds the Oauth token - json_field: token + owner: awslabs + # The path in Amazon Systems Manager Parameter Store that holds the + # Connections Arn. + # Please note, by default ADF only has access to read /adf/ + # parameters. You need to create this parameter manually + # in the deployment region in the deployment account once. + # + # It is recommended to add a Tag like CreatedBy with the user that + # created it. So it is clear this parameter is not managed by ADF + # itself. + # + # Example content of the parameter, plain ARN as a simple string: + # arn:aws:codeconnections:eu-west-1:111111111111:connection/11111111-2222-3333-4444-555555555555 + # + # Or in the case of a CodeStar Connection: + # arn:aws:codestar-connections:eu-west-1:111111111111:connection/11111111-2222-3333-4444-555555555555 + codeconnections_param_path: /adf/my_github_connection_arn_param params: notification_endpoint: joes_team@example.com targets: @@ -384,12 +394,11 @@ pipelines: - name: my-web-app-pipeline default_providers: source: - provider: github + provider: codeconnections properties: repository: my-web-app owner: cool_coder - oauth_token_path: /adf/github_token - json_field: token + codeconnections_param_path: /adf/my_github_connection_arn_param targets: - path: /banking/testing name: web-app-testing diff --git a/linters/custom-adf-dict.txt b/linters/custom-adf-dict.txt index 47c467aa4..3399e5425 100644 --- a/linters/custom-adf-dict.txt +++ b/linters/custom-adf-dict.txt @@ -2,8 +2,10 @@ !whitelist adf adfconfig +apogorielov awscli backoff +benbridts binfmt bitnami boto @@ -25,27 +27,37 @@ deregistration devsecops drawio dserver +dsudduth ecrc epel fargate hadolint iname infinidash +javydekoning +mhdaehnert msvs mymodule mypackage norecursedirs +ntwobike ouid oxsecurity pipelinenoti +pozeus pygtk pylintrc rcfile releasever rexec +rickardl runas sarif +sbkok +scps sdkman +skycolangelom +srabidoux stefanzweifel stubber tfapply @@ -58,6 +70,8 @@ tfrun tfstate tfvars toxinidir +tylergohl unconfigured +urlize vpcid zstd diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/example-global-iam.yml b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/example-global-iam.yml index b9cde40be..39e114eac 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/example-global-iam.yml +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/example-global-iam.yml @@ -53,37 +53,39 @@ Resources: - adf-cloudformation-deployment-role ## -# Begin of CodeStar Connection permissions +# Begin of CodeConnections permissions ## -# CodeStarConnectionPolicy: +# CodeConnectionsPolicy: # # This policy defines an example how to grant CodePipeline and CodeBuild -# # access to retrieve code using the CodeStar Connection provider to -# # Bitbucket, GitHub, or GitHub Enterprise -# # NOTE: Make sure you specify the correct CodeStar connections that exist +# # access to retrieve code using the CodeConnections provider to +# # Bitbucket, GitHub, GitHub Enterprise, or GitLab. +# # NOTE: Make sure you specify the correct CodeConnections that exist # # and are active in the deployment account. # # You can check these by navigating to the following URL in your # # deployment region. For example, for eu-west-1: # # https://eu-west-1.console.aws.amazon.com/codesuite/settings/connections # Type: AWS::IAM::Policy # Properties: -# PolicyName: "adf-code-connection-access-policy" +# PolicyName: "adf-codeconnections-access-policy" # PolicyDocument: # Version: "2012-10-17" # Statement: -# - Effect: Allow +# - Sid: AllowAWSCodeConnections +# Effect: Allow # Action: -# - "codestar-connections:UseConnection" +# - "codeconnections:UseConnection" # Resource: -# - !Sub "arn:aws:codestar-connections:${AWS::Region}:${AWS::AccountId}:connection/put-your-connection-id-here" +# - !Sub "arn:aws:codeconnections:${AWS::Region}:${AWS::AccountId}:connection/put-your-connection-id-here" # Condition: # # See https://docs.aws.amazon.com/dtconsole/latest/userguide/security-iam.html#permissions-reference-connections-use -# StringEquals: -# "codestar-connections:ProviderPermissionsRequired": +# StringEqualsIfExists: +# "codeconnections:ProviderPermissionsRequired": # - read_only # # - read_write -# ForAllValues:StringEquals: -# "codestar-connections:ProviderAction": +# ForAllValues:StringEqualsIfExists: +# "codeconnections:ProviderAction": # # - CreatePullRequestDiffComment +# - GenerateReferenceLink # - GetBranch # - GetPullRequest # - GetUploadArchiveToS3Status @@ -97,13 +99,50 @@ Resources: # - ListPullRequestCommits # - ListRepositories # - StartUploadArchiveToS3 -# # StringLike: -# # "codestar-connections:FullRepositoryId": +# # Optional condition to harden it further: +# # StringLikeIfExists: +# # "codeconnections:FullRepositoryId": # # - "your-owner/prefix-repos-allowed-*" +# +# # Only uncomment the following lines if you need to access source +# # repositories via an AWS CodeStar Connection: +# # - Sid: AllowAWSCodeStarConnection +# # Effect: Allow +# # Action: +# # - "codestar-connections:UseConnection" +# # Resource: +# # - !Sub "arn:aws:codestar-connections:${AWS::Region}:${AWS::AccountId}:connection/put-your-connection-id-here" +# # Condition: +# # # See https://docs.aws.amazon.com/dtconsole/latest/userguide/security-iam.html#permissions-reference-connections-use +# # StringEqualsIfExists: +# # "codestar-connections:ProviderPermissionsRequired": +# # - read_only +# # # - read_write +# # ForAllValues:StringEqualsIfExists: +# # "codestar-connections:ProviderAction": +# # # - CreatePullRequestDiffComment +# # - GenerateReferenceLink +# # - GetBranch +# # - GetPullRequest +# # - GetUploadArchiveToS3Status +# # - GitPull +# # # - GitPush +# # - ListBranchCommits +# # - ListBranches +# # - ListCommitFiles +# # - ListOwners +# # - ListPullRequestComments +# # - ListPullRequestCommits +# # - ListRepositories +# # - StartUploadArchiveToS3 +# # # Optional condition to harden it further: +# # # StringLikeIfExists: +# # # "codestar-connections:FullRepositoryId": +# # # - "your-owner/prefix-repos-allowed-*" # Roles: -# # CodePipeline needs access if CodeStar Connections are used as the -# # pipeline source provider to access Bitbucket, GitHub, or -# # GitHub Enterprise repositories. +# # CodePipeline needs access if CodeConnections are used as the +# # pipeline source provider to access Bitbucket, GitHub, +# # GitHub Enterprise or GitLab repositories. # - adf-codepipeline-role # # # The CodeBuild role only needs access when the source provider diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/global.yml b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/global.yml index 56bd7df2a..9aa2fd522 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/global.yml +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/global.yml @@ -321,15 +321,6 @@ Resources: - "sts:AssumeRole" Resource: - "*" - - Effect: Allow - Condition: - StringEquals: - aws:PrincipalOrgID: !Ref OrganizationId - Action: - - "secretsmanager:Get*" - Resource: - # Only allow CodeBuild access to secrets that start with /adf/* - - !Sub "arn:${AWS::Partition}:secretsmanager:${AWS::Region}:${AWS::AccountId}:secret:/adf/*" - Effect: Allow Action: - "ssm:GetParameter" @@ -912,14 +903,14 @@ Resources: - ec2.amazonaws.com - ecs-tasks.amazonaws.com - Effect: Allow - Sid: "AllowCodeStarConnections" + Sid: "AllowCodeConnections" Action: - - "codestar-connections:GetConnection" - - "codestar-connections:GetHost" - - "codestar-connections:ListConnections" - - "codestar-connections:ListHosts" - - "codestar-connections:PassConnection" - - "codestar-connections:UseConnection" + - "codeconnections:GetConnection" + - "codeconnections:GetHost" + - "codeconnections:ListConnections" + - "codeconnections:ListHosts" + - "codeconnections:PassConnection" + - "codeconnections:UseConnection" Resource: "*" Roles: - !Ref CodePipelineRole diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/pipelines_repository/example-deployment_map.yml b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/pipelines_repository/example-deployment_map.yml index 2dfde29df..03e1dc34e 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/pipelines_repository/example-deployment_map.yml +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/initial_commit/pipelines_repository/example-deployment_map.yml @@ -53,12 +53,11 @@ pipelines: # If we omit build and deploy type we get a default of CodeBuild as the build provider. # and CloudFormation as the deploy provider. source: - provider: github + provider: codeconnections properties: repository: example-vpc-adf # Optional, above name property will be used if this is not specified - owner: bundyfx - oauth_token_path: /adf/github_token # The path in AWS Secrets Manager that holds the GitHub Oauth token, ADF only has access to /adf/ prefix in Secrets Manager - json_field: token # The field (key) name of the json object stored in AWS Secrets Manager that holds the Oauth token + owner: awslabs + codeconnections_param_path: /adf/codeconnections_org_wide # The path in AWS Secrets Manager that holds the GitHub Oauth token, ADF only has access to /adf/ prefix in Secrets Manager deploy: provider: cloudformation properties: @@ -72,11 +71,11 @@ pipelines: - name: sample-ecs-app default_providers: source: - provider: codestar + provider: codeconnections properties: repository: my-ecs-app # Optional, the name of the pipeline will be used if this is not specified owner: github-enterprise-team-org - codestar_connection_path: /path/to/parameter # The path in AWS Systems Manager Parameter Store that holds the AWS CodeStar Connection ARN + codeconnections_param_path: /adf/path/to/parameter # The path in AWS Systems Manager Parameter Store that holds the AWS CodeConnections ARN params: notification_endpoint: team@example.com targets: diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/generate_pipeline_inputs.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/generate_pipeline_inputs.py index 17407af0c..7f25c79b1 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/generate_pipeline_inputs.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/pipeline_management/generate_pipeline_inputs.py @@ -78,16 +78,16 @@ def fetch_required_ssm_params(pipeline_input, regions): output["default_scm_codecommit_account_id"] = parameter_store.fetch_parameter( "scm/default_scm_codecommit_account_id", ) - codestar_connection_path = ( + codeconnections_param_path = ( pipeline_input .get("default_providers", {}) .get("source") .get("properties", {}) - .get("codestar_connection_path") + .get("codeconnections_param_path") ) - if codestar_connection_path: - output["codestar_connection_arn"] = ( - parameter_store.fetch_parameter(codestar_connection_path) + if codeconnections_param_path: + output["codeconnections_arn"] = ( + parameter_store.fetch_parameter(codeconnections_param_path) ) return output @@ -174,10 +174,10 @@ def generate_pipeline_inputs( data["pipeline_input"], data["pipeline_input"]["regions"], ) - if "codestar_connection_arn" in data["ssm_params"]: + if "codeconnections_arn" in data["ssm_params"]: data["pipeline_input"]["default_providers"]["source"]["properties"][ - "codestar_connection_arn" - ] = data["ssm_params"]["codestar_connection_arn"] + "codeconnections_arn" + ] = data["ssm_params"]["codeconnections_arn"] data["pipeline_input"]["default_scm_branch"] = ( data["ssm_params"] .get("default_scm_branch") diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/pipeline_management.yml b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/pipeline_management.yml index 074db0003..0cc3ea694 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/pipeline_management.yml +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/pipeline_management.yml @@ -882,7 +882,16 @@ Resources: Resource: - "*" - Effect: Allow - Sid: "AllowCodeStarConnection" + Sid: "AllowCodeConnections" + Action: + - "codeconnections:PassConnection" + Resource: + - !Sub arn:${AWS::Partition}:codeconnections:${AWS::Region}:${AWS::AccountId}:connection/* + Condition: + StringEquals: + 'codeconnections:PassedToService': 'codepipeline.amazonaws.com' + - Effect: Allow + Sid: "AllowCodeStarConnections" Action: - "codestar-connections:PassConnection" Resource: @@ -930,11 +939,6 @@ Resources: - "iam:TagPolicy" - "iam:TagRole" Resource: "*" - - Effect: Allow - Action: - - "secretsmanager:GetSecretValue" - Resource: - - !Sub "arn:${AWS::Partition}:secretsmanager:${AWS::Region}:${AWS::AccountId}:secret:/adf/github_token-*" DeploymentMapProcessingFunction: Type: 'AWS::Serverless::Function' diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_codestar.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_codeconnections.py similarity index 87% rename from src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_codestar.py rename to src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_codeconnections.py index f7bbc1cab..ab2ac4ddb 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_codestar.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_codeconnections.py @@ -1,7 +1,7 @@ # Copyright Amazon.com Inc. or its affiliates. # SPDX-License-Identifier: MIT-0 -"""Construct related to CodeStarConnection CodePipeline Input +"""Construct related to CodeConnections CodePipeline Input """ import os @@ -18,11 +18,11 @@ ADF_DEFAULT_BUILD_TIMEOUT = 20 -class CodeStar(Construct): +class CodeConnections(Construct): def __init__(self, scope: Construct, id: str, map_params: dict, **kwargs): #pylint: disable=W0622 super().__init__(scope, id, **kwargs) self.source = _codepipeline.CfnPipeline.StageDeclarationProperty( - name="Source-CodeStar", + name="Source-CodeConnections", actions=[ Action( name="source", diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_codepipeline.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_codepipeline.py index 5b345bca2..aa2c53cbc 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_codepipeline.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_constructs/adf_codepipeline.py @@ -11,7 +11,6 @@ aws_codepipeline as _codepipeline, aws_events as _eventbridge, aws_events_targets as _eventbridge_targets, - SecretValue, Fn, ) from constructs import Construct @@ -223,17 +222,17 @@ def _generate_configuration(self): default_source_props .get('repository', self.map_params['name']) ) - if not default_source_props.get('codestar_connection_arn'): + if not default_source_props.get('codeconnections_arn'): raise ValueError( - "The CodeStar Connection Arn could not be resolved for " + "The CodeConnections Arn could not be resolved for " f"the {self.map_params['name']} pipeline. Please check " - "whether the codestar_connection_path is setup correctly " + "whether the codeconnections_param_path is setup correctly " "and validate that the Parameter it points to is properly " "configured in SSM Parameter Store." ) props = { "ConnectionArn": default_source_props.get( - 'codestar_connection_arn', + 'codeconnections_arn', ), "FullRepositoryId": f"{owner}/{repo}", "BranchName": default_source_props.get( @@ -247,44 +246,6 @@ def _generate_configuration(self): if output_artifact_format: props["OutputArtifactFormat"] = output_artifact_format return props - if self.provider == "GitHub": - return { - "Owner": ( - self.map_params - .get('default_providers', {}) - .get('source') - .get('properties', {}) - .get('owner', '') - ), - "Repo": ( - self.map_params - .get('default_providers', {}) - .get('source', {}) - .get('properties', {}) - .get('repository', self.map_params['name']) - ), - "Branch": ( - self.map_params - .get('default_providers', {}) - .get('source', {}) - .get('properties', {}) - .get('branch', self.default_scm_branch) - ), - # pylint: disable=no-value-for-parameter - "OAuthToken": SecretValue.secrets_manager( - ( - self.map_params['default_providers']['source'] - .get('properties', {}) - .get('oauth_token_path') - ), - json_field=( - self.map_params['default_providers']['source'] - .get('properties', {}) - .get('json_field') - ), - ), - "PollForSourceChanges": False - } if self.provider == "Lambda": return { "FunctionName": ( @@ -539,8 +500,6 @@ def _generate_codepipeline_access_role(self): # pylint: disable=R0911 .get('account_id', '') ) - if self.provider == "GitHub": - return None if self.provider == "CodeStarSourceConnection": return None if self.provider == "CodeBuild": diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_stacks/adf_default_pipeline.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_stacks/adf_default_pipeline.py index e638c5c2b..e7e85fcc0 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_stacks/adf_default_pipeline.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_stacks/adf_default_pipeline.py @@ -11,8 +11,7 @@ from cdk_constructs import adf_codebuild from cdk_constructs import adf_jenkins from cdk_constructs import adf_codecommit -from cdk_constructs import adf_github -from cdk_constructs import adf_codestar +from cdk_constructs import adf_codeconnections from cdk_constructs import adf_s3 from cdk_constructs import adf_cloudformation from cdk_constructs import adf_notifications @@ -68,13 +67,6 @@ def generate_adf_default_pipeline(scope: Stack, stack_input): stages, ) - if "github" in _get_source_name(stack_input): - adf_github.GitHub.create_webhook_when_required( - scope, - pipeline.cfn, - stack_input["pipeline_input"], - ) - pipeline_triggers = ( stack_input["pipeline_input"] .get("triggers", {}) @@ -117,18 +109,12 @@ def _generate_source_stage_for_pipeline(scope, stack_input): "source", stack_input["pipeline_input"], ).source - if "codestar" in source_name: - return adf_codestar.CodeStar( + if "codeconnections" in source_name: + return adf_codeconnections.CodeConnections( scope, "source", stack_input['pipeline_input'], ).source - if "github" in source_name: - return adf_github.GitHub( - scope, - "source", - stack_input["pipeline_input"], - ).source if "s3" in source_name: return adf_s3.S3( scope, diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/schema_validation.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/schema_validation.py index 4682f0aab..99c9083dc 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/schema_validation.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/schema_validation.py @@ -73,34 +73,20 @@ Optional("properties"): CODECOMMIT_SOURCE_PROPS, } -# GitHub Source -GITHUB_SOURCE_PROPS = { +# CodeConnections Source +CODECONNECTIONS_SOURCE_PROPS = { Optional("repository"): str, Optional("branch"): str, "owner": str, - "oauth_token_path": str, - "json_field": str, - Optional("trigger_on_changes"): bool, -} -GITHUB_SOURCE = { - "provider": 'github', - "properties": GITHUB_SOURCE_PROPS -} - -# CodeStar Source -CODESTAR_SOURCE_PROPS = { - Optional("repository"): str, - Optional("branch"): str, - "owner": str, - "codestar_connection_path": str, + "codeconnections_param_path": str, Optional("output_artifact_format", default=None): ( SOURCE_OUTPUT_ARTIFACT_FORMAT ), } -CODESTAR_SOURCE = { - "provider": 'codestar', - "properties": CODESTAR_SOURCE_PROPS +CODECONNECTIONS_SOURCE = { + "provider": 'codeconnections', + "properties": CODECONNECTIONS_SOURCE_PROPS } # S3 Source @@ -268,9 +254,8 @@ # Core Schema PROVIDER_SOURCE_SCHEMAS = { 'codecommit': Schema(CODECOMMIT_SOURCE), - 'github': Schema(GITHUB_SOURCE), 's3': Schema(S3_SOURCE), - 'codestar': Schema(CODESTAR_SOURCE), + 'codeconnections': Schema(CODECONNECTIONS_SOURCE), } PROVIDER_BUILD_SCHEMAS = { 'codebuild': Schema(DEFAULT_CODEBUILD_BUILD), @@ -288,7 +273,7 @@ 'source': Or( And( { - 'provider': Or('github', 's3', 'codestar'), + 'provider': Or('s3', 'codeconnections'), 'properties': dict, }, # pylint: disable=W0108 diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_deployment_map.yml b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_deployment_map.yml index 60935a07b..3f9bd2c34 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_deployment_map.yml +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/stubs/stub_deployment_map.yml @@ -51,12 +51,11 @@ pipelines: # If we omit build and deploy type we get a default of CodeBuild as the build provider. # and CloudFormation as the deploy provider. source: - provider: github + provider: codeconnections properties: repository: example-vpc-adf # Optional, above name property will be used if this is not specified - owner: bundyfx - oauth_token_path: /adf/github_token # The path in AWS Secrets Manager that holds the GitHub Oauth token, ADF only has access to /adf/ prefix in Secrets Manager - json_field: token # The field (key) name of the json object stored in AWS Secrets Manager that holds the Oauth token + owner: awslabs + codeconnections_param_path: /path/to/parameter # The path in AWS Systems Manager Parameter Store that holds the AWS CodeConnections ARN deploy: provider: cloudformation properties: @@ -70,11 +69,11 @@ pipelines: - name: sample-ecs-app default_providers: source: - provider: codestar + provider: codeconnections properties: repository: my-ecs-app # Optional, the name of the pipeline will be used if this is not specified owner: github-enterprise-team-org - codestar_connection_path: /path/to/parameter # The path in AWS Systems Manager Parameter Store that holds the AWS CodeStar Connection ARN + codeconnections_param_path: /path/to/parameter # The path in AWS Systems Manager Parameter Store that holds the AWS CodeConnections ARN params: notification_endpoint: team@example.com targets: diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_deployment_map.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_deployment_map.py index 2aac0d2a9..387dfdbe1 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_deployment_map.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_deployment_map.py @@ -4,10 +4,8 @@ # pylint: skip-file import os -import boto3 -from errors import InvalidDeploymentMapError -from pytest import fixture, raises +from pytest import fixture from mock import Mock from ..pipeline import Pipeline from ..deployment_map import DeploymentMap @@ -82,7 +80,7 @@ def test_update_deployment_parameters_waves(cls): "default_providers": { "source": { "name": "codecommit", - "properties" : { + "properties": { "account_id": 111111111111, } } diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_schema_validation.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_schema_validation.py index 4b4aeef1a..f976a8eeb 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_schema_validation.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/python/tests/test_schema_validation.py @@ -140,36 +140,53 @@ def test_codecommit_source_schema(self): ) -class GithubSchemaValidationHappyPaths(unittest.TestCase): - def test_github_source_props_schema_default(self): +class CodeConnectionsSchemaValidationHappyPaths(unittest.TestCase): + def test_codeconnections_source_props_schema_default(self): source_props = { "repository": "a_repo_name", "branch": "mainline", "owner": "a_repo_owner", - "oauth_token_path": "a_token_path", - "json_field": "a_json_field", - "trigger_on_changes": True, + "codeconnections_param_path": "the_ssm_param_connection_path", + "output_artifact_format": "CODE_ZIP", } self.assertDictEqual( - Schema(schema_validation.GITHUB_SOURCE_PROPS).validate(source_props), + Schema(schema_validation.CODECONNECTIONS_SOURCE_PROPS).validate(source_props), source_props, ) - def test_github_source_schema_default(self): + def test_codeconnections_source_schema_default(self): source_props = { "repository": "a_repo_name", "branch": "mainline", "owner": "a_repo_owner", - "oauth_token_path": "a_token_path", - "json_field": "a_json_field", - "trigger_on_changes": True, + "codeconnections_param_path": "the_ssm_param_connection_path", + "output_artifact_format": "CODE_ZIP", } - github_source = {"provider": "github", "properties": source_props} + codeconnections_source = {"provider": "codeconnections", "properties": source_props} self.assertDictEqual( - Schema(schema_validation.GITHUB_SOURCE).validate(github_source), - github_source, + Schema(schema_validation.CODECONNECTIONS_SOURCE).validate(codeconnections_source), + codeconnections_source, + ) + + def test_codeconnections_source_schema_required_only(self): + source_props = { + "owner": "a_repo_owner", + "codeconnections_param_path": "the_ssm_param_connection_path", + } + + codeconnections_source = {"provider": "codeconnections", "properties": source_props} + + self.assertDictEqual( + Schema(schema_validation.CODECONNECTIONS_SOURCE).validate(codeconnections_source), + { + "provider": "codeconnections", + "properties": { + **codeconnections_source["properties"], + "output_artifact_format": None, + } + }, ) From 915e716e3d25cc832ad5d7bdbd76aeeeccefff38 Mon Sep 17 00:00:00 2001 From: Simon Kok Date: Tue, 9 Apr 2024 14:26:55 +0200 Subject: [PATCH 7/8] Fix updating old global-iam stacks in the deployment account (#711) **Why?** With PR #568, the policy names in the `adf-bootstrap/deployment/example-global-iam.yml` file were updated to ensure that they are unique. However, if the `example-global-iam.yml` was not updated recently, then copied/renamed to `global-iam.yml` it would overwrite, and or delete policies that were created by the `global.yml` stack instead. This creates an issue that is hard to debug unfortunately. **What?** This proposed change will introduce the ADF managed policy as defined in the `global.yml` stack of the deployment account. This way the policies are (re)created correctly. --- .../bootstrap_repository/adf-bootstrap/deployment/global.yml | 2 +- .../deployment/lambda_codebase/enable_cross_account_access.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/global.yml b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/global.yml index 9aa2fd522..ef395e36d 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/global.yml +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/global.yml @@ -549,7 +549,7 @@ Resources: CloudFormationDeploymentPolicy: Type: AWS::IAM::Policy Properties: - PolicyName: "adf-cloudformation-deployment-role-policy" + PolicyName: "adf-cloudformation-deployment-role-policy-kms" PolicyDocument: Version: "2012-10-17" Statement: diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/enable_cross_account_access.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/enable_cross_account_access.py index 42e9390dc..b44cca42b 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/enable_cross_account_access.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-bootstrap/deployment/lambda_codebase/enable_cross_account_access.py @@ -46,7 +46,7 @@ "adf-codepipeline-role-policy-kms", ], "adf-cloudformation-deployment-role": [ - "adf-cloudformation-deployment-role-policy", + "adf-cloudformation-deployment-role-policy-kms", ], "adf-cloudformation-role": [ "adf-cloudformation-role-policy", From 4ebf49bfeb26246b35e6596b49417b9052a8c66b Mon Sep 17 00:00:00 2001 From: Alex Evans Date: Wed, 17 Apr 2024 15:02:36 +0200 Subject: [PATCH 8/8] fix: remove dangerous default ADF_ORG_STAGE and dont update config for ADF Org Specific config if Param not set (#717) --- .../adf-build/shared/generate_params.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/generate_params.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/generate_params.py index 106f7b25e..b0ac5e220 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/generate_params.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/generate_params.py @@ -118,7 +118,7 @@ class PipelineDefinition(TypedDict): DEPLOYMENT_ACCOUNT_REGION = os.environ["AWS_REGION"] PROJECT_NAME = os.environ["ADF_PROJECT_NAME"] EMPTY_PARAMS_DICT: ParametersAndTags = {'Parameters': {}, 'Tags': {}} -ADF_ORG_STAGE = os.getenv("ADF_ORG_STAGE", "dev") +ADF_ORG_STAGE = os.getenv("ADF_ORG_STAGE") class Parameters: @@ -302,13 +302,14 @@ def create_parameter_files(self) -> None: current_params ) # Compare account_region final to global_stage - current_params = self._merge_params( - Parameters._parse( - params_root_path=self.cwd, - params_filename=f"global_{ADF_ORG_STAGE}", - ), - current_params, - ) + if ADF_ORG_STAGE: + current_params = self._merge_params( + Parameters._parse( + params_root_path=self.cwd, + params_filename=f"global_{ADF_ORG_STAGE}", + ), + current_params, + ) # Compare account_region final to global current_params = self._merge_params( Parameters._parse(