Skip to main content
https://travis-ci.org/ImmobilienScout24/pybuilder_aws_plugin.svg?branch=master https://coveralls.io/repos/ImmobilienScout24/pybuilder_aws_plugin/badge.svg?branch=master&service=github https://badge.fury.io/py/pybuilder_aws_plugin.svg

pybuilder_aws_plugin

PyBuilder plugin to handle AWS functionality.

How to use the Plugin

Add plugin dependency to your build.py:

use_plugin('pypi:pybuilder_aws_plugin')

After this you have the following additional tasks, which are explained below.

@Task: package_lambda_code

This task assembles the zip file which will be uploaded to S3 with the second task. What is this task doing in detail?

Package all own modules

All modules which are found in src/main/python/ where put directly into the temporary folder, which will zipped later.

Package all dependencies

Every entry in build.py with depends_on is installed into the zip file. The target path for pip install points directly to the temporary folder, which will then be zipped.

Package all script files

The content in the scripts folder (src/main/scripts) of an pybuilder project is normally intended to go to /usr/bin. This plugin sees this folder as a folder with script(s) including lambda handler functions. Therefore all files under this folder are put at the root layer (/) of the zip file.

@Task: upload_zip_to_s3

This task uploads the generated zip to a S3 bucket. The bucket name is to be set as follows in build.py:

project.set_property('bucket_name', 'my_lambda_bucket')

The default acl for zips to be uploaded is bucket-owner-full-control. But if you need another acl you can overwrite this as follows in build.py:

project.set_property('lambda_file_access_control', '<wished_acl>')

Possible acl values are:

  • private

  • public-read

  • public-read-write

  • authenticated-read

  • bucket-owner-read

  • bucket-owner-full-control

Further the plugin assumes that you already have a shell with enabled aws access (exported keys or .boto or …). For that take a look at e.g. afp-cli

The uploaded files will be placed in a directory with the version number, and in a latest/ directory, such as:

  • v123/projectname.zip

  • latest/projectname.zip

You can use the property bucket_prefix to add a prefix to the uploaded files. For example:

project.set_property('bucket_prefix', 'my_lambda/')

This will upload the files to the following files:

  • my_lambda/v123/projectname.zip

  • my_lambda/latest/projectname.zip

In an TeamCity Environment (teamcity_output = True) you can use the property teamcity_parameter to push en ##teamcity[setParameter name='' value=''] event to TeamCity and rewrite this parameter with the name of the uploaded zip file. For example:

project.set_property('teamcity_parameter', 'my_tc_parameter')

@Task: upload_cfn_to_s3

This task uploads the CFN-Sphere template files as JSON to a S3 bucket. The bucket name is to be set as follows in build.py:

project.set_property('bucket_name', 'my_lambda_bucket')

The default acl for JSON files to be uploaded is bucket-owner-full-control. But if you need another acl you can overwrite this as follows in build.py:

project.set_property('template_file_access_control', '<wished_acl>')

To define the templates you wish to be uploaded set the property as a list of tupels:

project.set_property('template_files',
    [
        ('path1','filename1'),
        ('path2','filename2'),
        ...
    ])

The uploaded files will be placed in a directory with the version number, and in a latest/ directory, such as:

  • v123/filename1.json

  • v123/filename2.json

  • latest/filename1.json

  • latest/filename2.json

You can use the property template_key_prefix to add a prefix to the uploaded files. For example:

project.set_property('template_key_prefix', 'my_lambda/')

This will upload the files to the following files:

  • my_lambda/v123/filename1.json

  • my_lambda/v123/filename2.json

  • my_lambda/latest/filename1.json

  • my_lambda/latest/filename2.json

NOTE: This task is available for Python 2.7 and up.

Licence

Copyright 2015 Immobilienscout24 GmbH

Licensed under the Apache License, Version 2.0 (the “License”); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Release files for pybuilder_aws_plugin 117

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pybuilder_aws_plugin 117
File Size Uploaded
pybuilder_aws_plugin-117.tar.gz 5.1 kB Details

Release files / pybuilder_aws_plugin-117.tar.gz

Download URL pybuilder_aws_plugin-117.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
fd1a774e8cb74e7d6ac60e4eb1e48a1c8939afca30e86687eaa5a651c78b4c64
BLAKE2b-256 checksum
How to use checksums
6b6b1b12a54156d1ff19c11663bf9a3cd2df73f275d4a26314e4de7bf470a59b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

183

1 release file

181

1 release file

176

1 release file

173

1 release file

172

1 release file

170

1 release file

161

1 release file

158

1 release file

157

1 release file

156

1 release file

155

1 release file

154

1 release file

151

1 release file

148

1 release file

144

1 release file

129

1 release file

121

1 release file

120

1 release file

119

1 release file

118

1 release file

This release

117 This release

1 release file

116

1 release file

115

1 release file

1

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page