-
Notifications
You must be signed in to change notification settings - Fork 3
VED-759-Data Quality Reports #885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
01c51fc
create data quality s3 buckets
Akol125 60db91d
add s3 lifecycle and policies
Akol125 18f1834
gen validation error
Akol125 15f2fff
change lifecycle name
Akol125 cd42ee6
Merge branch 'master' into VED-795-Data-Quality-Report
Akol125 80c3384
rename bucket
Akol125 dd696df
Merge remote branch into VED-795-Data-Quality-Report
Akol125 b84a577
VED-795: Add deny rules for DQ Report
Akol125 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,88 @@ | ||
| # Create s3 Bucket with conditional destroy for pr environments | ||
| resource "aws_s3_bucket" "data_quality_reports_bucket" { | ||
| bucket = "imms-${local.resource_scope}-data-quality-reports" | ||
| force_destroy = local.is_temp | ||
|
|
||
| } | ||
|
|
||
| # Block public access to the bucket | ||
| resource "aws_s3_bucket_public_access_block" "data_quality_reports_bucket_public_access_block" { | ||
| bucket = aws_s3_bucket.data_quality_reports_bucket.id | ||
|
|
||
| block_public_acls = true | ||
| block_public_policy = true | ||
| ignore_public_acls = true | ||
| restrict_public_buckets = true | ||
| } | ||
|
|
||
| resource "aws_s3_bucket_lifecycle_configuration" "data_quality_reports" { | ||
| bucket = aws_s3_bucket.data_quality_reports_bucket.id | ||
|
|
||
| rule { | ||
| id = "GenericValidationReports" | ||
| status = "Enabled" | ||
|
|
||
| filter { | ||
| } | ||
|
|
||
| expiration { | ||
| days = 14 | ||
| } | ||
| } | ||
| } | ||
|
|
||
|
|
||
| # Add versioning to prevent against accidental deletes | ||
| resource "aws_s3_bucket_versioning" "dq_source_versioning" { | ||
| bucket = aws_s3_bucket.data_quality_reports_bucket.bucket | ||
| versioning_configuration { | ||
| status = "Enabled" | ||
| } | ||
| } | ||
|
|
||
|
|
||
| # If used should attach to lambda or any aws service that needs to perform any operation | ||
| resource "aws_iam_policy" "s3_dq_access" { | ||
| policy = jsonencode({ | ||
| Version = "2012-10-17" | ||
| Statement = [ | ||
| { | ||
| Effect = "Allow" | ||
| Action = ["s3:PutObject"] | ||
| Resource = [ | ||
| aws_s3_bucket.data_quality_reports_bucket.arn, | ||
| "${aws_s3_bucket.data_quality_reports_bucket.arn}/*" | ||
| ] | ||
| } | ||
| ] | ||
| }) | ||
| } | ||
|
|
||
|
|
||
| resource "aws_s3_bucket_policy" "data_quality_bucket_policy" { | ||
| bucket = aws_s3_bucket.data_quality_reports_bucket.id | ||
|
|
||
| policy = jsonencode({ | ||
| Version = "2012-10-17" | ||
| Id = "data_quality_bucket_policy" | ||
| Statement = [ | ||
| { | ||
| Sid = "HTTPSOnly" | ||
| Effect = "Deny" | ||
| Principal = { | ||
| AWS = "*" | ||
| } | ||
| Action = "s3:*" | ||
| Resource = [ | ||
| aws_s3_bucket.data_quality_reports_bucket.arn, | ||
| "${aws_s3_bucket.data_quality_reports_bucket.arn}/*" | ||
| ] | ||
| Condition = { | ||
| Bool = { | ||
| "aws:SecureTransport" = "false" | ||
| } | ||
| } | ||
| }, | ||
| ] | ||
| }) | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.