Skip to content

Commit b13490f

Browse files
fix(data-migration): FTRS-2587 data migration table name fix (#850)
* fix(data-migration): FTRS-2587 data migration table name fix * fix(data-migration): FTRS-2587 bump dependencies * fix: FTRS-2587 Fix type inconsistency in KMS * fix: FTRS-2587 Fix type inconsistency in KMS * fix: FTRS-2587 Fix type inconsistency in KMS * fix: FTRS-2587 Fix type inconsistency in KMS --------- Co-authored-by: Michaela McGrath <michaela.mcgrath1@nhs.net>
1 parent eacdfa0 commit b13490f

File tree

4 files changed

+61
-66
lines changed

4 files changed

+61
-66
lines changed

infrastructure/stacks/account_wide/kms.tf

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ module "secrets_manager_encryption_key" {
2727
"kms:GenerateDataKey*",
2828
"kms:DescribeKey"
2929
]
30-
Resource = "*"
30+
Resource = "*"
31+
Condition = {}
3132
},
3233
{
3334
Sid = "AllowGitHubRunnerAccess"
@@ -44,13 +45,14 @@ module "secrets_manager_encryption_key" {
4445
"kms:GenerateDataKey*",
4546
"kms:DescribeKey"
4647
]
47-
Resource = "*"
48+
Resource = "*"
49+
Condition = {}
4850
},
4951
{
5052
Sid = "AllowAthenaConnectorSecretsAccess"
5153
Effect = "Allow"
5254
Principal = {
53-
AWS = "*"
55+
AWS = ["*"]
5456
}
5557
Action = [
5658
"kms:Decrypt",
@@ -171,4 +173,4 @@ module "firehose_encryption_key" {
171173
account_id = data.aws_caller_identity.current.account_id
172174
aws_service_name = "firehose.amazonaws.com"
173175
description = "Encryption key for Firehose in ${var.environment} environment"
174-
}
176+
}

tests/service_automation/poetry.lock

Lines changed: 52 additions & 57 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/service_automation/pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ dependencies = [
2828
"pytest-nhsd-apim (>=6.0.6,<7.0.0)",
2929
"authlib (>=1.6.6,<2.0.0)",
3030
"deepdiff==8.6.1",
31+
"cryptography>=46.0.5"
3132
]
3233

3334
[build-system]

tests/service_automation/tests/step_definitions/common_steps/data_migration_steps.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
from utilities.common.data_migration_shared_steps import (
2121
get_state_record_by_id,
2222
)
23+
from utilities.common.dynamoDB_tables import get_table_name
2324
from utilities.common.log_helper import (
2425
get_mock_logger_from_context,
2526
verify_error_log_present,
@@ -525,11 +526,7 @@ def verify_no_records_in_table(
525526
table_name: str,
526527
) -> None:
527528
"""Verify that a DynamoDB table contains no records."""
528-
environment = os.getenv(ENV_ENVIRONMENT)
529-
workspace = os.getenv(ENV_WORKSPACE)
530-
531-
full_table_name = f"ftrs-dos-{environment}-database-{table_name}-{workspace}"
532-
529+
full_table_name = get_table_name(table_name)
533530
client = dynamodb[DYNAMODB_CLIENT]
534531
response = client.scan(TableName=full_table_name)
535532

0 commit comments

Comments
 (0)