Skip to content

Commit

Permalink
Change EnvironmentVariables to Environment
Browse files Browse the repository at this point in the history
To set an environment variable for a Lambda funciton through
CloudFormation the Environment key is needed rather than
EnvironmentVariables.
  • Loading branch information
stealthycoin committed Apr 12, 2018
1 parent 0335862 commit bb9543d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion chalice/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def _generate_lambdafunction(self, resource, template):
},
}
if resource.environment_variables:
resources[cfn_name]['Properties']['EnvironmentVariables'] = {
resources[cfn_name]['Properties']['Environment'] = {
'Variables': resource.environment_variables
}
self._add_iam_role(resource, resources[cfn_name])
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/test_package.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def test_adds_env_vars_when_provided(self, sample_app):
function.environment_variables = {'foo': 'bar'}
template = self.template_gen.generate_sam_template([function])
cfn_resource = list(template['Resources'].values())[0]
assert cfn_resource['Properties']['EnvironmentVariables'] == {
assert cfn_resource['Properties']['Environment'] == {
'Variables': {
'foo': 'bar'
}
Expand Down

0 comments on commit bb9543d

Please sign in to comment.