-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: paologaleotti <[email protected]> Co-authored-by: Vittorio Caprio <[email protected]>
- Loading branch information
1 parent
3ed59c7
commit 53c4780
Showing
28 changed files
with
2,210 additions
and
1,869 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
IFS=',' read -ra TABLES <<< "$TABLES" | ||
for TABLE_NAME in "${TABLES[@]}"; do | ||
echo "Checking if table $TABLE_NAME exists..." | ||
TABLE_EXISTS=$(aws dynamodb list-tables --endpoint-url http://dynamodb-local:8000 | grep -w ${TABLE_NAME}) | ||
if [ -z "$TABLE_EXISTS" ]; then | ||
echo "Table $TABLE_NAME does not exist. Creating table..." | ||
aws dynamodb create-table --cli-input-json file://./schema/$TABLE_NAME-dynamo-db.json --billing-mode PAY_PER_REQUEST --endpoint-url http://dynamodb-local:8000 | ||
aws dynamodb batch-write-item --request-items file://./seed/$TABLE_NAME-seed.json --endpoint-url http://dynamodb-local:8000 | ||
fi | ||
done |
11 changes: 11 additions & 0 deletions
11
docker/dynamo-db/schema/privacy-notice-acceptances-dynamo-db.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"TableName": "privacy-notice-acceptances", | ||
"KeySchema": [{ "AttributeName": "pnIdWithUserId", "KeyType": "HASH" }], | ||
"AttributeDefinitions": [ | ||
{ "AttributeName": "pnIdWithUserId", "AttributeType": "S" } | ||
], | ||
"ProvisionedThroughput": { | ||
"ReadCapacityUnits": 10, | ||
"WriteCapacityUnits": 5 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"TableName": "privacy-notice", | ||
"KeySchema": [{ "AttributeName": "privacyNoticeId", "KeyType": "HASH" }], | ||
"AttributeDefinitions": [ | ||
{ "AttributeName": "privacyNoticeId", "AttributeType": "S" } | ||
], | ||
"ProvisionedThroughput": { | ||
"ReadCapacityUnits": 10, | ||
"WriteCapacityUnits": 5 | ||
} | ||
} |
42 changes: 42 additions & 0 deletions
42
docker/dynamo-db/seed/privacy-notice-acceptances-seed.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"privacy-notice-acceptances": [ | ||
{ | ||
"PutRequest": { | ||
"Item": { | ||
"pnIdWithUserId": { | ||
"S": "0df21ff6-3e8f-4320-af8f-23dea9135d57" | ||
}, | ||
"versionNumber": { | ||
"N": "3" | ||
}, | ||
"acceptedAt": { | ||
"S": "2024-04-17T08:52:24.995218Z" | ||
}, | ||
"privacyNoticeId": { | ||
"S": "0df21ff6-3e8f-4320-af8f-23dea9135d57" | ||
}, | ||
"userId": { | ||
"S": "7d7eab7b-fd79-438c-9ce6-019df34796ef" | ||
}, | ||
"version": { | ||
"M": { | ||
"kind": { | ||
"M": { | ||
"PP": { | ||
"S": "PP" | ||
} | ||
} | ||
}, | ||
"version": { | ||
"N": "3" | ||
}, | ||
"versionId": { | ||
"S": "f4090e0b-5c3f-4cc5-ba46-b17af6a79561" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
{ | ||
"privacy-notice": [ | ||
{ | ||
"PutRequest": { | ||
"Item": { | ||
"privacyNoticeId": { | ||
"S": "6bf8412a-41a7-41a0-82dc-26286ce61b1a" | ||
}, | ||
"createdDate": { | ||
"S": "2023-03-10T15:14:39.847Z" | ||
}, | ||
"lastPublishedDate": { | ||
"S": "2024-07-05T10:33:26.423Z" | ||
}, | ||
"organizationId": { | ||
"S": "5d6e166b-531a-4014-96b6-1cae7db0f64e" | ||
}, | ||
"persistedAt": { | ||
"S": "2024-09-04T15:01:24.467Z" | ||
}, | ||
"privacyNoticeVersion": { | ||
"M": { | ||
"name": { | ||
"S": "Interoperabilità - Backoffice - ToS" | ||
}, | ||
"publishedDate": { | ||
"S": "2024-07-05T10:33:26.423Z" | ||
}, | ||
"status": { | ||
"S": "ACTIVE" | ||
}, | ||
"version": { | ||
"N": "11" | ||
}, | ||
"versionId": { | ||
"S": "0805a4a4-5c7e-4092-96bd-b6dfeda4adfa" | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
[default] | ||
aws_access_key_id=test-aws-key | ||
aws_secret_access_key=test-aws-secret | ||
aws_access_key_id=testawskey | ||
aws_secret_access_key=testawssecret | ||
region=eu-central-1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
[default] | ||
aws_access_key_id=test-aws-key | ||
aws_secret_access_key=test-aws-secret | ||
aws_access_key_id=testawskey | ||
aws_secret_access_key=testawssecret | ||
region=eu-central-1 | ||
services=local | ||
|
||
[services local] | ||
kms= | ||
endpoint_url=http://localhost:4566 | ||
|
||
dynamodb= | ||
endpoint_url=http://localhost:7001 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.