fixed issue in update_configuration for lambda when setting VPC config property (#3479)

This commit is contained in:
Oide Brett 2020-11-18 08:45:31 +00:00 committed by GitHub
parent 7f73015f02
commit 83507fbc37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -305,7 +305,7 @@ class LambdaFunction(CloudFormationModel, DockerModel):
elif key == "Timeout":
self.timeout = value
elif key == "VpcConfig":
self.vpc_config = value
self._vpc_config = value
elif key == "Environment":
self.environment_vars = value["Variables"]

View File

@ -1536,6 +1536,7 @@ def test_update_configuration():
Handler="lambda_function.new_lambda_handler",
Runtime="python3.6",
Timeout=7,
VpcConfig={"SecurityGroupIds": ["sg-123abc"], "SubnetIds": ["subnet-123abc"]},
Environment={"Variables": {"test_environment": "test_value"}},
)
@ -1548,6 +1549,11 @@ def test_update_configuration():
assert updated_config["Environment"]["Variables"] == {
"test_environment": "test_value"
}
assert updated_config["VpcConfig"] == {
"SecurityGroupIds": ["sg-123abc"],
"SubnetIds": ["subnet-123abc"],
"VpcId": "vpc-123abc",
}
@mock_lambda