fixed issue in update_configuration for lambda when setting VPC config property (#3479)
This commit is contained in:
parent
7f73015f02
commit
83507fbc37
@ -305,7 +305,7 @@ class LambdaFunction(CloudFormationModel, DockerModel):
|
|||||||
elif key == "Timeout":
|
elif key == "Timeout":
|
||||||
self.timeout = value
|
self.timeout = value
|
||||||
elif key == "VpcConfig":
|
elif key == "VpcConfig":
|
||||||
self.vpc_config = value
|
self._vpc_config = value
|
||||||
elif key == "Environment":
|
elif key == "Environment":
|
||||||
self.environment_vars = value["Variables"]
|
self.environment_vars = value["Variables"]
|
||||||
|
|
||||||
|
@ -1536,6 +1536,7 @@ def test_update_configuration():
|
|||||||
Handler="lambda_function.new_lambda_handler",
|
Handler="lambda_function.new_lambda_handler",
|
||||||
Runtime="python3.6",
|
Runtime="python3.6",
|
||||||
Timeout=7,
|
Timeout=7,
|
||||||
|
VpcConfig={"SecurityGroupIds": ["sg-123abc"], "SubnetIds": ["subnet-123abc"]},
|
||||||
Environment={"Variables": {"test_environment": "test_value"}},
|
Environment={"Variables": {"test_environment": "test_value"}},
|
||||||
)
|
)
|
||||||
|
|
||||||
@ -1548,6 +1549,11 @@ def test_update_configuration():
|
|||||||
assert updated_config["Environment"]["Variables"] == {
|
assert updated_config["Environment"]["Variables"] == {
|
||||||
"test_environment": "test_value"
|
"test_environment": "test_value"
|
||||||
}
|
}
|
||||||
|
assert updated_config["VpcConfig"] == {
|
||||||
|
"SecurityGroupIds": ["sg-123abc"],
|
||||||
|
"SubnetIds": ["subnet-123abc"],
|
||||||
|
"VpcId": "vpc-123abc",
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@mock_lambda
|
@mock_lambda
|
||||||
|
Loading…
x
Reference in New Issue
Block a user