Skip to content

Commit

Permalink
Add definition for AUDITED_INTERACTION external table
Browse files Browse the repository at this point in the history
  • Loading branch information
bill-buchan committed Aug 16, 2024
1 parent fbed2c2 commit e93ea89
Show file tree
Hide file tree
Showing 4 changed files with 212 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,198 @@
{
"TableCount": 1,
"Tables": [
{
"TableName": "AUDITED_INTERACTION",
"TablePath": "DELIUS_APP_SCHEMA/USER_/",
"TableOwner": "DELIUS_APP_SCHEMA",
"TableColumns": [
{
"ColumnName": "DMS_CDC_TIMESTAMP",
"ColumnType": "DATETIME",
"ColumnDateFormat": "YYYY-MM-dd HH:mm:ss.F",
"ColumnNullable": "false",
"ColumnScale": "6"
},
{
"ColumnName": "DATE_TIME",
"ColumnType": "DATETIME",
"ColumnDateFormat": "YYYY-MM-dd HH:mm:ss",
"ColumnNullable": "false"
},
{
"ColumnName": "OUTCOME",
"ColumnType": "STRING",
"ColumnLength": "1",
"ColumnNullable": "false"
},
{
"ColumnName": "INTERACTION_PARAMETERS",
"ColumnType": "STRING",
"ColumnLength": "4000",
"ColumnNullable": "true"
},
{
"ColumnName": "SURNAME",
"ColumnType": "STRING",
"ColumnLength": "35",
"ColumnNullable": "false"
},
{
"ColumnName": "FORENAME",
"ColumnType": "STRING",
"ColumnLength": "35",
"ColumnNullable": "false"
},
{
"ColumnName": "FORENAME2",
"ColumnType": "STRING",
"ColumnLength": "35",
"ColumnNullable": "true"
},
{
"ColumnName": "END_DATE",
"ColumnType": "DATETIME",
"ColumnDateFormat": "YYYY-MM-dd HH:mm:ss",
"ColumnNullable": "true"
},
{
"ColumnName": "NOTES",
"ColumnType": "CLOB",
"ColumnLength": "2047",
"ColumnNullable": "true"
},
{
"ColumnName": "ROW_VERSION",
"ColumnType": "INT8",
"ColumnNullable": "false"
},
{
"ColumnName": "DISTINGUISHED_NAME",
"ColumnType": "STRING",
"ColumnLength": "500",
"ColumnNullable": "false"
},
{
"ColumnName": "EXTERNAL_PROVIDER_EMPLOYEEFLAG",
"ColumnType": "STRING",
"ColumnLength": "1",
"ColumnNullable": "true"
},
{
"ColumnName": "EXTERNAL_PROVIDER_ID",
"ColumnType": "INT8",
"ColumnNullable": "true"
},
{
"ColumnName": "TRAINING_SESSION_ID",
"ColumnType": "INT8",
"ColumnNullable": "true"
},
{
"ColumnName": "PRIVATE",
"ColumnType": "INT8",
"ColumnNullable": "false"
},
{
"ColumnName": "ORGANISATION_ID",
"ColumnType": "INT8",
"ColumnNullable": "false"
},
{
"ColumnName": "SC_PROVIDER_ID",
"ColumnType": "INT8",
"ColumnNullable": "true"
},
{
"ColumnName": "CREATED_BY_USER_ID",
"ColumnType": "INT8",
"ColumnNullable": "true"
},
{
"ColumnName": "CREATED_DATETIME",
"ColumnType": "DATETIME",
"ColumnDateFormat": "YYYY-MM-dd HH:mm:ss",
"ColumnNullable": "true"
},
{
"ColumnName": "LAST_UPDATED_USER_ID",
"ColumnType": "INT8",
"ColumnNullable": "true"
},
{
"ColumnName": "LAST_UPDATED_DATETIME",
"ColumnType": "DATETIME",
"ColumnDateFormat": "YYYY-MM-dd HH:mm:ss",
"ColumnNullable": "true"
},
{
"ColumnName": "LAST_ACCESSED_DATETIME",
"ColumnType": "DATETIME",
"ColumnDateFormat": "YYYY-MM-dd HH:mm:ss",
"ColumnNullable": "true"
}
],
"TableColumnsTotal": "22"
},
{
"TableName": "PROBATION_AREA_USER",
"TablePath": "DELIUS_APP_SCHEMA/PROBATION_AREA_USER/",
"TableOwner": "DELIUS_APP_SCHEMA",
"TableColumns": [
{
"ColumnName": "DMS_CDC_TIMESTAMP",
"ColumnType": "DATETIME",
"ColumnDateFormat": "YYYY-MM-dd HH:mm:ss.F",
"ColumnNullable": "false",
"ColumnScale": "6"
},
{
"ColumnName": "USER_ID",
"ColumnType": "INT8",
"ColumnNullable": "false",
"ColumnIsPk": "true"
},
{
"ColumnName": "PROBATION_AREA_ID",
"ColumnType": "INT8",
"ColumnNullable": "false",
"ColumnIsPk": "true"
},
{
"ColumnName": "ROW_VERSION",
"ColumnType": "INT8",
"ColumnNullable": "false"
},
{
"ColumnName": "CREATED_DATETIME",
"ColumnType": "DATETIME",
"ColumnDateFormat": "YYYY-MM-dd HH:mm:ss",
"ColumnNullable": "false"
},
{
"ColumnName": "CREATED_BY_USER_ID",
"ColumnType": "INT8",
"ColumnNullable": "false"
},
{
"ColumnName": "LAST_UPDATED_DATETIME",
"ColumnType": "DATETIME",
"ColumnDateFormat": "YYYY-MM-dd HH:mm:ss",
"ColumnNullable": "false"
},
{
"ColumnName": "LAST_UPDATED_USER_ID",
"ColumnType": "INT8",
"ColumnNullable": "false"
},
{
"ColumnName": "TRAINING_SESSION_ID",
"ColumnType": "INT8",
"ColumnNullable": "true"
}
],
"TableColumnsTotal": "9"
}
]
}

Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
{
"ColumnName": "NOTES",
"ColumnType": "CLOB",
"ColumnLength": "2047",
"ColumnLength": "32000",
"ColumnNullable": "true"
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,14 @@ resource "aws_dms_s3_endpoint" "dms_user_source_endpoint_s3" {

# The Audit s3 source endpoint is only required in Repository environments.
# One endpoint is required for each of the clients of that repository.
# resource "aws_dms_s3_endpoint" "dms_audit_source_endpoint_s3" {
# for_each = toset(try(local.dms_s3_cross_account_client_environments[var.env_name],[]))
# endpoint_id = "s3-staging-of-audit-data-from-${each.value}"
# endpoint_type = "source"
# service_access_role_arn = aws_iam_role.dms_s3_reader_role.arn
# bucket_name = module.s3_bucket_dms_destination.bucket.bucket
# bucket_folder = "audit/${}"

# }




# resource "aws_dms_s3_endpoint" "dms_user_target_endpoint_s3" {
# for_each = toset(try(local.dms_s3_cross_account_client_environments[var.env_name],[]))
# endpoint_id = "s3-staging-of-user-data-from-${lower(var.dms_config.user_source_endpoint.read_database)}-to-${each.value}"
# endpoint_type = "target"
# service_access_role_arn = aws_iam_role.dms_s3_writer_role.arn
# bucket_name = local.dms_s3_bucket_info.dms_s3_cross_account_bucket_names[each.value]
# bucket_folder = "user"
# cdc_path = "cdc"
# preserve_transactions = true
# timestamp_column_name = "TIMESTAMP"
# canned_acl_for_objects = "bucket-owner-full-control"
# }
resource "aws_dms_s3_endpoint" "dms_audit_source_endpoint_s3" {
for_each = toset(try(local.dms_s3_cross_account_client_environments[var.env_name],[]))
endpoint_id = "s3-staging-of-audit-data-from-${each.value}"
endpoint_type = "source"
service_access_role_arn = aws_iam_role.dms_s3_reader_role.arn
bucket_name = module.s3_bucket_dms_destination.bucket.bucket
bucket_folder = "audit/${local.dms_s3_cross_account_audit_source_databases[each.value]}"
cdc_path = "cdc"
external_table_definition = file("files/audited_interaction_external_table_definition.json")
timestamp_column_name = "TIMESTAMP"
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ resource "aws_dms_s3_endpoint" "dms_audit_target_endpoint_s3" {
service_access_role_arn = local.dms_s3_bucket_info.dms_s3_role_arn[var.env_name]
bucket_name = local.dms_s3_bucket_info.dms_s3_cross_account_bucket_names[var.dms_config.audit_target_endpoint.write_environment]
bucket_folder = "audit/${local.audit_source_primary}"
cdc_path = "cdc"
preserve_transactions = true
timestamp_column_name = "TIMESTAMP"
canned_acl_for_objects = "bucket-owner-full-control"
}
Expand Down

0 comments on commit e93ea89

Please sign in to comment.