Skip to content

Commit

Permalink
Add account received in message
Browse files Browse the repository at this point in the history
  • Loading branch information
tmclaugh committed Jan 4, 2025
1 parent cb60ff0 commit 6df2bc5
Show file tree
Hide file tree
Showing 16 changed files with 908 additions and 10 deletions.
3 changes: 2 additions & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ python_version = "3.13"
[packages]
common = {editable = true, path = "src/common"}
aws-lambda-powertools = "*"
requests = "*"

[dev-packages]
boto3-stubs = { extras = [ "sns", "organizations" ], version = "*"}
Expand All @@ -28,6 +29,7 @@ pytest-mypy = "*"
pytest-pylint = "*"
tox = "*"
pytest-dotenv = "*"
requests-mock = "*"

[scripts]
test = "pytest -vv --cov src --cov-report term-missing --cov-fail-under 95 tests"
Expand All @@ -37,4 +39,3 @@ test-ete = "pytest -vv --cov src --cov-report term-missing --cov-fail-under 95 t
flake8 = "pytest -vv --flake8"
pylint = "pytest -vv --pylint"
mypy = "pytest -vv --mypy"

202 changes: 195 additions & 7 deletions Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions data/handlers/AddAccountToCatalog/data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"Id": "123456789012",
"Arn": "arn:aws:organizations::123456789012:account/o-q4ulo3gwzx/123456789012",
"Email": "[email protected]",
"Name": "master",
"Status": "ACTIVE",
"JoinedMethod": "CREATED",
"JoinedTimestamp": "2025-01-03T15:21:04.065434-05:00",
"Tags": [
{
"Key": "org:system",
"Value": "mock_system"
},
{
"Key": "org:domain",
"Value": "mock_domain"
},
{
"Key": "org:owner",
"Value": "group:mock_group"
}
]
}
44 changes: 44 additions & 0 deletions data/handlers/AddAccountToCatalog/data.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "SNS Event",
"type": "object",
"properties": {
"Id": {
"type": "string"
},
"Arn": {
"type": "string"
},
"Email": {
"type": "string"
},
"Name": {
"type": "string"
},
"Status": {
"type": "string"
},
"JoinedMethod": {
"type": "string"
},
"JoinedTimestamp": {
"type": "string"
},
"Tags": {
"type": "array",
"items": {
"type": "object",
"properties": {
"Key": {
"type": "string"
},
"Value": {
"type": "string"
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
}
31 changes: 31 additions & 0 deletions data/handlers/AddAccountToCatalog/event.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"Records": [
{
"EventSource": "aws:sns",
"EventVersion": "1.0",
"EventSubscriptionArn": "arn:aws:sns:us-east-1::MockTopic",
"Sns": {
"Type": "Notification",
"MessageId": "95df01b4-ee98-5cb9-9903-4c221d41eb5e",
"TopicArn": "arn:aws:sns:us-east-1:123456789012:MockTopic",
"Subject": "example message",
"Message": "{ data.json as string }",
"Timestamp": "1970-01-01T00:00:00.000Z",
"SignatureVersion": "1",
"Signature": "EXAMPLE",
"SigningCertUrl": "EXAMPLE",
"UnsubscribeUrl": "EXAMPLE",
"MessageAttributes": {
"Test": {
"Type": "String",
"Value": "TestString"
},
"TestBinary": {
"Type": "Binary",
"Value": "TestBinary"
}
}
}
}
]
}
Loading

0 comments on commit 6df2bc5

Please sign in to comment.