<p>I just needed to set</p>

<p>publish = true</p>

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

CC BY-SA 4.0
2019-10-14T10:25:53.497Z
2019-10-14T10:25:53.497Z
doug
<p>I'm Running Terraform v0.11.14</p>
<pre><code>resource &quot;aws_lambda_function&quot; &quot;test_lambda&quot; {
  filename         = &quot;lambda_function.zip&quot;
  function_name    = &quot;test_lambda&quot;
  role             = &quot;${aws_iam_role.iam_for_lambda_tf.arn}&quot;
  handler          = &quot;index.handler&quot;
  source_code_hash = &quot;${data.archive_file.lambda_zip.output_base64sha256}&quot;
  runtime          = &quot;python2.7&quot;
  version          = &quot;1&quot;
}
</code></pre>
<p>On plan I get the error</p>
<pre><code>Error: aws_lambda_function.test_lambda: &quot;version&quot;: this field cannot be set
</code></pre>
<p>I couldn't find an aws_lambda_function_version resorce so presume you create versions using the lambda fuction resorce and specifying the version.</p>
<p>I'm not sure what value I give to version to build versions of my lambda.</p>
<p>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?</p>

<aws-lambda><versioning>
How do I create separate versions of lambda functions through terraform?
doug
# How do I create separate versions of lambda functions through terraform?

(Asked by: username_0 on 2019-10-14)

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?

**Tags:** aws-lambda, versioning


---

## 1 answers

### Answer by username_0 on 2019-10-14. Score: 1

I just needed to set

publish = true

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


---

