Skip to main content

NPM version PyPI version Release

cdk-ec2spot

CDK construct library that allows you to create EC2 Spot instances with AWS AutoScaling Group, Spot Fleet or just single Spot Instance.

Install

Use the npm dist tag to opt in CDKv1 or CDKv2:

// for CDKv2
npm install cdk-ec2spot
or
npm install cdk-ec2spot@latest

// for CDKv1
npm install cdk-ec2spot@cdkv1

Sample

import * as ec2spot from 'cdk-ec2spot';

// create a ec2spot provider
const provider = new ec2spot.Provider(stack, 'Provider');

// import or create a vpc
const vpc = provider.getOrCreateVpc(stack);

// create an AutoScalingGroup with Launch Template for spot instances
provider.createAutoScalingGroup('SpotASG', {
  vpc,
  defaultCapacitySize: 2,
  instanceType: new ec2.InstanceType('m5.large'),
});

EC2 Spot Fleet support

In addition to EC2 AutoScaling Group, you may use createFleet() to create an EC2 Spot Fleet:

provider.createFleet('SpotFleet', {
  vpc,
  defaultCapacitySize: 2,
  instanceType: new ec2.InstanceType('t3.large'),
});

Single Spot Instnce

If you just need single spot instance without any autoscaling group or spot fleet, use createInstance():

provider.createInstance('SpotInstance', { vpc })

Metadata

Release files for cdk-ec2spot 2.0.292

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

Source distribution (sdist)

Source distribution for cdk-ec2spot 2.0.292
File Size Uploaded Provenance Actions
cdk-ec2spot-2.0.292.tar.gz 41.3 kB Without provenance Details for cdk-ec2spot-2.0.292.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for cdk-ec2spot 2.0.292
File Interpreter ABI Platform Actions
cdk_ec2spot-2.0.292-py3-none-any.whl Python 3 none any Details for cdk_ec2spot-2.0.292-py3-none-any.whl

Total release size: 80.9 kB

Release files / cdk-ec2spot-2.0.292.tar.gz

Download URL cdk-ec2spot-2.0.292.tar.gz
Size 41.3 kB
Tags Source
SHA-256 checksum
How to use checksums
df497ed6d72192ffd8f26967fb1654c226c819631a8504d68697578604ca4335
BLAKE2b-256 checksum
How to use checksums
080ef5988e89de414cf1169fbdca0e8e2915500221b1586ee432f67c76b358dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release files / cdk_ec2spot-2.0.292-py3-none-any.whl

Download URL cdk_ec2spot-2.0.292-py3-none-any.whl
Size 39.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8ed7fc3b838f07f07e0714f241c05c3e39859d973e1683110d3fcf11662c7665
BLAKE2b-256 checksum
How to use checksums
7b47142137d0e0dc4a88f94e36d4ff10d06ccb98587208d23a878585741caf21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Security for cdk-ec2spot 2.0.292

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.

Release history Release notifications | RSS feed

This release

2.0.292 This release

2 release files No provenance

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