Hello All,
I am database developer who has recently started working on cloud technologies and started using terraform deployment via jenkins.
I am trying to create lambda function and I am getting below error
Error applying plan: 1 error occurred: *** module.lambda_OracleConnection.aws_lambda_function.lambda_with_filename: 1 error occurred:* *** aws_lambda_function.lambda_with_filename: Error creating Lambda function: ValidationException:** *status code: 400, request id: f5629e72-6702-419f-a464-dd66051c2846
filename = “${element(concat(coalescelist(data.archive_file.packager.*.output_path, list(var.filename)), list(”")), 0)}"
I have not defined file name anywhere , I am not getting from where it is trying to pick this up
If you will check my module is referring some git repo , in that git repo some logic is defined
If you will check my module is referring some git repo
module "lambda_OracleConnection" {
source = "git::ssh://XXX@git.XXX.com:XXXX/awstf/lambda?ref=**feature/consolidate-lambda-modules**"
filename = "${var.filename}"
function_name = "${var.OracleConnection_function_name}"
handler = "${var.OracleConnection_lambda_handler}"
layers = "${var.layers}"
create_role ="${var.create_role}"
role = "${var.role}"
subnet_ids = "${var.subnet_ids}"
environment_vars = ["${var.environment_vars}"]
description = "${var.description}"
publish = "${var.publish}"
security_group_ids= ["${aws_security_group.firmographic_lambda_sg2.id}"]
kms_key_arn = "${var.kms_key_arn}"
runtime = "${var.runtime}"
timeout = "${var.OracleConnection_timeout}"
memory_size ="${var.OracleConnection_memory_size}"
dead_letter_config ="${var.dead_letter_config}"
# Packaging Variables
git_project = "${var.OracleConnection_git_project}"
git_repo = "${var.OracleConnection_git_repo}"
git_ref = "${var.OracleConnection_git_ref}"
builder_path = "${var.OracleConnection_builder_path}"
builder_parameters = "${var.OracleConnection_builder_params}"
builder_output_path = "${var.OracleConnection_builder_output_path}"
executeBuilder = "${var.OracleConnection_execute_builder}"
# XXXXXXX Required Tags
application = "${var.application}"
app_component = "${var.app_component}"
app_contacts = "${var.app_contacts}"
app_environment = "${var.app_environment}"
business_unit = "${var.business_unit}"
created_by = "${var.created_by}"
function = "${var.function}"
network_environment = "${var.network_environment}"
region = "${var.region}"
system_risk_class = "${var.system_risk_class}"
}
resource "aws_security_group" "firmographic_lambda_sg2" {
name = "${var.application}-2security-group-${var.app_environment}"
description = "AMI Lambda Security Group (Managed by Terraform)"
vpc_id = "${module.data-utils.vpc_id}"
tags = "${merge(map("Name", format("%s-2security-group-%s", var.application, var.app_environment)), var.tags_additional)}"
ingress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["X.xX.X/X"]
}
egress {
from_port = 0
to_port = 0
protocol = "-1"
cidr_blocks = ["X.X.X.X/X"]
}
}
Plan is generated as follows
arn: "" => "<computed>"
description: "" => "Managed by Terraform"
filename: "" => "/home/centos/workspace/da-lambda-terraform-template/terraform/.terraform/modules/XXXXXXXXXXXXXXXXXX/OracleConnection.zip"
function_name: "" => "OracleConnection"
handler: "" => "ConnectOracle.lambda_handler"
invoke_arn: "" => "<computed>"
last_modified: "" => "<computed>"
layers.#: "" => "1"
layers.0: "" => "arn:aws:lambda:AA-AAAA-1:XXXXXXXXXXXXX:layer:Oracle_Instant_Client_12_2:1"
memory_size: "" => "128"
publish: "" => "false"
qualified_arn: "" => "<computed>"
reserved_concurrent_executions: "" => "-1"
runtime: "" => "python3.8"
source_code_hash: "" => "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
source_code_size: "" => "<computed>"
tags.%: "" => "11"
tags.Name: "" => "firmographic-sandbox-lambda-oracleconnection"
tags.app_component: "" => "lambda"
tags.app_contacts: "" => "dlmdmdevs"
tags.app_environment: "" => "sandbox"
tags.application: "" => "firmographic"
tags.business_unit: "" => "da"
tags.created_by: "" => "purnima.bhatia@XXXXX.COM"
tags.function: "" => "automation"
tags.network_environment: "" => "sandbox"
tags.region: "" => "AA-XXXX-1"
tags.system_risk_class: "" => "3"
timeout: "" => "300"
tracing_config.#: "" => "1"
tracing_config.0.mode: "" => "PassThrough"
version: "" => "<computed>"
vpc_config.#: "" => "1"
vpc_config.0.security_group_ids.#: "" => "1"
vpc_config.0.security_group_ids.11111111111: "" => "sg-02dhgfdjkhgjkfdhgjkf"
vpc_config.0.subnet_ids.#: "" => "2"
vpc_config.0.subnet_ids.444: "" => "subnet-ngklfdnglkfdjkgl"
vpc_config.0.subnet_ids.44444: "" => "subnet-ngldfnglkfkg"
vpc_config.0.vpc_id: "" => "<computed>"