Wakeywakey!
Do you have a EC2 instance that you only need during certain hours of the day? Do you want to reduce it's cost? Are you using the @matthewbonig/nightynight construct to shut it down every night? Do you want to start it up in the morning?
That's the Wakeywakey construct. It's very simple. Give it an instanceId and it will create a Lambda and a CloudWatch Event Rule to fire the lambda at a specific time of day. If the instance is stopped, it is started.
This is a pre-release!
This is a quick first-draft. All the options that will likely need to be added to accomodate a large number of use-cases are still needed. If you'd like to make requests or help update this construct, please open an Issue or a PR.
What is creates
- A Rule that will, on a given schedule, fire a lambda.
- A Lambda with permissions to describe ec2 instances. It will read the instance by the given
instanceIdand then start the instance if it's in a stopped state.
Example:
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
class WakeyWakeyStack(Stack):
def __init__(self, scope, id, props):
super().__init__(scope, id, props)
# The code that defines your stack goes here
WakeyWakey(self, "wakeywakey", instance_id="i-123123123123")
This will start the instance with id i-123123123123 at (the default) 4am GMT.
Contributing
Please open Pull Requests and Issues on the Github Repo.
License
MIT
Metadata
Release files for mbonig.wakeywakey 1.89.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| mbonig.wakeywakey-1.89.2.tar.gz | 48.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| mbonig.wakeywakey-1.89.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 96.4 kB
Release files / mbonig.wakeywakey-1.89.2.tar.gz
| Download URL | mbonig.wakeywakey-1.89.2.tar.gz |
|---|---|
| Size | 48.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3b2525a7ef7885a9d489a08f9ea8cdb4e5baee2bc155dfc717097fd4125645ee
|
|
BLAKE2b-256 checksum How to use checksums |
103c4dda6cea215a15ba3b6c4c064cb37375a5736cc115b47f2cdd1c9b796c25
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5
|
Release files / mbonig.wakeywakey-1.89.2-py3-none-any.whl
| Download URL | mbonig.wakeywakey-1.89.2-py3-none-any.whl |
|---|---|
| Size | 47.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
43cc2a8cd1d344a07209556381667ff078a33956660c9e9b6c1099cca3ed29cd
|
|
BLAKE2b-256 checksum How to use checksums |
71645044a45d4fff458064660f36aa889d1f2aba734c28505459b14af62173ec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5
|
Security for mbonig.wakeywakey 1.89.2
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.