-
Notifications
You must be signed in to change notification settings - Fork 2
[ELI-688] - Adding Kinesis Data Stream as a buffer for Firehose #609
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 15 commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
e7dd4da
[ELI-688] - renaming function to generic since it doesn't actually co…
TOEL2 4eae536
[ELI-688] - renaming firehose delivery stream and adding a kinesis cl…
TOEL2 49993b8
[ELI-688] - updating firehose mock config to use kinesis as source
TOEL2 8fbec9e
[ELI-688] - update service to put to kinesis and added a factory to i…
TOEL2 1f23a9e
[ELI-688] - adding a bridge between fake aws clients
TOEL2 df722eb
[ELI-688] - adding a none placeholder to stop wireup complaining
TOEL2 3380d9c
[ELI-688] - updating firehose module and adding new data stream as a …
TOEL2 fa0395c
[ELI-688] - plumbing into lambda
TOEL2 4b7d1b1
[ELI-688] - adding and attaching policies, extending permissions boun…
TOEL2 b151610
[ELI-688] - adding and attaching kms policies
TOEL2 5fa4468
[ELI-688] - clean up and removing server side encryption as incompatible
TOEL2 0fc6e3e
[ELI-688] - adding github perms
TOEL2 959d744
[ELI-688] - adding and attaching kms policy to the stream
TOEL2 c1211b0
[ELI-688] - addressing some initial comments
TOEL2 cf1a135
[ELI-688] - adding a more useful partition key that will split up int…
TOEL2 89dd588
[ELI-688] - formatting
TOEL2 c2c46f8
[ELI-688] - formatting
TOEL2 c07dd85
[ELI-688] - checkov skips
TOEL2 28592fe
[ELI-688] - linting
TOEL2 70b9494
[ELI-688] - slightly tighter security
TOEL2 c26a144
Merge branch 'main' into feature/ELI-688-kinesis-stream-buffer
TOEL2 c14931e
[ELI-688] - adding missing fixtures and bridge from new tests
TOEL2 c4670bf
[ELI-688] - formatting
TOEL2 dc1d560
Merge branch 'main' into feature/ELI-688-kinesis-stream-buffer
TOEL2 7fb7ea1
[ELI-619] - addressing comments
TOEL2 7eb3055
[ELI-619] - adding tags
TOEL2 f87b194
Merge branch 'main' into feature/ELI-688-kinesis-stream-buffer
TOEL2 3921382
[ELI-619] - removing depends
TOEL2 cde9682
[ELI-619] - adding a fallback key if response id is none
TOEL2 1458214
[ELI-688] - linting
TOEL2 73e68e5
[ELI-619] - adding depends and extending boundry
TOEL2 6363578
[ELI-688] - adding vpc endpoint for kinesis
TOEL2 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
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
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
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
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
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,82 @@ | ||
| resource "aws_kms_key" "kinesis_data_stream_kms_key" { | ||
| description = "${terraform.workspace == "default" ? "" : "${terraform.workspace}-"} kinesis_data_stream_kms Master Key" | ||
| deletion_window_in_days = 14 | ||
| is_enabled = true | ||
| enable_key_rotation = true | ||
| } | ||
|
|
||
| resource "aws_kms_alias" "kinesis_data_stream_kms_key" { | ||
| name = "alias/${var.project_name}-${var.environment}-kinesis-audit-stream" | ||
| target_key_id = aws_kms_key.kinesis_data_stream_kms_key.key_id | ||
| } | ||
|
|
||
|
|
||
| data "aws_iam_policy_document" "kinesis_stream_kms_key_policy" { | ||
| statement { | ||
| sid = "EnableRootPermissions" | ||
| effect = "Allow" | ||
|
|
||
| principals { | ||
| type = "AWS" | ||
| identifiers = ["arn:aws:iam::${data.aws_caller_identity.current.account_id}:root"] | ||
| } | ||
|
|
||
| actions = ["kms:*"] | ||
| resources = ["*"] | ||
| } | ||
|
|
||
| statement { | ||
| sid = "AllowLambdaUseOfKey" | ||
| effect = "Allow" | ||
|
|
||
| principals { | ||
| type = "AWS" | ||
| identifiers = [aws_iam_role.eligibility_lambda_role.arn] | ||
| } | ||
|
|
||
| actions = [ | ||
| "kms:Encrypt", | ||
| "kms:Decrypt", | ||
| "kms:ReEncrypt*", | ||
| "kms:GenerateDataKey*", | ||
| "kms:DescribeKey" | ||
| ] | ||
|
|
||
| resources = ["*"] | ||
| } | ||
|
|
||
| statement { | ||
| sid = "AllowFirehoseRoleUseOfKey" | ||
| effect = "Allow" | ||
|
|
||
| principals { | ||
| type = "AWS" | ||
| identifiers = [aws_iam_role.eligibility_audit_firehose_role.arn] | ||
| } | ||
|
|
||
| actions = [ | ||
| "kms:Decrypt", | ||
| "kms:GenerateDataKey*", | ||
| "kms:DescribeKey" | ||
| ] | ||
|
|
||
| resources = ["*"] | ||
| } | ||
| } | ||
|
|
||
|
|
||
| resource "aws_kms_key_policy" "kinesis_stream_kms_key_policy" { | ||
| key_id = aws_kms_key.kinesis_data_stream_kms_key.id | ||
| policy = data.aws_iam_policy_document.kinesis_stream_kms_key_policy.json | ||
| } | ||
|
|
||
| resource "aws_kinesis_stream" "kinesis_source_stream" { | ||
| name = "${var.project_name}-${var.environment}-kinesis-audit-stream" | ||
| retention_period = 24 | ||
|
|
||
| stream_mode_details { | ||
| stream_mode = "ON_DEMAND" # can discuss later | ||
| } | ||
|
|
||
| encryption_type = "KMS" | ||
| kms_key_id = aws_kms_key.kinesis_data_stream_kms_key.arn | ||
| } | ||
|
TOEL2 marked this conversation as resolved.
|
||
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
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
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
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
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
Oops, something went wrong.
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.