Skip to content

Conversation

@asaolabs
Copy link
Contributor

Python 3.6 Support (Local Environment)
Building and deploying lambda functions wasn't working with python3.6. The issue was that the default encoding for files is UTF-8 and we're opening up the zip files to create or update a function. We were getting the following error in the read() method in the helper module.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../python3.6/codecs.py", line 321, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xe5 in position 12: invalid continuation byte

I added an optional parameter to the helper.py read() call that defines whether the file is binary or not. This allows us to read the zip file during deployment.

To assist users that are using the python3.6 runtime, I also added the default "runtime" value to the config.yaml file (making it more obvious where the configuration for the runtime is)

"Secret" Environment Variable Values
To match our best practices of not including "secrets" in any files checked into our code repository, I added the ability to load environment variable values from the local environment instead of having them hard-coded in the config file. This is just a change in the way the value is defined. Environment values can be set using the following syntax (see env3) and the values are read at deploy time.

environment_variables:
  env_1: foo
  env_2: baz
  env3: ${LOCAL_ENVIRONMENT_VARIABLE_NAME}

Copy link
Owner

@nficano nficano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👏 👏 👏 👏

@nficano nficano merged commit 38d43ad into nficano:master Jul 12, 2017
@jmeekhof
Copy link
Collaborator

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants