diff --git a/.cspell.json b/.cspell.json new file mode 100644 index 000000000..b138b5986 --- /dev/null +++ b/.cspell.json @@ -0,0 +1,30 @@ +{ + "version": "0.2", + "language": "en", + "dictionaries": [ + "custom-adf", + "bash", + "python", + "en-US", + "corp-terms", + "softwareTerms", + "typescript", + "node", + "npm" + ], + "ignorePaths": [ + "requirements.txt", + "maven-wrapper.jar", + ".cspell.json", + ".gitignore", + "custom-adf-dict.txt" + ], + "allowCompoundWords": true, + "dictionaryDefinitions": [ + { + "name": "custom-adf", + "path": "./linters/custom-adf-dict.txt", + "addWords": true + } + ] +} diff --git a/.mega-linter.yml b/.mega-linter.yml index e99105a38..74aeda5f3 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -20,6 +20,7 @@ ENABLE_LINTERS: - MARKDOWN_MARKDOWN_LINK_CHECK - MARKDOWN_MARKDOWNLINT - MARKDOWN_MARKDOWN_TABLE_FORMATTER + - SPELL_CSPELL - SPELL_MISSPELL - TERRAFORM_TFLINT - YAML_YAMLLINT @@ -42,3 +43,5 @@ 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: '--unique --words-only --gitignore' +SPELL_CSPELL_FILE_EXTENSIONS: ["*"] diff --git a/.pylintrc b/.pylintrc index efeff8930..5bdea6e75 100644 --- a/.pylintrc +++ b/.pylintrc @@ -1,4 +1,4 @@ -[MASTER] +[MAIN] # Specify a configuration file. #rcfile= @@ -7,7 +7,7 @@ # pygtk.require(). #init-hook= -# Add files or directories to the blacklist. They should be base names, not +# Files or directories to be skipped. They should be base names, not # paths. ignore=compat.py, __main__.py @@ -28,7 +28,7 @@ unsafe-load-any-extension=no # A comma-separated list of package or module names from where C extensions may # be loaded. Extensions are loading into the active Python interpreter and may # run arbitrary code -extension-pkg-whitelist= +extension-pkg-allow-list= # Allow optimization of some AST trees. This will activate a peephole AST # optimizer, which will apply various small optimizations. For instance, it can diff --git a/docs/admin-guide.md b/docs/admin-guide.md index 713c27371..be9b0d8bc 100644 --- a/docs/admin-guide.md +++ b/docs/admin-guide.md @@ -1067,10 +1067,10 @@ please replace: - the account ids with simple account ids like: `111111111111`, `222222222222`, etc. -- the organization id with a simple one, `o-theorgid`. +- the organization id with a simple one, `o-aa111bb222`. - the organization unit identifiers and names. - the email addresses by hiding them behind - `--some-notifcation-email-address--`. + `--some-notification-email-address--`. - the Slack channel identifier and SNS topics configured with simplified ones. - the cross-account access role with the default `OrganizationAccountAccessRole`. diff --git a/docs/providers-guide.md b/docs/providers-guide.md index 3985a61b1..dcbda86be 100644 --- a/docs/providers-guide.md +++ b/docs/providers-guide.md @@ -305,7 +305,7 @@ Provider type: `codebuild`. If you wish to pass in a custom Buildspec file that is within the repository. This is useful for custom deploy type actions where CodeBuild will perform the execution of the commands. Path is relational to the - root of the repository, so `build/buidlspec.yml` refers to the + root of the repository, so `build/buildspec.yml` refers to the `buildspec.yml` stored in the `build` directory of the repository. In case CodeBuild is used as a deployment provider, the default BuildSpec diff --git a/docs/user-guide.md b/docs/user-guide.md index bb57b89a9..6b66c1cf2 100644 --- a/docs/user-guide.md +++ b/docs/user-guide.md @@ -26,11 +26,11 @@ - [Deploying Serverless Applications with SAM](#deploying-serverless-applications-with-sam) - [Using YAML Anchors and Aliases](#using-yaml-anchors-and-aliases) - [One to many relationships](#one-to-many-relationships) - - [Terraform pipeline](#terraform-pipeline) - - [Prerequisites](#prerequisites) - - [Overview](#overview) - - [Parameters](#parameters) - - [Deployment procedure](#deployment-procedure) + - [Terraform pipeline](#terraform-pipeline) + - [Prerequisites](#prerequisites) + - [Overview](#overview) + - [Parameters](#parameters) + - [Deployment procedure](#deployment-procedure) ## Deployment Map @@ -1180,13 +1180,13 @@ e.g. The following state files are created: - 111111111111 main region (eu-west-1) - -> adf-global-base-deployment-pipelinebucketxyz/sample-tf-module/111111111111.tfstate + -> `adf-global-base-deployment-pipeline-bucket-xyz/sample-tf-module/111111111111.tfstate` - 111111111111 secondary region (us-east-1) - -> adf-regional-base-deploy-deploymentframeworkregio-jsm/sample-tf-module/111111111111.tfstate + -> `adf-regional-base-deploy-deployment-framework-region-jsm/sample-tf-module/111111111111.tfstate` - 222222222222 main region (eu-west-1) - -> adf-global-base-deployment-pipelinebucketxyz/sample-tf-module/222222222222.tfstate + -> `adf-global-base-deployment-pipeline-bucket-xyz/sample-tf-module/222222222222.tfstate` - 222222222222 secondary region (us-east-1) - -> adf-regional-base-deploy-deploymentframeworkregio-jsm/sample-tf-module/222222222222.tfstate + -> `adf-regional-base-deploy-deployment-framework-region-jsm/sample-tf-module/222222222222.tfstate` A DynamoDB table is created to manage the lock of the state file. It is deployed in every ADF regions named `adf_locktable`. **Please note**: usage diff --git a/linters/custom-adf-dict.txt b/linters/custom-adf-dict.txt new file mode 100644 index 000000000..c04427151 --- /dev/null +++ b/linters/custom-adf-dict.txt @@ -0,0 +1,58 @@ +!blacklist +!whitelist +adf +adfconfig +awscli +backoff +bitnami +boto +boto3 +botocore +bundyfx +cfnlintrc +chattr +chkconfig +chsh +cicd +codepipelinecodeartifactpipelinetriggermytestrepoall +codepipelinecodeartifactpipelinetriggermytestrepomytestpackage +corretto +crhelper +datacls +deregistration +devsecops +drawio +dserver +ecrc +epel +fargate +hadolint +iname +infinidash +msvs +mymodule +mypackage +norecursedirs +ouid +oxsecurity +pipelinenoti +pygtk +pylintrc +rcfile +releasever +rexec +runas +sdkman +stefanzweifel +stubber +tfapply +tfinit +tflint +tflocktable +tfrun +tfstate +tfvars +toxinidir +unconfigured +vpcid +zstd diff --git a/samples/sample-rdk-rules/README.md b/samples/sample-rdk-rules/README.md index eb6a71cff..620b15935 100644 --- a/samples/sample-rdk-rules/README.md +++ b/samples/sample-rdk-rules/README.md @@ -131,4 +131,4 @@ account. If not lambda execution will be failed. have the `lambda-function-account-id` (`1111111111`) as trusted entity as below. -![Trusted entiry](./meta/lambda-account-id-trusted-entiry.png) +![Trusted entity](./meta/lambda-account-id-trusted-entity.png) diff --git a/samples/sample-rdk-rules/config-rules/EC2_CHECKS_TERMINIATION_PROTECTION_ADF/EC2_CHECKS_TERMINIATION_PROTECTION_ADF.py b/samples/sample-rdk-rules/config-rules/EC2_CHECKS_TERMINATION_PROTECTION_ADF/EC2_CHECKS_TERMINATION_PROTECTION_ADF.py similarity index 99% rename from samples/sample-rdk-rules/config-rules/EC2_CHECKS_TERMINIATION_PROTECTION_ADF/EC2_CHECKS_TERMINIATION_PROTECTION_ADF.py rename to samples/sample-rdk-rules/config-rules/EC2_CHECKS_TERMINATION_PROTECTION_ADF/EC2_CHECKS_TERMINATION_PROTECTION_ADF.py index 975896cf8..9fec25f97 100644 --- a/samples/sample-rdk-rules/config-rules/EC2_CHECKS_TERMINIATION_PROTECTION_ADF/EC2_CHECKS_TERMINIATION_PROTECTION_ADF.py +++ b/samples/sample-rdk-rules/config-rules/EC2_CHECKS_TERMINATION_PROTECTION_ADF/EC2_CHECKS_TERMINATION_PROTECTION_ADF.py @@ -68,7 +68,7 @@ def is_applicable_ec2(configuration_item, event): if configuration_item["resourceType"] not in APPLICABLE_RESOURCES: return False - # If instance is not in a valid Environtment its not applicable + # If instance is not in a valid environment its not applicable if not is_valid_environment(configuration_item["resourceId"], event): return False @@ -79,7 +79,7 @@ def is_applicable_ec2(configuration_item, event): return True -# If instance not in a valid Environtment its not applicable +# If instance not in a valid environment its not applicable def is_valid_environment(instance_id, event): ec2 = get_resource("ec2", event) instance = ec2.Instance(instance_id) @@ -310,7 +310,7 @@ def convert_api_configuration(configuration_item): # Based on the type of message get the configuration item # either from configurationItem in the invoking event -# or using the getResourceConfigHistiry API in getConfiguration function. +# or using the getResourceConfigHistory API in getConfiguration function. def get_configuration_item(invoking_event): check_defined(invoking_event, "invokingEvent") if is_oversized_changed_notification(invoking_event["messageType"]): diff --git a/samples/sample-rdk-rules/config-rules/EC2_CHECKS_TERMINIATION_PROTECTION_ADF/EC2_CHECKS_TERMINIATION_PROTECTION_ADF_test.py b/samples/sample-rdk-rules/config-rules/EC2_CHECKS_TERMINATION_PROTECTION_ADF/EC2_CHECKS_TERMINATION_PROTECTION_ADF_test.py similarity index 97% rename from samples/sample-rdk-rules/config-rules/EC2_CHECKS_TERMINIATION_PROTECTION_ADF/EC2_CHECKS_TERMINIATION_PROTECTION_ADF_test.py rename to samples/sample-rdk-rules/config-rules/EC2_CHECKS_TERMINATION_PROTECTION_ADF/EC2_CHECKS_TERMINATION_PROTECTION_ADF_test.py index e336888c6..dd0c4cfb5 100644 --- a/samples/sample-rdk-rules/config-rules/EC2_CHECKS_TERMINIATION_PROTECTION_ADF/EC2_CHECKS_TERMINIATION_PROTECTION_ADF_test.py +++ b/samples/sample-rdk-rules/config-rules/EC2_CHECKS_TERMINATION_PROTECTION_ADF/EC2_CHECKS_TERMINATION_PROTECTION_ADF_test.py @@ -28,7 +28,7 @@ def client(client_name, *args, **kwargs): sys.modules['boto3'] = Boto3Mock() -RULE = __import__('EC2_CHECKS_TERMINIATION_PROTECTION_ADF') +RULE = __import__('EC2_CHECKS_TERMINATION_PROTECTION_ADF') class ComplianceTest(unittest.TestCase): @@ -48,12 +48,12 @@ def test_sample(self): def build_lambda_configurationchange_event(invoking_event, rule_parameters=None): event_to_return = { - 'configRuleName':'myrule', + 'configRuleName':'myRule', 'executionRoleArn':'roleArn', 'eventLeftScope': False, 'invokingEvent': invoking_event, 'accountId': '123456789012', - 'configRuleArn': 'arn:aws:config:us-east-1:123456789012:config-rule/config-rule-8fngan', + 'configRuleArn': 'arn:aws:config:us-east-1:123456789012:config-rule/config-rule-abc', 'resultToken':'token' } if rule_parameters: @@ -63,12 +63,12 @@ def build_lambda_configurationchange_event(invoking_event, rule_parameters=None) def build_lambda_scheduled_event(rule_parameters=None): invoking_event = '{"messageType":"ScheduledNotification","notificationCreationTime":"2017-12-23T22:11:18.158Z"}' event_to_return = { - 'configRuleName':'myrule', + 'configRuleName':'myRule', 'executionRoleArn':'roleArn', 'eventLeftScope': False, 'invokingEvent': invoking_event, 'accountId': '123456789012', - 'configRuleArn': 'arn:aws:config:us-east-1:123456789012:config-rule/config-rule-8fngan', + 'configRuleArn': 'arn:aws:config:us-east-1:123456789012:config-rule/config-rule-abc', 'resultToken':'token' } if rule_parameters: diff --git a/samples/sample-rdk-rules/config-rules/EC2_CHECKS_TERMINIATION_PROTECTION_ADF/parameters.json b/samples/sample-rdk-rules/config-rules/EC2_CHECKS_TERMINATION_PROTECTION_ADF/parameters.json similarity index 56% rename from samples/sample-rdk-rules/config-rules/EC2_CHECKS_TERMINIATION_PROTECTION_ADF/parameters.json rename to samples/sample-rdk-rules/config-rules/EC2_CHECKS_TERMINATION_PROTECTION_ADF/parameters.json index 610d9b1a0..4ab3e857b 100644 --- a/samples/sample-rdk-rules/config-rules/EC2_CHECKS_TERMINIATION_PROTECTION_ADF/parameters.json +++ b/samples/sample-rdk-rules/config-rules/EC2_CHECKS_TERMINATION_PROTECTION_ADF/parameters.json @@ -1,10 +1,10 @@ { "Version": "1.0", "Parameters": { - "RuleName": "EC2_CHECKS_TERMINIATION_PROTECTION_ADF", - "Description": "EC2_CHECKS_TERMINIATION_PROTECTION_ADF", + "RuleName": "EC2_CHECKS_TERMINATION_PROTECTION_ADF", + "Description": "EC2_CHECKS_TERMINATION_PROTECTION_ADF", "SourceRuntime": "python3.9", - "CodeKey": "EC2_CHECKS_TERMINIATION_PROTECTION_ADFeu-central-1.zip", + "CodeKey": "EC2_CHECKS_TERMINATION_PROTECTION_ADFeu-central-1.zip", "InputParameters": "{}", "OptionalParameters": "{}", "SourceEvents": "AWS::EC2::Instance", diff --git a/samples/sample-rdk-rules/meta/lambda-account-id-trusted-entiry.png b/samples/sample-rdk-rules/meta/lambda-account-id-trusted-entity.png similarity index 100% rename from samples/sample-rdk-rules/meta/lambda-account-id-trusted-entiry.png rename to samples/sample-rdk-rules/meta/lambda-account-id-trusted-entity.png diff --git a/src/lambda_codebase/account_processing/create_account.py b/src/lambda_codebase/account_processing/create_account.py index 5d7963abd..2b02ebd1c 100644 --- a/src/lambda_codebase/account_processing/create_account.py +++ b/src/lambda_codebase/account_processing/create_account.py @@ -2,7 +2,7 @@ # SPDX-License-Identifier: MIT-0 """ -Creates an account within your organisation. +Creates an account within your organization. """ import os 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 d071756da..fadaa52a7 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 @@ -10,50 +10,50 @@ class SuccessTestCase(unittest.TestCase): def test_process_account_when_account_exists(self): test_account = { "alias": "MyCoolAlias", - "account_full_name": "mytestaccountname", + "account_full_name": "myTestAccountName", } - account_lookup = {"mytestaccountname": 123456789012} + account_lookup = {"myTestAccountName": 123456789012} self.assertDictEqual( process_account(account_lookup, test_account), { "alias": "MyCoolAlias", - "account_full_name": "mytestaccountname", + "account_full_name": "myTestAccountName", "account_id": 123456789012, "needs_created": False, } ) - def test_process_account_when_account_doesnt_exist(self): + def test_process_account_when_account_does_not_exist(self): test_account = { "alias": "MyCoolAlias", - "account_full_name": "mytestaccountname", + "account_full_name": "myTestAccountName", } - account_lookup = {"mydifferentaccount": 123456789012} + account_lookup = {"myDifferentAccount": 123456789012} self.assertDictEqual( process_account(account_lookup, test_account), { "alias": "MyCoolAlias", - "account_full_name": "mytestaccountname", + "account_full_name": "myTestAccountName", "needs_created": True, } ) def test_process_account_list(self): - all_accounts = [{"Name": "mytestaccountname", "Id": 123456789012}] + all_accounts = [{"Name": "myTestAccountName", "Id": 123456789012}] accounts_in_file = [ - {"account_full_name": "mytestaccountname"}, - {"account_full_name": "mynewaccountname"}, + {"account_full_name": "myTestAccountName"}, + {"account_full_name": "myNewAccountName"}, ] self.assertListEqual( process_account_list(all_accounts, accounts_in_file), [ { - "account_full_name": "mytestaccountname", + "account_full_name": "myTestAccountName", "needs_created": False, "account_id": 123456789012, }, { - "account_full_name": "mynewaccountname", + "account_full_name": "myNewAccountName", "needs_created": True, }, ], 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 b83421f64..9248eeae0 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,7 +1,7 @@ """ Pipeline Management Lambda Function Creates or Updates an Event Rule for forwarding events -If the source account != the Deplyment account +If the source account != the Deployment account """ import os @@ -32,7 +32,7 @@ def lambda_handler(pipeline, _): if not _cache: _cache = Cache() METRICS.put_metric_data( - {"MetricName": "CacheInitalised", "Value": 1, "Unit": "Count"} + {"MetricName": "CacheInitialized", "Value": 1, "Unit": "Count"} ) LOGGER.info(pipeline) 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 a1e45b8ed..3790482d7 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 @@ -58,9 +58,9 @@ def _is_govcloud(region: str) -> bool: return region.startswith("us-gov") @staticmethod - def set_scp_attachment(access_identifer, organization_mapping, path, organizations): - if access_identifer: - if access_identifer.get("keep-default-scp") != "enabled": + def set_scp_attachment(access_identifier, organization_mapping, path, organizations): + if access_identifier: + if access_identifier.get("keep-default-scp") != "enabled": try: organizations.detach_policy( "p-FullAWSAccess", organization_mapping[path] 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 bed348094..28b314da2 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 @@ -105,7 +105,7 @@ def test_get_input_artifacts_deploy_with_cfn_multiple_param_overrides(base_input provider='CloudFormation', target={ 'name': 'targetname', - 'id': 'someid', + 'id': 'some_id', 'properties': { 'param_overrides': [ { @@ -145,7 +145,7 @@ def test_get_input_artifacts_deploy_with_cfn_param_overrides_different_input(bas provider='CloudFormation', target={ 'name': 'targetname', - 'id': 'someid', + 'id': 'some_id', 'properties': { 'param_overrides': [ { @@ -188,7 +188,7 @@ def test_get_input_artifacts_deploy_with_cfn_param_overrides_is_cse(base_input_n action_mode='CHANGE_SET_EXECUTE', target={ 'name': 'targetname', - 'id': 'someid', + 'id': 'some_id', 'properties': { 'param_overrides': [ { @@ -221,7 +221,7 @@ def test_get_input_artifacts_deploy_with_cfn_param_overrides_not_cse(base_input_ action_mode='CHANGE_SET_REPLACE', target={ 'name': 'targetname', - 'id': 'someid', + 'id': 'some_id', 'properties': { 'param_overrides': [ { @@ -265,7 +265,7 @@ def test_get_base_input_artifact_name_deploy_build_disabled(action_decl_mock): provider='CodeBuild', target={ 'name': 'targetname', - 'id': 'someid', + 'id': 'some_id', }, ) assert action._get_base_input_artifact_name() == 'output-source' @@ -280,7 +280,7 @@ def test_get_base_input_artifact_name_deploy_build_enabled(action_decl_mock): provider='CodeBuild', target={ 'name': 'targetname', - 'id': 'someid', + 'id': 'some_id', }, ) assert action._get_base_input_artifact_name() == '{0}-build'.format(BASE_MAP_PARAMS['name']) 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 399162c15..2d1842e46 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 @@ -72,7 +72,7 @@ def test_get_base_output_artifact_name_deploy_codebuild(action_decl_mock): provider='CodeBuild', target={ 'name': 'targetname', - 'id': 'someid', + 'id': 'some_id', }, ) assert action._get_base_output_artifact_name() == '' @@ -87,7 +87,7 @@ def test_get_base_output_artifact_name_deploy_cfn_without_outputs(action_decl_mo provider='CloudFormation', target={ 'name': 'targetname', - 'id': 'someid', + 'id': 'some_id', }, ) assert action._get_base_output_artifact_name() == '' @@ -104,7 +104,7 @@ def test_get_base_output_artifact_name_deploy_cfn_with_outputs_csr(action_decl_m action_mode='CHANGE_SET_REPLACE', target={ 'name': 'targetname', - 'id': 'someid', + 'id': 'some_id', 'properties': { 'outputs': override_outputs_mocked_value, }, @@ -124,7 +124,7 @@ def test_get_base_output_artifact_name_deploy_cfn_with_outputs_cse(action_decl_m action_mode='CHANGE_SET_EXECUTE', target={ 'name': 'targetname', - 'id': 'someid', + 'id': 'some_id', 'properties': { 'outputs': override_outputs_mocked_value, }, 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 2863444a5..97b3a6388 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 @@ -79,11 +79,11 @@ def generate_adf_default_pipeline(scope: core.Stack, stack_input): trigger_config=trigger_config, ) - needs_chatbot_nofications = ( + needs_chatbot_notifications = ( isinstance(notification_config, dict) and notification_config.get('type', '') == 'chat_bot' ) - if needs_chatbot_nofications: + if needs_chatbot_notifications: adf_chatbot.PipelineNotifications( scope, "adf_chatbot_notifications", diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_stacks/tests/test_pipeline_creation.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_stacks/tests/test_pipeline_creation.py index bbbfc3164..a1f239404 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_stacks/tests/test_pipeline_creation.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/shared/cdk/cdk_stacks/tests/test_pipeline_creation.py @@ -99,7 +99,7 @@ def test_pipeline_creation_outputs_as_expected_when_source_is_s3_and_build_is_co def test_pipeline_creation_outputs_as_expected_when_source_is_codecommit_and_build_is_codebuild(): region_name = "eu-central-1" - acount_id = "123456789012" + account_id = "123456789012" stack_input = { "input": {"params": {}, "default_providers": {}, "regions": {}}, @@ -120,7 +120,7 @@ def test_pipeline_creation_outputs_as_expected_when_source_is_codecommit_and_bui stack_input["ssm_params"][region_name] = { "modules": "fake-bucket-name", "kms": ( - f"arn:aws:kms:{region_name}:{acount_id}:key/my-unique-kms-key-id" + f"arn:aws:kms:{region_name}:{account_id}:key/my-unique-kms-key-id" ), } app = core.App() @@ -156,7 +156,7 @@ def test_pipeline_creation_outputs_as_expected_when_source_is_codecommit_and_bui def test_pipeline_creation_outputs_as_expected_when_source_is_codecommit_with_codebuild_clone_ref_and_build_is_codebuild(): region_name = "eu-central-1" - acount_id = "123456789012" + account_id = "123456789012" stack_input = { "input": {"params": {}, "default_providers": {}, "regions": {}}, @@ -180,7 +180,7 @@ def test_pipeline_creation_outputs_as_expected_when_source_is_codecommit_with_co stack_input["ssm_params"][region_name] = { "modules": "fake-bucket-name", "kms": ( - f"arn:aws:kms:{region_name}:{acount_id}:key/my-unique-kms-key-id" + f"arn:aws:kms:{region_name}:{account_id}:key/my-unique-kms-key-id" ), } app = core.App() @@ -217,7 +217,7 @@ def test_pipeline_creation_outputs_as_expected_when_source_is_codecommit_with_co def test_pipeline_creation_outputs_with_codeartifact_trigger(): region_name = "eu-central-1" - acount_id = "123456789012" + account_id = "123456789012" stack_input = { "input": { @@ -250,7 +250,7 @@ def test_pipeline_creation_outputs_with_codeartifact_trigger(): stack_input["ssm_params"][region_name] = { "modules": "fake-bucket-name", - "kms": f"arn:aws:kms:{region_name}:{acount_id}:key/my-unique-kms-key-id", + "kms": f"arn:aws:kms:{region_name}:{account_id}:key/my-unique-kms-key-id", } app = core.App() PipelineStack(app, stack_input) @@ -275,7 +275,7 @@ def test_pipeline_creation_outputs_with_codeartifact_trigger(): def test_pipeline_creation_outputs_with_codeartifact_trigger_with_package_name(): region_name = "eu-central-1" - acount_id = "123456789012" + account_id = "123456789012" stack_input = { "input": { @@ -310,7 +310,7 @@ def test_pipeline_creation_outputs_with_codeartifact_trigger_with_package_name() stack_input["ssm_params"][region_name] = { "modules": "fake-bucket-name", "kms": ( - f"arn:aws:kms:{region_name}:{acount_id}:key/my-unique-kms-key-id" + f"arn:aws:kms:{region_name}:{account_id}:key/my-unique-kms-key-id" ), } app = core.App() @@ -339,7 +339,7 @@ def test_pipeline_creation_outputs_with_codeartifact_trigger_with_package_name() def test_pipeline_creation_outputs_with_invalid_trigger_type(): region_name = "eu-central-1" - acount_id = "123456789012" + account_id = "123456789012" stack_input = { "input": { @@ -376,7 +376,7 @@ def test_pipeline_creation_outputs_with_invalid_trigger_type(): stack_input["ssm_params"][region_name] = { "modules": "fake-bucket-name", "kms": ( - f"arn:aws:kms:{region_name}:{acount_id}:key/my-unique-kms-key-id" + f"arn:aws:kms:{region_name}:{account_id}:key/my-unique-kms-key-id" ), } app = core.App() @@ -395,7 +395,7 @@ def test_pipeline_creation_outputs_with_invalid_trigger_type(): def test_pipeline_creation_outputs_as_expected_when_notification_endpoint_is_chatbot(): region_name = "eu-central-1" - acount_id = "123456789012" + account_id = "123456789012" stack_input = { "input": { @@ -427,7 +427,7 @@ def test_pipeline_creation_outputs_as_expected_when_notification_endpoint_is_cha stack_input["ssm_params"][region_name] = { "modules": "fake-bucket-name", "kms": ( - f"arn:aws:kms:{region_name}:{acount_id}:key/my-unique-kms-key-id" + f"arn:aws:kms:{region_name}:{account_id}:key/my-unique-kms-key-id" ), } app = core.App() 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 aae3ebce8..ac05e64eb 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,5 +1,5 @@ """ -Standardised class for pushing CloudWatch metric data to a service within the ADF Namespace +Standardized class for pushing CloudWatch metric data to a service within the ADF Namespace """ import boto3 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 6f924480a..a8ac765ae 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 @@ -119,7 +119,7 @@ def test_fetch_account_error_invalid_account_id(): cls.fetch_accounts_for_target() -def test_target_scructure_respects_wave(): +def test_target_structure_respects_wave(): test_target_config = {"path": "/some/random/ou", "wave": {"size": 2}} target_structure = TargetStructure( target=test_target_config, @@ -202,7 +202,7 @@ def test_target_scructure_respects_wave(): ] -def test_target_wave_scructure_respects_exclude_config(): +def test_target_wave_structure_respects_exclude_config(): test_target_config = { "path": "/some/random/ou", "wave": {"size": 2},