Running a Status Iglu Repository on AWS S3
In this post, we learn how to set up an Iglu repository for use in an AWS S3 environment, which can be used to feed data into the Snowplow analytics system.
Join the DZone community and get the full member experience.
Join For FreeWhile setting up a Snowplow analytics system, I have to setup a private Iglu repository. The main idea behind this is described on Iglu's GitHub page. That manual missed several steps that are really important for building an Iglu repository on an AWS infrastructure. I had spent a lot of time trying to figureout those step. So here they are:
- You should upload data to S3 in the layout that is described here: https://github.com/snowplow/iglu/wiki/Static-repo
- Enable an S3 bucket as a static hosting solution. It can be from the
Properties
menu of the S3 bucket. - Amend the policy of the S3 bucket to allow for public access. It is located in tbe
Permission
section within theBucket Policy
submenu. Create a CORS policy. It is also located in the Permission section in the submenu of the CORS configuration section.
Update the Iglu resolver config for enricher (https://github.com/snowplow/iglu/wiki/Iglu-client-configuration).
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicReadGetObject",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:GetObject",
"Resource": "arn:aws:s3:::bucket-name/*"
}
]
}
<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
<AllowedOrigin>*</AllowedOrigin>
<AllowedMethod>GET</AllowedMethod>
<AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>
You can check that everything is working correct with simple wget ping:
wget http://you-prefix.s3-amazon-region prefix.amazon.com/schemas/com.yourcompany/schema_name/jsonschema/1-0-0
If you are create your own schema with the reference set as iglu:com.yourcompany/schema_name/{schema_version}
and schema version set as 1-0-0, you should be able to download your schema after following these steps.
Published at DZone with permission of Ivan Zerin, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
Comments