Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion AWS/DirectoryInsights/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Gather JumpCloud Directory Insights Data with an AWS Serverless Application
# Gather JumpCloud Directory Insights Data with an AWS Serverless Application (Single Line Output)
_This document will walk a JumpCloud Administrator through packaging and deploying this Serverless Application manually. This workflow is intended for those who need to make modifications to the code or tie this solution into other AWS resources. If you would simply like to deploy this Serverless Application as-is, you can do so from the Serverless Application Repository \<placeholder for link when it is offically published\>_

_Note: This document assumes the use of Python 3+_
Expand All @@ -16,6 +16,8 @@ _Note: This document assumes the use of Python 3+_
## Pre-requisites
- [Your JumpCloud API key](https://docs.jumpcloud.com/2.0/authentication-and-authorization/authentication-and-authorization-overview)
- [AWS CLI installed](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html)
- Note: This has tested using the following versions. It should support any version of Python v2.7+ and 3.0+, however AWS recently made changes to their CLI tool that may cause issues with older versions of either AWS or Python.
- `aws-cli/2.2.22 Python/3.8.8`.
- [AWS SAM CLI installed](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-sam-cli-install.html)
- A valid Amazon S3 bucket policy that grants the service read permissions for artifacts uploaded to Amazon S3 when you package your application.
- Go to the [S3 Console](https://s3.console.aws.amazon.com/s3/)
Expand Down
2 changes: 1 addition & 1 deletion AWS/DirectoryInsights/get-jcdirectoryinsights.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def jc_directoryinsights(event, context):
data = data + responseBody
try:
gzOutfile = gzip.GzipFile(filename="/tmp/" + outfileName, mode="w", compresslevel=9)
gzOutfile.write(json.dumps(data, indent=2).encode("UTF-8"))
gzOutfile.write(('[' + ',\n'.join(json.dumps(i) for i in data) + ']').encode('UTF-8'))
gzOutfile.close()
except Exception as e:
raise Exception(e)
Expand Down
8 changes: 4 additions & 4 deletions AWS/DirectoryInsights/serverless.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ Conditions:

Metadata:
AWS::ServerlessRepo::Application:
Name: JumpCloud-DirectoryInsights
Description: This Serverless Application can be used to collect your JumpCloud Directory Insights data at a regular interval.
Name: JumpCloud-DirectoryInsights-SingleLine
Description: This Serverless Application can be used to collect your JumpCloud Directory Insights data at a regular interval, outputting a single Directory Insights Event to a single line.
Author: JumpCloud Solutions Architecture
SemanticVersion: 1.1.0
SemanticVersion: 1.1.1
HomePageUrl: https://git.io/JJlrZ
SourceCodeUrl: https://git.io/JJiMo
LicenseUrl: LICENSE
#LicenseUrl: LICENSE

Resources:
DirectoryInsightsRole:
Expand Down