File tree Expand file tree Collapse file tree 10 files changed +138
-15
lines changed
modules/kinesis/data_stream Expand file tree Collapse file tree 10 files changed +138
-15
lines changed Original file line number Diff line number Diff line change
1
+ resource "aws_kinesis_stream" "kinesis_stream" {
2
+ name = var. kinesis_stream_name
3
+ shard_count = var. kinesis_stream_shard_count
4
+ retention_period = var. kinesis_stream_retention_period
5
+
6
+ shard_level_metrics = var. kinesis_stream_shard_level_metrics
7
+
8
+ enforce_consumer_deletion = var. kinesis_stream_enforce_consumer_deletion
9
+ encryption_type = var. kinesis_stream_encryption_type
10
+
11
+ kms_key_id = var. kinesis_stream_kms_key_id
12
+
13
+ dynamic "stream_mode_details" {
14
+ for_each = length (var. kinesis_stream_mode_details ) > 0 ? [var . kinesis_stream_mode_details ] : []
15
+ content {
16
+ stream_mode = stream_mode_details. value . KINESIS_STREAM_MODE
17
+ }
18
+ }
19
+
20
+ tags = merge (var. kinesis_stream_tags , tomap ({" Name" = var.kinesis_stream_name}))
21
+ }
Original file line number Diff line number Diff line change
1
+ variable "kinesis_stream_name" {
2
+ type = string
3
+ }
4
+
5
+ variable "kinesis_stream_shard_count" {
6
+ type = number
7
+ }
8
+
9
+ variable "kinesis_stream_retention_period" {
10
+ type = number
11
+ }
12
+
13
+ variable "kinesis_stream_shard_level_metrics" {
14
+ type = list (string )
15
+ }
16
+
17
+ variable "kinesis_stream_enforce_consumer_deletion" {
18
+ type = bool
19
+ }
20
+
21
+ variable "kinesis_stream_encryption_type" {
22
+ type = string
23
+ }
24
+
25
+ variable "kinesis_stream_kms_key_id" {
26
+ type = string
27
+ }
28
+
29
+ variable "kinesis_stream_tags" {
30
+ }
31
+
32
+ variable "kinesis_stream_mode_details" {
33
+ type = map (string )
34
+ default = {}
35
+ }
Original file line number Diff line number Diff line change
1
+ module "kinesis_stream" {
2
+ source = " ../..//modules/kinesis/data_stream"
3
+ for_each = var. KINESIS_STREAM_LIST
4
+ kinesis_stream_name = " ${ var . SHORT_ENV } -${ each . key } "
5
+ kinesis_stream_tags = local. common_tags
6
+ kinesis_stream_shard_count = each. value . KINESIS_STREAM_SHARD_COUNT
7
+ kinesis_stream_retention_period = each. value . KINESIS_STREAM_RETENTION_PERIOD
8
+ kinesis_stream_shard_level_metrics = each. value . KINESIS_STREAM_SHARD_LEVEL_METRICS
9
+ kinesis_stream_enforce_consumer_deletion = each. value . KINESIS_STREAM_ENFORCE_CONSUMER_DELETION
10
+ kinesis_stream_encryption_type = each. value . KINESIS_STREAM_ENCRYPTION_TYPE
11
+ kinesis_stream_kms_key_id = each. value . KINESIS_STREAM_KMS_KEY_ID
12
+ kinesis_stream_mode_details = each. value . KINESIS_STREAM_MODE_DETAILS
13
+ }
Original file line number Diff line number Diff line change
1
+ variable "KINESIS_STREAM_LIST" {
2
+ type = map (object ({
3
+ KINESIS_STREAM_SHARD_COUNT = optional (number , 0 ) # If the stream_mode is PROVISIONED, this field is required
4
+ KINESIS_STREAM_RETENTION_PERIOD = optional (number , 0 )
5
+ KINESIS_STREAM_SHARD_LEVEL_METRICS = optional (list (string ), [])
6
+ KINESIS_STREAM_ENFORCE_CONSUMER_DELETION = optional (bool , false )
7
+ KINESIS_STREAM_ENCRYPTION_TYPE = optional (string , " NONE" )
8
+ KINESIS_STREAM_KMS_KEY_ID = optional (string , " " )
9
+ KINESIS_STREAM_MODE_DETAILS = optional (map (string ), {})
10
+ }))
11
+ default = {}
12
+ }
Original file line number Diff line number Diff line change 1
1
module "lambda_function" {
2
- source = " ../../../../ /modules/lambda/lambda_new"
2
+ source = " ../..//modules/lambda/lambda_new"
3
3
for_each = var. LAMBDA_FUNCTION_LIST
4
4
lambda_name = " ${ var . SHORT_ENV } -${ each . key } "
5
5
lambda_assume_role_policy = each. value . LAMBDA_FUNCTION_ASSUME_ROLE_POLICY
Original file line number Diff line number Diff line change 1
1
module "lambda_layers" {
2
- source = " ../../../../ /modules/lambda/lambda_layers"
2
+ source = " ../..//modules/lambda/lambda_layers"
3
3
for_each = var. LAMBDA_LAYERS_LIST
4
4
lambda_layer_name = " ${ var . SHORT_ENV } -${ each . key } "
5
5
lambda_layer_compatible_runtimes = each. value . LAMBDA_LAYER_COMPATIBLE_RUNTIMES
Original file line number Diff line number Diff line change 1
1
module "vpc" {
2
- source = " ../../../../ /modules/vpc/vpc_new"
2
+ source = " ../..//modules/vpc/vpc_new"
3
3
vpc_cidr = var. VPC_CIDR
4
4
vpc_enable_dns_support = var. VPC_ENABLE_DNS_SUPPORT
5
5
vpc_enable_dns_hostnames = var. VPC_ENABLE_DNS_HOSTNAMES
Original file line number Diff line number Diff line change
1
+ terraform {
2
+ source = " ../..//tftemplates/kinesis/data_stream"
3
+ extra_arguments "common_vars" {
4
+ commands = [" init" ," plan" , " apply" ]
5
+ }
6
+ }
7
+
8
+ inputs = {
9
+ KINESIS_STREAM_LIST = {
10
+ dynamo-ut-stream = {
11
+ KINESIS_STREAM_MODE_DETAILS = {
12
+ KINESIS_STREAM_MODE = " PROVISIONED"
13
+ }
14
+ KINESIS_STREAM_SHARD_COUNT = 2
15
+ KINESIS_STREAM_RETENTION_PERIOD = 24
16
+ }
17
+ }
18
+ }
19
+
20
+ generate "backend" {
21
+ path = " backend.tf"
22
+ if_exists = " overwrite_terragrunt"
23
+ contents = << EOF
24
+ terraform {
25
+ backend "s3" {
26
+ bucket = "staging-setup-cloud-platform"
27
+ key = "stage.terraform.tfstate/ap-south-1/kinesis/data_stream/terraform.tfstate"
28
+ region = "ap-south-1"
29
+ }
30
+ }
31
+ EOF
32
+ }
33
+
34
+ generate "provider" {
35
+ path = " provider.tf"
36
+ if_exists = " overwrite_terragrunt"
37
+
38
+ contents = << EOF
39
+ terraform {
40
+ required_version = ">= 1.4.2"
41
+ required_providers {
42
+ aws = {
43
+ source = "hashicorp/aws"
44
+ version = ">= 5.21.0"
45
+ }
46
+ }
47
+ }
48
+ provider "aws" {
49
+ region = "ap-south-1"
50
+ }
51
+ EOF
52
+ }
Original file line number Diff line number Diff line change 1
1
terraform {
2
- source = " ../../../../../../..// tftemplates/stage/data/ec2_infra "
2
+ source = " ../..// tftemplates/lambda "
3
3
extra_arguments "common_vars" {
4
4
commands = [" init" ," plan" , " apply" ]
5
5
}
@@ -54,16 +54,6 @@ inputs = {
54
54
# LAMBDA_LAYERS_ARNS = [dependency.lambda_layer_arn_list.outputs.LAMBDA_LAYER_ARN[0]]
55
55
}
56
56
}
57
-
58
- KINESIS_STREAM_LIST = {
59
- dynamo-ut-stream = {
60
- KINESIS_STREAM_MODE_DETAILS = {
61
- KINESIS_STREAM_MODE = " PROVISIONED"
62
- }
63
- KINESIS_STREAM_SHARD_COUNT = 2
64
- KINESIS_STREAM_RETENTION_PERIOD = 24
65
- }
66
- }
67
57
}
68
58
69
59
generate "backend" {
Original file line number Diff line number Diff line change 1
1
terraform {
2
- source = " ../../../../../..// tftemplates/stage/common /vpc/"
2
+ source = " ../..// tftemplates/vpc/"
3
3
extra_arguments "common_vars" {
4
4
commands = [" init" ," plan" , " apply" ]
5
5
}
You can’t perform that action at this time.
0 commit comments