generated from cloudposse/terraform-example-module
-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: initial implementation * upd * Auto Format * upd * Auto Format * upd * Auto Format * upd * Auto Format * last one for today * Auto Format * upd * minor updates * Auto Format * Aws firewall manager allow destroy (dynamic Provider) (#3) * init * add firehose prefix * updates from pr review * comments * make init make github/init make readme * Auto Format * update bucket module * Auto Format * use iam policy document * Auto Format Co-authored-by: SweetOps <[email protected]> Co-authored-by: cloudpossebot <[email protected]>
- Loading branch information
1 parent
b800f3d
commit a462d02
Showing
12 changed files
with
154 additions
and
35 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,5 +1,7 @@ | ||
name: Validate Codeowners | ||
on: | ||
workflow_dispatch: | ||
|
||
pull_request: | ||
|
||
jobs: | ||
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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,58 @@ | ||
module "firehose_label" { | ||
source = "cloudposse/label/null" | ||
version = "0.24.1" | ||
|
||
attributes = ["firehose"] | ||
|
||
context = module.this.context | ||
} | ||
|
||
module "firehose_s3_bucket" { | ||
count = local.enabled && var.firehose_enabled ? 1 : 0 | ||
source = "cloudposse/s3-bucket/aws" | ||
version = "0.38.0" | ||
acl = "private" | ||
enabled = true | ||
user_enabled = true | ||
versioning_enabled = false | ||
allowed_bucket_actions = ["s3:GetObject", "s3:ListBucket", "s3:GetBucketLocation"] | ||
name = module.firehose_label.id | ||
stage = module.this.stage | ||
namespace = module.this.namespace | ||
bucket_name = module.firehose_label.id | ||
|
||
context = module.this.context | ||
} | ||
|
||
data "aws_iam_policy_document" "assume_role" { | ||
count = local.enabled ? 1 : 0 | ||
|
||
statement { | ||
effect = "Allow" | ||
actions = ["sts:AssumeRole"] | ||
|
||
principals { | ||
type = "Service" | ||
identifiers = ["firehose.amazonaws.com"] | ||
} | ||
} | ||
} | ||
|
||
resource "aws_iam_role" "firehose_role" { | ||
count = local.enabled && var.firehose_enabled ? 1 : 0 | ||
name = module.firehose_label.id | ||
|
||
assume_role_policy = join("", data.aws_iam_policy_document.assume_role.*.json) | ||
} | ||
|
||
resource "aws_kinesis_firehose_delivery_stream" "firehose_stream" { | ||
count = local.enabled && var.firehose_enabled ? 1 : 0 | ||
// `aws-waf-logs-` required by AWS - https://aws.amazon.com/premiumsupport/knowledge-center/waf-configure-comprehensive-logging/ | ||
name = format("%s%s", "aws-waf-logs-", module.this.id) | ||
destination = "s3" | ||
|
||
s3_configuration { | ||
role_arn = join("", aws_iam_role.firehose_role.*.arn) | ||
bucket_arn = join("", module.firehose_s3_bucket.*.bucket_arn) | ||
} | ||
} |
This file contains 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
This file contains 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
This file contains 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