Skip to main content

pypyr aws plug-in

pypyr task runner for automation pipelines

Run anything on aws. No really, anything! If the aws api supports it, the pypyr aws plug-in supports it.

It's a pretty easy way of invoking the aws api as a step in a series of steps without having to write code.

pypyr is a cli & api to run pipelines defined in yaml.

All documentation for the pypyr aws plugin is here: https://pypyr.io/docs/plugins/aws/

Why use this when you could just use the aws-cli instead? The aws cli is all kinds of awesome, but I find more often than not it's not just one or two aws ad hoc cli or aws api methods you have to execute, but especially when automating and scripting you actually need to run a sequence of commands, where the output of a previous command influences what you pass to the next command.

Sure, you can bash it up, and I do that too, but running it as a pipeline via pypyr has actually made my life quite a bit easier because of not having to deal with conditionals, error traps and input validation.

build status coverage statuspypi version apache 2.0 license

installation

$ pip install --upgrade pypyraws

pypyraws depends on the pypyr core. The above pip will install it for you if you don't have it already.

usage

Here is some sample yaml of what a pipeline using the pypyr-aws plug-in to upload a file to s3 would look like:

context_parser: pypyr.parser.keyvaluepairs
steps:
  - name: pypyraws.steps.client
    description: upload a file to s3
    in:
      awsClientIn:
        serviceName: s3
        methodName: upload_file
        methodArgs:
          Filename: ./testfiles/arb.txt
          Bucket: '{bucket}'
          Key: arb.txt

If you saved this yaml as ./pipelines/go-go-s3.yaml, you can run it like this to upload arb.txt to your specified bucket:

$ pypyr go-go-s3 bucket=myuniquebucketname

custom waiters

But wait, there's more! You can make a custom waiter for any aws client operation and wait for a specified field in the response to become the value you want it to be.

This is especially handy for things like Beanstalk, because Elastic Beanstalk does not have Waiters for environment creation.

The input context looks like this:

awsWaitFor:
  awsClientIn: # required. awsClientIn allows the same arguments as pypyraws.steps.client.
    serviceName: elasticbeanstalk
    methodName: describe_environments
    methodArgs:
        ApplicationName: my wonderful beanstalk default application
        EnvironmentNames:
          - my-wonderful-environment
        VersionLabel: v0.1
  waitForField: '{Environments[0][Status]}' # required. format expression for field name to check in awsClient response
  toBe: Ready # required. Stop waiting when waitForField equals this value
  pollInterval: 30 # optional. Seconds to wait between polling attempts. Defaults to 30 if not specified.
  maxAttempts: 10 # optional. Defaults to 10 if not specified.
  errorOnWaitTimeout: True # optional. Defaults to True if not specified. Stop processing if maxAttempts exhausted without reaching toBe value.

Help!

Don't Panic! Check the pypyraws technical docs to begin. For help, community & talk, check pypyr twitter, or join the chat at the pypyr community discussion forum!

contribute

developers

For information on how to help with pypyr, run tests and coverage, please do check out the pypyr contribution guide.

bugs

Well, you know. No one's perfect. Feel free to create an issue.

License

pypyr is free & open-source software distributed under the Apache 2.0 License.

Please see LICENSE in the root of the repo.

Copyright 2017 the pypyr contributors.

Metadata

Release files for pypyraws 1.3.0

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

Source distribution (sdist)

Source distribution for pypyraws 1.3.0
File Size Uploaded
pypyraws-1.3.0.tar.gz 18.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pypyraws 1.3.0
File Interpreter ABI Platform
pypyraws-1.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 39.0 kB

Release files / pypyraws-1.3.0.tar.gz

Download URL pypyraws-1.3.0.tar.gz
Size 18.6 kB
Tags Source
SHA-256 checksum
How to use checksums
63647c48379835095cba9acf1e7b5eacbb260f2cb6f31dbfa62d42dade56aac5
BLAKE2b-256 checksum
How to use checksums
55d7fbbe1de3472ebe8f7b44d4449c410700b0e4081c2b68b568c8a56a68fa69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release files / pypyraws-1.3.0-py3-none-any.whl

Download URL pypyraws-1.3.0-py3-none-any.whl
Size 20.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
02ca66c4f4d63b08c7f2227717166876393269c38129cb2c5911ff3ca06983f7
BLAKE2b-256 checksum
How to use checksums
bcce86bdcd36574eae3bde9457b19ecb2ac546757813f65e50db8484bbfa5be0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

Release history Release notifications | RSS feed

This release

1.3.0 This release

2 release files

1.2.0

2 release files

1.1.2

2 release files

1.1.1

1 release file

1.1.0

1 release file

1.0.0

1 release file

0.1.1

1 release file

0.0.4

1 release file

0.0.3

1 release file

0.0.2

1 release file

0.0.1

1 release file

0.0.0

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