# Error updating AWS Lambda Configuration in pipeline

**URL:** <https://discuss.circleci.com/t/error-updating-aws-lambda-configuration-in-pipeline/38553>\
**Category:** Deployments\
**Created:** [December 18, 2020, 12:35am UTC](https://discuss.circleci.com/t/error-updating-aws-lambda-configuration-in-pipeline/38553 "2020-12-18T00:35:32Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![phil.carter](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@phil.carter](https://discuss.circleci.com/u/phil.carter)\
**Post date:** [December 18, 2020, 12:35am UTC](https://discuss.circleci.com/t/error-updating-aws-lambda-configuration-in-pipeline/38553/1 "2020-12-18T00:35:32Z")

</div>

Hi All

We’re receiving an error when trying to update the configuration of an AWS Lambda function.

The yaml config looks like this

```
version: 2.1

orbs:
  aws-cli: circleci/aws-cli@1.3.0
  aws-s3: circleci/aws-s3@2.0.0
  win: circleci/windows@2.2.0

jobs:
  build_and_package:
	executor: win/default
...
  upload_package:
	resource_class: small
	executor: aws-cli/default     
...
  publish_test:
	resource_class: small
	executor: aws-cli/default     
...
	  - run:
		  name: update_test_config
		  command: |
			NEW_REVISION_ID=$(aws lambda update-function-configuration \
			  --function-name << parameters.function_name >> \
			  --vpc-config SubnetIds=<< parameters.test_subnets >>,SecurityGroupIds=<< parameters.test_sec_groups >> \
			  --environment Variables={variable1=value1,variable2=value2,variable3=value3,variable4=value4,variable5=value5,variable6=value6,variable7=value7} \
			  --revision-id $REVISION_ID \
			  --output text \
			  --query '[RevisionId]')

```

The error output we’re seeing is,

```
#!/bin/bash -eo pipefail
aws lambda update-function-configuration \
  --function-name MyFunction \
  --vpc-config SubnetIds=subnet-1,subnet-2,SecurityGroupIds=sg-1,sg-2 \
  --environment Variables={variable1=value1,variable2=value2,variable3=value3,variable4=value4,variable5=value5,variable6=value6,variable7=value7} \
  --revision-id $REVISION_ID

usage: aws [options] <command> <subcommand> [<subcommand> ...] [parameters]
To see help text, you can run:

  aws help
  aws <command> help
  aws <command> <subcommand> help

Unknown options: Variables=variable2=value2, variable3=value3, variable4=value4, variable5=value5, variable6=value6, variable7=value7

Exited with code exit status 252
CircleCI received exit code 252

```

We’ve shuffled the variable order around, but it only seems to accept the first one, then lists the others as Unknown options.

This is the AWS CLI documentation for updating the Lambda configuration  
[https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/update-function-configuration.html](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/lambda/update-function-configuration.html)

Hope someone is able to provide an insight as to what’s needed.

Cheers  
Phil

---

<div class="post-metadata">

**Author:** ![phil.carter](https://avatars.discourse-cdn.com/v4/letter/p/9f8e36/32.png) [@phil.carter](https://discuss.circleci.com/u/phil.carter)\
**Post date:** [December 23, 2020, 11:16pm UTC](https://discuss.circleci.com/t/error-updating-aws-lambda-configuration-in-pipeline/38553/2 "2020-12-23T23:16:44Z")

</div>

Hi All

Just closing this off as resolved. We ended up putting the variables in JSON format as per below

` --environment '{ "Variables": {"variable1": "value1","variable2": "value2","variable3": "value3","variable4": "value4","variable5": "value5","variable6": "value6","variable7": "value7"}}' \`

Cheers  
Phil

---

<div class="post-metadata">

**Author:** ![thekatertot](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/thekatertot/32/25169_2.png) [@thekatertot](https://discuss.circleci.com/u/thekatertot)\
**Post date:** [December 24, 2020, 12:01am UTC](https://discuss.circleci.com/t/error-updating-aws-lambda-configuration-in-pipeline/38553/3 "2020-12-24T00:01:03Z")

</div>

Thank you for updating, @phil.carter! Providing a solution for future folks is awesome.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [January 3, 2021, 12:01am UTC](https://discuss.circleci.com/t/error-updating-aws-lambda-configuration-in-pipeline/38553/4 "2021-01-03T00:01:23Z")

</div>

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
