Skip to content
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

Creating Lambda function with container #647

Open
praveenkrsha opened this issue Dec 3, 2024 · 1 comment
Open

Creating Lambda function with container #647

praveenkrsha opened this issue Dec 3, 2024 · 1 comment

Comments

@praveenkrsha
Copy link

Versions

  • Module version [Required]:

  • Terraform version:
    7.15.0

  • Provider version(s):
    5.70.0

Expected behavior

module "lambda" {
for_each = var.lambda_configs

source = "terraform-aws-modules/lambda/aws"
version = "7.14.0"

function_name = each.key
package_type = "Image"
image_uri = local.image_uris[each.key]

memory_size = each.value.memory_size
timeout = each.value.timeout

Automatically create IAM role for Lambda function

role_name = data.aws_iam_role.lambda_exec_role.name

}

Actual behavior

│ Error: External Program Execution Failed

│ with module.lambda["swat-terra-create-function-pks"].data.external.archive_prepare[0],
│ on .terraform/modules/lambda/package.tf line 10, in data "external" "archive_prepare":
│ 10: program = [local.python, "${path.module}/package.py", "prepare"]

│ The data source received an unexpected error while attempting to execute
│ the program.

│ Program: /usr/bin/python3
│ Error Message: Could not locate source_path "null". Paths are relative to
│ directory where terraform plan is being run
│ ("/builds/swisscom/servicenow/iaws_iac/swisscom-terraform/perm-infra/modules/lambda")

│ State: exit status 1


│ Error: External Program Execution Failed

│ with module.lambda["swat-terra-create-test-function-pks"].data.external.archive_prepare[0],
│ on .terraform/modules/lambda/package.tf line 10, in data "external" "archive_prepare":
│ 10: program = [local.python, "${path.module}/package.py", "prepare"]

│ The data source received an unexpected error while attempting to execute
│ the program.

│ Program: /usr/bin/python3
│ Error Message: Could not locate source_path "null". Paths are relative to
│ directory where terraform plan is being run
│ ("/builds/swisscom/servicenow/iaws_iac/swisscom-terraform/perm-infra/modules/lambda")

│ State: exit status 1

Cleaning up project directory and file based variables
00:01
ERROR: Job failed: command terminated with exit code 1

Terminal Output Screenshot(s)

│ Error: External Program Execution Failed

│ with module.lambda["swat-terra-create-function-pks"].data.external.archive_prepare[0],
│ on .terraform/modules/lambda/package.tf line 10, in data "external" "archive_prepare":
│ 10: program = [local.python, "${path.module}/package.py", "prepare"]

│ The data source received an unexpected error while attempting to execute
│ the program.

│ Program: /usr/bin/python3
│ Error Message: Could not locate source_path "null". Paths are relative to
│ directory where terraform plan is being run
│ ("/builds/example/example/iaws_iac/example-terraform/perm-infra/modules/lambda")

│ State: exit status 1


│ Error: External Program Execution Failed

│ with module.lambda["swat-terra-create-test-function-pks"].data.external.archive_prepare[0],
│ on .terraform/modules/lambda/package.tf line 10, in data "external" "archive_prepare":
│ 10: program = [local.python, "${path.module}/package.py", "prepare"]

│ The data source received an unexpected error while attempting to execute
│ the program.

│ Program: /usr/bin/python3
│ Error Message: Could not locate source_path "null". Paths are relative to
│ directory where terraform plan is being run
│ ("/builds/example/example/iaws_iac/example-terraform/perm-infra/modules/lambda")

│ State: exit status 1

Cleaning up project directory and file based variables
00:01
ERROR: Job failed: command terminated with exit code 1

Additional context

@mulvaney
Copy link

mulvaney commented Dec 4, 2024

Try adding create_package = false so it skips creating the package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants