I'm referencing this blogpost below, and working on something similar
https://aws.amazon.com/blogs/mt/tracking-and-remediating-non-compliant-resources-by-integrating-aws-config-and-atlassian-jira-service-management-through-automated-webhooks/
{ "version": "0", "id": "600ffa36-d38f-dcd6-8e17-bff3e72394c1", "detail-type": "Config Rules Compliance Change", "source": "aws.config", "account": "XXXXXXXXXXXX", "time": "2023-01-26T20:54:27Z", "region": "us-west-2", "resources": [], "detail": { "resourceId": "vol-0d47ce395abf3e14a", "awsRegion": "us-west-2", "awsAccountId": "XXXXXXXXXXXX", "configRuleName": "encrypted-volumes", "recordVersion": "1.0", "configRuleARN": "arn:aws:config:us-west-2:XXXXXXXXXXXX:config-rule/aws-service-rule/config-conforms.amazonaws.com/config-rule-09h0sc", "messageType": "ComplianceChangeNotification", "newEvaluationResult": { "evaluationResultIdentifier": { "evaluationResultQualifier": { "configRuleName": "encrypted-volumes", "resourceType": "AWS::EC2::Volume", "resourceId": "vol-0d47ce395abf3e14a", "evaluationMode": "DETECTIVE" }, "orderingTimestamp": "2023-01-26T20:53:57.118Z" }, "complianceType": "NON_COMPLIANT", "resultRecordedTime": "2023-01-26T20:54:26.943Z", "configRuleInvokedTime": "2023-01-26T20:54:26.797Z" }, "notificationCreationTime": "2023-01-26T20:54:27.320Z", "resourceType": "AWS::EC2::Volume" } }
Would I be able to extract it with this? I ask because many times in the event it's in a nested list. And I can directly extract the HTTP payload as for this reason.
ruleName = event['ruleName']
Are there any ways to test external services or anything event payload that Lambda receives to determine hwo to appropriately extract the key value pairs?