-
Notifications
You must be signed in to change notification settings - Fork 490
[Netskope] Add Alerts v2
data stream
#14443
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
Changes from 2 commits
20b68bc
3478528
bcad1b3
2f32c4a
b2776f5
8cd979d
51f4893
8b609d9
6bc934c
7a059da
afd6855
6a3afd8
88721db
65b785c
28bc32a
895a316
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
version: '2.3' | ||
services: | ||
terraform: | ||
environment: | ||
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID} | ||
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY} | ||
- AWS_SESSION_TOKEN=${AWS_SESSION_TOKEN} | ||
- AWS_DEFAULT_PROFILE=${AWS_DEFAULT_PROFILE} | ||
- AWS_REGION=${AWS_REGION:-us-east-1} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
provider "aws" { | ||
region = "us-east-1" | ||
default_tags { | ||
tags = { | ||
environment = var.ENVIRONMENT | ||
repo = var.REPO | ||
branch = var.BRANCH | ||
build = var.BUILD_ID | ||
created_date = var.CREATED_DATE | ||
} | ||
} | ||
} | ||
|
||
resource "aws_s3_bucket" "bucket" { | ||
bucket = "elastic-package-netskope-alert-v2-bucket-${var.TEST_RUN_ID}" | ||
} | ||
|
||
resource "aws_sqs_queue" "queue" { | ||
name = "elastic-package-netskope-alert-v2-queue-${var.TEST_RUN_ID}" | ||
policy = <<POLICY | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Effect": "Allow", | ||
"Principal": "*", | ||
"Action": "sqs:SendMessage", | ||
"Resource": "arn:aws:sqs:*:*:elastic-package-netskope-alert-v2-queue-${var.TEST_RUN_ID}", | ||
"Condition": { | ||
"ArnEquals": { "aws:SourceArn": "${aws_s3_bucket.bucket.arn}" } | ||
} | ||
} | ||
] | ||
} | ||
POLICY | ||
} | ||
|
||
resource "aws_s3_bucket_notification" "bucket_notification" { | ||
bucket = aws_s3_bucket.bucket.id | ||
|
||
queue { | ||
queue_arn = aws_sqs_queue.queue.arn | ||
events = ["s3:ObjectCreated:*"] | ||
} | ||
} | ||
|
||
resource "aws_s3_object" "object" { | ||
bucket = aws_s3_bucket.bucket.id | ||
key = "test-alerts-v2.csv.gz" | ||
source = "./files/test-alerts-v2.csv.gz" | ||
|
||
|
||
depends_on = [aws_sqs_queue.queue] | ||
} | ||
|
||
output "queue_url" { | ||
value = aws_sqs_queue.queue.url | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
variable "BRANCH" { | ||
description = "Branch name or pull request for tagging purposes" | ||
default = "unknown-branch" | ||
} | ||
|
||
variable "BUILD_ID" { | ||
description = "Build ID in the CI for tagging purposes" | ||
default = "unknown-build" | ||
} | ||
|
||
variable "CREATED_DATE" { | ||
description = "Creation date in epoch time for tagging purposes" | ||
default = "unknown-date" | ||
} | ||
|
||
variable "ENVIRONMENT" { | ||
default = "unknown-environment" | ||
} | ||
|
||
variable "REPO" { | ||
default = "unknown-repo-name" | ||
} | ||
|
||
variable "TEST_RUN_ID" { | ||
default = "detached" | ||
} |
Uh oh!
There was an error while loading. Please reload this page.