diff --git a/examples/cloudwatch-logs/variables.tf b/examples/cloudwatch-logs/variables.tf index 62ba4518..e1225ecf 100644 --- a/examples/cloudwatch-logs/variables.tf +++ b/examples/cloudwatch-logs/variables.tf @@ -85,7 +85,7 @@ variable "tags" { } variable "layer_arn" { - description = "In case you are using SSM This is the ARN of the Coralogix Security Layer." + description = "In case you are using SM This is the ARN of the Coralogix Security Layer." type = string default = "" } @@ -109,7 +109,7 @@ variable "custom_s3_bucket" { } variable "create_secret" { - description = "Set to False In case you want to use SSM with your secret that contains coralogix private key" + description = "Set to False In case you want to use SM with your secret that contains coralogix private key" type = string default = "True" } \ No newline at end of file diff --git a/examples/kinesis/variables.tf b/examples/kinesis/variables.tf index 0c89c363..5300188e 100644 --- a/examples/kinesis/variables.tf +++ b/examples/kinesis/variables.tf @@ -80,7 +80,7 @@ variable "tags" { } variable "layer_arn" { - description = "In case you are using SSM This is the ARN of the Coralogix Security Layer." + description = "In case you are using SM This is the ARN of the Coralogix Security Layer." type = string default = "" } @@ -92,7 +92,7 @@ variable "custom_s3_bucket" { } variable "create_secret" { - description = "Set to False In case you want to use SSM with your secret that contains coralogix private key" + description = "Set to False In case you want to use SM with your secret that contains coralogix private key" type = string default = "True" } \ No newline at end of file diff --git a/examples/lambda-secretLayer/README.md b/examples/lambda-secretLayer/README.md index 87005e5c..f8f916bb 100644 --- a/examples/lambda-secretLayer/README.md +++ b/examples/lambda-secretLayer/README.md @@ -1,6 +1,6 @@ # secret-lambdaLayer: -This application will create an SSM layer to use in our integrations. +This application will create an SM layer to use in our integrations. You will need to deploy one layer per AWS Region you want to use. Currently the layer support only NodeJS runtimes. diff --git a/examples/lambda-secretLayer/outputs.tf b/examples/lambda-secretLayer/outputs.tf index 7047a944..b96bda0e 100644 --- a/examples/lambda-secretLayer/outputs.tf +++ b/examples/lambda-secretLayer/outputs.tf @@ -1,4 +1,4 @@ output "lambda_layer_version_arn" { - description = "Lambda Layer version ARN for coralogix-ssmlayer" - value = aws_lambda_layer_version.coralogix_ssmlayer.arn + description = "Lambda Layer version ARN for coralogix-smlayer" + value = aws_lambda_layer_version.coralogix_smlayer.arn } diff --git a/examples/resource-metadata/variables.tf b/examples/resource-metadata/variables.tf index 228c7b50..3cb52f59 100644 --- a/examples/resource-metadata/variables.tf +++ b/examples/resource-metadata/variables.tf @@ -20,7 +20,7 @@ variable "private_key" { } variable "layer_arn" { - description = "In case you are using SSM This is the ARN of the Coralogix Security Layer." + description = "In case you are using SM This is the ARN of the Coralogix Security Layer." type = string default = "" } @@ -92,7 +92,7 @@ variable "custom_s3_bucket" { } variable "create_secret" { - description = "Set to False In case you want to use SSM with your secret that contains coralogix private key" + description = "Set to False In case you want to use SM with your secret that contains coralogix private key" type = string default = "True" } \ No newline at end of file diff --git a/examples/s3/variables.tf b/examples/s3/variables.tf index 549bf9a1..988fc551 100644 --- a/examples/s3/variables.tf +++ b/examples/s3/variables.tf @@ -21,7 +21,7 @@ variable "private_key" { } variable "layer_arn" { - description = "In case you are using SSM This is the ARN of the Coralogix Security Layer." + description = "In case you are using SM This is the ARN of the Coralogix Security Layer." type = string default = "" } @@ -141,7 +141,7 @@ variable "custom_s3_bucket" { } variable "create_secret" { - description = "Set to False In case you want to use SSM with your secret that contains coralogix private key" + description = "Set to False In case you want to use SM with your secret that contains coralogix private key" type = string default = "True" } \ No newline at end of file diff --git a/modules/cloudwatch-logs/CHANGELOG.md b/modules/cloudwatch-logs/CHANGELOG.md index 8ef72132..00bc5201 100644 --- a/modules/cloudwatch-logs/CHANGELOG.md +++ b/modules/cloudwatch-logs/CHANGELOG.md @@ -2,6 +2,9 @@ ## cloudwatch-logs +### 0.0.4 / 1.10.2023 +* [Change] Change SSM option in the integration to SM - Secret Manager. + ### 0.0.3 / 16.8.2023 * [Update] Add an option to use an existing secret instead of creating a new one with SSM, and remove ssm_enabled variable. diff --git a/modules/cloudwatch-logs/README.md b/modules/cloudwatch-logs/README.md index dd27e27d..c68b955b 100644 --- a/modules/cloudwatch-logs/README.md +++ b/modules/cloudwatch-logs/README.md @@ -10,6 +10,9 @@ Manage the application which retrieves `CloudWatch` logs and sends them to your | [aws](#requirement\_aws) | >= 2.23 | | [aws](#requirement\_aws) | Cloudwatch log group| +### Note: +* in case you use SM(Secret Manager) you should first deploy the [SM lambda layer](https://serverlessrepo.aws.amazon.com/applications/eu-central-1/597078901540/Coralogix-Lambda-SSMLayer) + ## Providers | Name | Version | @@ -29,8 +32,8 @@ Manage the application which retrieves `CloudWatch` logs and sends them to your |------|-------------|------|---------|:--------:| | [coralogix\_region](#input\_coralogix\_region) | The Coralogix location region, possible options are [`Europe`, `Europe2`, `India`, `Singapore`, `US`, `US2`] | `string` | `Europe` | yes | | [custom_url](#input\_custom\_domain) | Custom url for coralogix | `string` | n/a | no | -| [layer_arn](#input\_layer\_arn) | In case you are using SSM This is the ARN of the Coralogix Security Layer. | `string` | n/a | no | -| [create_secret](#input\_create\_secret) | Set to False In case you want to use SSM with your secret that contains coralogix Private Key| `string` | True | no | +| [layer_arn](#input\_layer\_arn) | In case you want to use SM This is the ARN of the Coralogix [Security Layer](https://serverlessrepo.aws.amazon.com/applications/eu-central-1/597078901540/Coralogix-Lambda-SSMLayer). | `string` | n/a | no | +| [create_secret](#input\_create\_secret) | Set to False In case you want to use SM with your secret that contains coralogix Private Key| `string` | True | no | | [private\_key](#input\_private\_key) | Your Coralogix secret key or incase you use your own created secret put here the name of your secret that contains the coralogix Private Key| `string` | n/a | yes | | [application\_name](#input\_application\_name) | The name of your application | `string` | n/a | yes | | [subsystem\_name](#input\_subsystem\_name) | The subsystem name of your application | `string` | n/a | yes | @@ -48,7 +51,9 @@ Manage the application which retrieves `CloudWatch` logs and sends them to your | [tags](#input\_tags) | A map of tags to add to all resources | `map(string)` | `{}` | no | ### Note: -You should use the `custom_s3_bucket` variable only when you need to deploy the integration in aws region that coralogix doesn't have a public bucket in (i.e for GovCloud), when using this variable you will need to create a bucket in the region that you want to run the integration in, and pass this bucket name as `custom_s3_bucket`. The module will download the integration file to your local workspace, and then upload these files to the `custom_s3_bucket`, and remove the file from your local workspace. +* You should use the `custom_s3_bucket` variable only when you need to deploy the integration in aws region that coralogix doesn't have a public bucket in (i.e for GovCloud), when using this variable you will need to create a bucket in the region that you want to run the integration in, and pass this bucket name as `custom_s3_bucket`. The module will download the integration file to your local workspace, and then upload these files to the `custom_s3_bucket`, and remove the file from your local workspace. + +* You can use log field as `Application/Subsystem` names. Use the following syntax: `$.my_log.field`. In case you leave subsystemName as Empty it will be populated from log group name. ## Coralgoix regions | Coralogix region | AWS Region | Coralogix Domain | diff --git a/modules/cloudwatch-logs/main.tf b/modules/cloudwatch-logs/main.tf index 9f77d0d6..e9b37cf0 100644 --- a/modules/cloudwatch-logs/main.tf +++ b/modules/cloudwatch-logs/main.tf @@ -70,7 +70,7 @@ module "lambda" { tags = merge(var.tags, module.locals.tags) } -module "lambdaSSM" { +module "lambdaSM" { source = "terraform-aws-modules/lambda/aws" version = "3.3.1" create = var.layer_arn != "" ? true : false @@ -143,7 +143,7 @@ resource "aws_cloudwatch_log_subscription_filter" "this" { count = length(var.log_groups) name = "${module.lambda.lambda_function_name}-Subscription-${count.index}" log_group_name = data.aws_cloudwatch_log_group.this[count.index].name - destination_arn = var.layer_arn != "" ? module.lambdaSSM.lambda_function_arn : module.lambda.lambda_function_arn + destination_arn = var.layer_arn != "" ? module.lambdaSM.lambda_function_arn : module.lambda.lambda_function_arn filter_pattern = "" } @@ -154,7 +154,7 @@ resource "aws_sns_topic" "this" { } resource "aws_sns_topic_subscription" "this" { - depends_on = [aws_sns_topic.this, module.lambdaSSM, module.lambda] + depends_on = [aws_sns_topic.this, module.lambdaSM, module.lambda] count = var.notification_email != null ? 1 : 0 topic_arn = aws_sns_topic.this.arn protocol = "email" @@ -163,7 +163,7 @@ resource "aws_sns_topic_subscription" "this" { resource "aws_secretsmanager_secret" "private_key_secret" { count = var.layer_arn != "" && var.create_secret == "True" ? 1 : 0 - depends_on = [module.lambdaSSM] + depends_on = [module.lambdaSM] name = "lambda/coralogix/${data.aws_region.this.name}/${module.locals.function_name}" description = "Coralogix Send Your Data key Secret" } diff --git a/modules/cloudwatch-logs/variables.tf b/modules/cloudwatch-logs/variables.tf index dc7ae0c5..ff3157a8 100644 --- a/modules/cloudwatch-logs/variables.tf +++ b/modules/cloudwatch-logs/variables.tf @@ -85,7 +85,7 @@ variable "tags" { } variable "layer_arn" { - description = "In case you are using SSM This is the ARN of the Coralogix Security Layer." + description = "In case you are using SM This is the ARN of the Coralogix Security Layer." type = string default = "" } @@ -109,7 +109,7 @@ variable "custom_s3_bucket" { } variable "create_secret" { - description = "Set to False In case you want to use SSM with your secret that contains coralogix private key" + description = "Set to False In case you want to use SM with your secret that contains coralogix private key" type = string default = "True" } diff --git a/modules/kinesis/CHANGELOG.md b/modules/kinesis/CHANGELOG.md index 39e89b03..13a57d27 100644 --- a/modules/kinesis/CHANGELOG.md +++ b/modules/kinesis/CHANGELOG.md @@ -2,6 +2,9 @@ ## kinesis +### 0.0.3 / 1.10.2023 +* [Change] Change SSM option in the integration to SM - Secret Manager. + ### 0.0.2 / 16.8.2023 * [Update] Add an option to use an existing secret instead of creating a new one with SSM, and remove ssm_enabled variable. diff --git a/modules/kinesis/README.md b/modules/kinesis/README.md index 39dbe6d7..ae52891f 100644 --- a/modules/kinesis/README.md +++ b/modules/kinesis/README.md @@ -9,6 +9,9 @@ Manage the application which retrieves logs from `S3` bucket and sends them to y | [terraform](#requirement\_terraform) | >= 0.13.1 | | [aws](#requirement\_aws) | >= 2.23 | +### Note: +* in case you use SM(Secret Manager) you should first deploy the [SM lambda layer](https://serverlessrepo.aws.amazon.com/applications/eu-central-1/597078901540/Coralogix-Lambda-SSMLayer) + ## Providers | Name | Version | @@ -28,8 +31,8 @@ Manage the application which retrieves logs from `S3` bucket and sends them to y |------|-------------|------|---------|:--------:| | [coralogix\_region](#input\_coralogix\_region) | The Coralogix location region, possible options are [`Europe`, `Europe2`, `India`, `Singapore`, `US`, `US2`] | `string` | `Europe` | yes | | [custom_url](#input\_custom\_url) | Custom url for coralogix | `string` | n/a | no | -| [layer_arn](#input\_layer\_arn) | In case you are using SSM This is the ARN of the Coralogix Security Layer. | `string` | n/a | no | -| [create_secret](#input\_create\_secret) | Set to False In case you want to use SSM with your secret that contains coralogix Private Key| `string` | True | no | +| [layer_arn](#input\_layer\_arn) | In case you want to use SM This is the ARN of the Coralogix [Security Layer](https://serverlessrepo.aws.amazon.com/applications/eu-central-1/597078901540/Coralogix-Lambda-SSMLayer). | `string` | n/a | no | +| [create_secret](#input\_create\_secret) | Set to False In case you want to use SM with your secret that contains coralogix Private Key| `string` | True | no | | [private\_key](#input\_private\_key) | Your Coralogix secret key or incase you use your own created secret put here the name of your secret that contains the coralogix Private Key| `string` | n/a | yes | | [application\_name](#input\_application\_name) | The name of your application | `string` | n/a | yes | | [subsystem\_name](#input\_subsystem\_name) | The subsystem name of your application | `string` | n/a | yes | diff --git a/modules/kinesis/main.tf b/modules/kinesis/main.tf index 1aeeb211..08f118f7 100644 --- a/modules/kinesis/main.tf +++ b/modules/kinesis/main.tf @@ -76,7 +76,7 @@ module "lambda" { tags = merge(var.tags, module.locals.tags) } -module "lambda_ssm" { +module "lambda_sm" { source = "terraform-aws-modules/lambda/aws" version = "3.3.1" create = var.layer_arn != "" ? true : false @@ -151,7 +151,7 @@ resource "aws_sns_topic" "this" { } resource "aws_sns_topic_subscription" "this" { - depends_on = [aws_sns_topic.this, module.lambda_ssm, module.lambda] + depends_on = [aws_sns_topic.this, module.lambda_sm, module.lambda] count = var.notification_email != null ? 1 : 0 topic_arn = aws_sns_topic.this.arn protocol = "email" @@ -160,7 +160,7 @@ resource "aws_sns_topic_subscription" "this" { resource "aws_secretsmanager_secret" "private_key_secret" { count = var.layer_arn != "" && var.create_secret == "True" ? 1 : 0 - depends_on = [module.lambda_ssm] + depends_on = [module.lambda_sm] name = "lambda/coralogix/${data.aws_region.this.name}/${module.locals.function_name}" description = "Coralogix Send Your Data key Secret" } diff --git a/modules/kinesis/variables.tf b/modules/kinesis/variables.tf index 9801c76a..c61009df 100644 --- a/modules/kinesis/variables.tf +++ b/modules/kinesis/variables.tf @@ -80,7 +80,7 @@ variable "tags" { } variable "layer_arn" { - description = "In case you are using SSM This is the ARN of the Coralogix Security Layer." + description = "In case you are using SM This is the ARN of the Coralogix Security Layer." type = string default = "" } @@ -92,7 +92,7 @@ variable "custom_s3_bucket" { } variable "create_secret" { - description = "Set to False In case you want to use SSM with your secret that contains coralogix private key" + description = "Set to False In case you want to use SM with your secret that contains coralogix private key" type = string default = "True" } \ No newline at end of file diff --git a/modules/lambda-secretLayer/CHANGELOG.md b/modules/lambda-secretLayer/CHANGELOG.md index 4978a09e..255ee94b 100644 --- a/modules/lambda-secretLayer/CHANGELOG.md +++ b/modules/lambda-secretLayer/CHANGELOG.md @@ -1,5 +1,4 @@ ## lambda-secretLayer - - - \ No newline at end of file +### 0.0.1 / 1.10.2023 +* [Change] Change SSM option in the integration to SM - Secret Manager. \ No newline at end of file diff --git a/modules/lambda-secretLayer/README.md b/modules/lambda-secretLayer/README.md index abc9a038..21e17387 100644 --- a/modules/lambda-secretLayer/README.md +++ b/modules/lambda-secretLayer/README.md @@ -1,6 +1,6 @@ -## Coralogx Layer for SSM private_key +## Coralogx Layer for SM private_key -This Lambda Layer allows to store Coralogix Private Key in SSM. +This Lambda Layer allows to store Coralogix Private Key in SM. You will need to deploy one layer per AWS Region you want to use. For now. diff --git a/modules/lambda-secretLayer/main.tf b/modules/lambda-secretLayer/main.tf index 87b2295c..9d307624 100644 --- a/modules/lambda-secretLayer/main.tf +++ b/modules/lambda-secretLayer/main.tf @@ -1,8 +1,8 @@ data "aws_region" "this" {} -resource "aws_lambda_layer_version" "coralogix_ssmlayer" { - layer_name = "coralogix-ssmlayer" - description = "Lambda function layer for using SSM for PrivateKey safe keeping" +resource "aws_lambda_layer_version" "coralogix_smlayer" { + layer_name = "coralogix-smlayer" + description = "Lambda function layer for using SM for PrivateKey safe keeping" license_info = "Apache-2.0" compatible_runtimes = ["nodejs16.x", "nodejs18.x", "nodejs14.x"] compatible_architectures = ["x86_64", "arm64"] diff --git a/modules/lambda-secretLayer/output.tf b/modules/lambda-secretLayer/output.tf index 7047a944..b96bda0e 100644 --- a/modules/lambda-secretLayer/output.tf +++ b/modules/lambda-secretLayer/output.tf @@ -1,4 +1,4 @@ output "lambda_layer_version_arn" { - description = "Lambda Layer version ARN for coralogix-ssmlayer" - value = aws_lambda_layer_version.coralogix_ssmlayer.arn + description = "Lambda Layer version ARN for coralogix-smlayer" + value = aws_lambda_layer_version.coralogix_smlayer.arn } diff --git a/modules/resource-metadata/CHANGELOG.md b/modules/resource-metadata/CHANGELOG.md index 317e6a9a..1ff9719a 100644 --- a/modules/resource-metadata/CHANGELOG.md +++ b/modules/resource-metadata/CHANGELOG.md @@ -2,6 +2,9 @@ ## resource-metadata +### 0.0.4 / 1.10.2023 +* [Change] Change SSM option in the integration to SM - Secret Manager. + ### 0.0.3 / 6.9.2023 * [Bug fix] Remove the IAM role named Default - there is no need for this role and it can cause a conflict. diff --git a/modules/resource-metadata/README.md b/modules/resource-metadata/README.md index 8567130e..5698f7dd 100644 --- a/modules/resource-metadata/README.md +++ b/modules/resource-metadata/README.md @@ -9,6 +9,9 @@ Manage the application which retrieves `meta data` from your aws account and sen | [terraform](#requirement\_terraform) | >= 0.13.1 | | [aws](#requirement\_aws) | >= 2.23 | +### Note: +* in case you use SM(Secret Manager) you should first deploy the [SM lambda layer](https://serverlessrepo.aws.amazon.com/applications/eu-central-1/597078901540/Coralogix-Lambda-SSMLayer) + ## Providers | Name | Version | @@ -28,8 +31,8 @@ Manage the application which retrieves `meta data` from your aws account and sen |------|-------------|------|---------|:--------:| | [coralogix\_region](#input\_coralogix\_region) | The Coralogix location region, possible options are [`Europe`, `Europe2`, `India`, `Singapore`, `US`, `US2`, `Custom`] | `string` | n/a | yes | | [custom_url](#input\_custom\_domain) | Custom url for coralogix for example: https:///api/v1/logs| `string` | n/a | no | -| [layer_arn](#input\_layer\_arn) | In case you are using SSM This is the ARN of the Coralogix Security Layer. | `string` | n/a | no | -| [create_secret](#input\_create\_secret) | Set to False In case you want to use SSM with your secret that contains coralogix Private Key| `string` | True | no | +| [layer_arn](#input\_layer\_arn) | In case you want to use SM This is the ARN of the Coralogix [Security Layer](https://serverlessrepo.aws.amazon.com/applications/eu-central-1/597078901540/Coralogix-Lambda-SSMLayer). | `string` | n/a | no | +| [create_secret](#input\_create\_secret) | Set to False In case you want to use SM with your secret that contains coralogix Private Key| `string` | True | no | | [private\_key](#input\_private\_key) | Your Coralogix secret key or incase you use your own created secret put here the name of your secret that contains the coralogix Private Key| `string` | n/a | yes | | [schedule](#input\_schedule) | The rate to collacet metadata | `string` | `rate(10 minutes)` | no | | [latest_versions_per_function](#input\_latest\_versions\_per\_function) | How many latest published versions of each Lambda function should be collected | `number` | 5 | no | diff --git a/modules/resource-metadata/main.tf b/modules/resource-metadata/main.tf index 00eacccc..8521788d 100644 --- a/modules/resource-metadata/main.tf +++ b/modules/resource-metadata/main.tf @@ -33,7 +33,7 @@ module "eventbridge" { crons = [ { name = "cron-for-lambda" - arn = var.layer_arn == "" ? module.lambda.lambda_function_arn : module.lambdaSSM.lambda_function_arn + arn = var.layer_arn == "" ? module.lambda.lambda_function_arn : module.lambdaSM.lambda_function_arn input = jsonencode({ "job" : "cron-by-rate" }) } ] @@ -114,7 +114,7 @@ module "lambda" { tags = merge(var.tags, local.tags) } -module "lambdaSSM" { +module "lambdaSM" { create = var.layer_arn != "" ? true : false depends_on = [ null_resource.s3_bucket ] source = "terraform-aws-modules/lambda/aws" @@ -195,7 +195,7 @@ resource "aws_sns_topic" "this" { resource "aws_secretsmanager_secret" "private_key_secret" { count = var.layer_arn != "" && var.create_secret == "True" ? 1 : 0 - depends_on = [module.lambdaSSM] + depends_on = [module.lambdaSM] name = "lambda/coralogix/${data.aws_region.this.name}/${local.function_name}" description = "Coralogix Send Your Data key Secret" } diff --git a/modules/resource-metadata/variables.tf b/modules/resource-metadata/variables.tf index 46f9eda5..60cedded 100644 --- a/modules/resource-metadata/variables.tf +++ b/modules/resource-metadata/variables.tf @@ -20,7 +20,7 @@ variable "private_key" { } variable "layer_arn" { - description = "In case you are using SSM This is the ARN of the Coralogix Security Layer." + description = "In case you are using SM This is the ARN of the Coralogix Security Layer." type = string default = "" } @@ -92,7 +92,7 @@ variable "custom_s3_bucket" { } variable "create_secret" { - description = "Set to False In case you want to use SSM with your secret that contains coralogix private key" + description = "Set to False In case you want to use SM with your secret that contains coralogix private key" type = string default = "True" } \ No newline at end of file diff --git a/modules/s3/CHANGELOG.md b/modules/s3/CHANGELOG.md index 64e95f87..fea8a128 100644 --- a/modules/s3/CHANGELOG.md +++ b/modules/s3/CHANGELOG.md @@ -2,7 +2,10 @@ ## S3 -### 0.0.1 / 16.8.2023 +### 0.0.3 / 1.10.2023 +* [Change] Change SSM option in the integration to SM - Secret Manager. + +### 0.0.2 / 16.8.2023 * [Update] Add an option to use an existing secret instead of creating a new one with SSM, and remove ssm_enabled variable. ### 0.0.1 / 8.8.23 diff --git a/modules/s3/README.md b/modules/s3/README.md index ad74a692..ccc4fc4b 100644 --- a/modules/s3/README.md +++ b/modules/s3/README.md @@ -9,6 +9,9 @@ Manage the application which retrieves logs from `S3` bucket and sends them to y | [terraform](#requirement\_terraform) | >= 0.13.1 | | [aws](#requirement\_aws) | >= 2.23 | +### Note: +* in case you use SM(Secret Manager) you should first deploy the [SM lambda layer](https://serverlessrepo.aws.amazon.com/applications/eu-central-1/597078901540/Coralogix-Lambda-SSMLayer) + ## Providers | Name | Version | @@ -30,8 +33,8 @@ Manage the application which retrieves logs from `S3` bucket and sends them to y | [custom_url](#input\_custom\_domain) | Custom url for coralogix for example: https:///api/v1/logs| `string` | n/a | no | | [integration_type](#input\_data\_type) | which service will send the data to the s3, possible options are [`cloudtrail`, `vpc-flow-log`, `s3`, `s3-sns`, `cloudtrail-sns`] | `string` | n/a | yes | | [sns_topic_name](#input\_sns\_topic\_name) | The SNS topic that will contain the SNS subscription, need only if you use the sns interations | `string` | | no | -| [layer_arn](#input\_layer\_arn) | In case you are using SSM This is the ARN of the Coralogix Security Layer. | `string` | n/a | no | -| [create_secret](#input\_create\_secret) | Set to False In case you want to use SSM with your secret that contains coralogix Private Key| `string` | True | no | +| [layer_arn](#input\_layer\_arn) | In case you want to use SM This is the ARN of the Coralogix [Security Layer](https://serverlessrepo.aws.amazon.com/applications/eu-central-1/597078901540/Coralogix-Lambda-SSMLayer). | `string` | n/a | no | +| [create_secret](#input\_create\_secret) | Set to False In case you want to use SM option with your secret that contains coralogix Private Key| `string` | True | no | | [private\_key](#input\_private\_key) | Your Coralogix secret key or incase you use your own created secret put here the name of your secret that contains the coralogix Private Key| `string` | n/a | yes | | [application\_name](#input\_application\_name) | The name of your application | `string` | n/a | yes | | [subsystem\_name](#input\_subsystem\_name) | The subsystem name of your application | `string` | n/a | yes | diff --git a/modules/s3/main.tf b/modules/s3/main.tf index f57d3e70..c6fbf720 100644 --- a/modules/s3/main.tf +++ b/modules/s3/main.tf @@ -109,7 +109,7 @@ module "lambda" { tags = merge(var.tags, module.locals.tags) } -module "lambdaSSM" { +module "lambdaSM" { source = "terraform-aws-modules/lambda/aws" create = var.layer_arn != "" ? true : false depends_on = [ null_resource.s3_bucket_copy ] @@ -178,7 +178,7 @@ resource "aws_s3_bucket_notification" "lambda_notification" { count = local.sns_enable == false ? 1 : 0 bucket = data.aws_s3_bucket.this.bucket lambda_function { - lambda_function_arn = var.layer_arn != "" ? module.lambdaSSM.lambda_function_arn : module.lambda.lambda_function_arn + lambda_function_arn = var.layer_arn != "" ? module.lambdaSM.lambda_function_arn : module.lambda.lambda_function_arn events = ["s3:ObjectCreated:*"] filter_prefix = var.integration_type == "s3" || var.s3_key_prefix != null ? var.s3_key_prefix : "AWSLogs/${data.aws_caller_identity.this.account_id}/${lookup(module.locals.s3_prefix_map, var.integration_type)}/" filter_suffix = var.integration_type == "s3" || var.s3_key_suffix != null ? var.s3_key_suffix : lookup(module.locals.s3_suffix_map, var.integration_type) @@ -204,7 +204,7 @@ resource "aws_sns_topic" "this" { resource "aws_secretsmanager_secret" "private_key_secret" { count = var.layer_arn != "" && var.create_secret == "True" ? 1 : 0 - depends_on = [module.lambdaSSM] + depends_on = [module.lambdaSM] name = "lambda/coralogix/${data.aws_region.this.name}/${module.locals.function_name}" description = "Coralogix Send Your Data key Secret" } @@ -240,8 +240,8 @@ resource "aws_sns_topic_policy" "test" { resource "aws_sns_topic_subscription" "lambda_sns_subscription" { count = local.sns_enable ? 1 : 0 - depends_on = [module.lambdaSSM, module.lambda] + depends_on = [module.lambdaSM, module.lambda] topic_arn = data.aws_sns_topic.sns_topic[count.index].arn protocol = "lambda" - endpoint = var.layer_arn != "" ? module.lambdaSSM.lambda_function_arn : module.lambda.lambda_function_arn + endpoint = var.layer_arn != "" ? module.lambdaSM.lambda_function_arn : module.lambda.lambda_function_arn } diff --git a/modules/s3/variables.tf b/modules/s3/variables.tf index 783f025a..cba213ba 100644 --- a/modules/s3/variables.tf +++ b/modules/s3/variables.tf @@ -20,7 +20,7 @@ variable "private_key" { } variable "layer_arn" { - description = " In case you are using SSM This is the ARN of the Coralogix Security Layer." + description = " In case you are using SM This is the ARN of the Coralogix Security Layer." type = string default = "" } @@ -134,7 +134,7 @@ variable "custom_s3_bucket" { } variable "create_secret" { - description = "Set to False In case you want to use SSM with your secret that contains coralogix private key" + description = "Set to False In case you want to use SM with your secret that contains coralogix private key" type = string default = "True" } \ No newline at end of file