resource "aws_lambda_function" "test_lambda" {
filename = "output/welcome.zip"
function_name = "welcome.zip"
role = "arn:aws:iam::590462871086:role/DataDev_Lambda_Test"
handler = "welcome.hello"
memory_size = 128
publish = false
// timeout = "3"
runtime = "python3.7"
// vpc_config {
// # Every subnet should be able to reach an EFS mount target in the same Availability Zone. Cross-AZ mounts are not permitted.
// subnet_ids = [aws_subnet.subnet_for_lambda.id]
// security_group_ids = [aws_security_group.sg_for_lambda.id]
// }
environment {
variables = {
foo = "bar"
}
}
}
PLAN:
C:\Users\rsalve\lambda>terraform plan -out terraform
Refreshing Terraform state in-memory prior to plan...
The refreshed state will be used to calculate this plan, but will not be
persisted to local or remote state storage.
data.archive_file.welcome: Refreshing state... [id=0fff74cb17aa1834db069385d80dc4dc45d2b518]
------------------------------------------------------------------------
An execution plan has been generated and is shown below.
Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# aws_lambda_function.test_lambda will be created
+ resource "aws_lambda_function" "test_lambda" {
+ arn = (known after apply)
+ filename = "output/welcome.zip"
+ function_name = "welcome.zip"
+ handler = "welcome.hello"
+ id = (known after apply)
+ invoke_arn = (known after apply)
+ last_modified = (known after apply)
+ memory_size = 128
+ publish = false
+ qualified_arn = (known after apply)
+ reserved_concurrent_executions = -1
+ role = "arn:aws:iam::590462871086:role/DataDev_Lambda_Test"
+ runtime = "python3.7"
+ source_code_hash = (known after apply)
+ source_code_size = (known after apply)
+ timeout = 3
+ version = (known after apply)
+ environment {
+ variables = {
+ "foo" = "bar"
}
}
+ tracing_config {
+ mode = (known after apply)
}
}
Plan: 1 to add, 0 to change, 0 to destroy.
C:\Users\rsalve\lambda>terraform version
Terraform v0.13.2
+ provider registry.terraform.io/-/archive v1.3.0
+ provider registry.terraform.io/hashicorp/archive v1.3.0
+ provider registry.terraform.io/hashicorp/aws v3.5.0
Guide me (Role ARN is copied from console itself don’t know where I am doing wrong)