1

I'm Running Terraform v0.11.14

resource "aws_lambda_function" "test_lambda" { filename = "lambda_function.zip" function_name = "test_lambda" role = "${aws_iam_role.iam_for_lambda_tf.arn}" handler = "index.handler" source_code_hash = "${data.archive_file.lambda_zip.output_base64sha256}" runtime = "python2.7" version = "1" }

On plan I get the error Error: aws_lambda_function.test_lambda: "version": this field cannot be set

I couldn't find an aws_lambda_function_version resorce so presume you create versions using the lambda fuction resorce and specifying the version.

I'm not sure what value I give to version to build versions of my lambda.

Im tring to get it to work for one version for now as a first step. I plan on adding count to create multiple versions as my next step if I can get it to create one version first?

1

I just needed to set

publish = true

I then enconter another issue for creating seprat versions but finding this answers my initial question

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.