Skip to main content

CDK construct library for EC2 Spot

Project description

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.

Sample

# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
import cdk_ec2spot as ec2spot

# create a ec2spot provider
provider = ec2spot.Provider(stack, "Provider")

# import or create a vpc
vpc = provider.get_or_create_vpc(stack)

# create an AutoScalingGroup with Launch Template for spot instances
provider.create_auto_scaling_group("SpotASG",
    vpc=vpc,
    default_capacity_size=2,
    instance_type=ec2.InstanceType("m5.large")
)

EC2 Spot Fleet support

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

# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
provider.create_fleet("SpotFleet",
    vpc=vpc,
    default_capacity_size=2,
    instance_type=ec2.InstanceType("t3.large")
)

Single Spot Instnce

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

# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
provider.create_instance("SpotInstance", vpc=vpc)

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cdk-ec2spot-0.1.61.tar.gz (35.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cdk_ec2spot-0.1.61-py3-none-any.whl (34.7 kB view details)

Uploaded Python 3

File details

Details for the file cdk-ec2spot-0.1.61.tar.gz.

File metadata

  • Download URL: cdk-ec2spot-0.1.61.tar.gz
  • Upload date:
  • Size: 35.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.7.10

File hashes

Hashes for cdk-ec2spot-0.1.61.tar.gz
Algorithm Hash digest
SHA256 8a24dc508223cd02c979082464e0e6e208c60a20e9e09438ce9989ed444c010c
MD5 7f638a257ab1a09f2b24c3a9820a8b1e
BLAKE2b-256 9082eb0d7df8351f8ea57b72b0dbe76ec1e19bbbc8bf25b70dedda5c05119e8f

See more details on using hashes here.

File details

Details for the file cdk_ec2spot-0.1.61-py3-none-any.whl.

File metadata

  • Download URL: cdk_ec2spot-0.1.61-py3-none-any.whl
  • Upload date:
  • Size: 34.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.4 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.1 CPython/3.7.10

File hashes

Hashes for cdk_ec2spot-0.1.61-py3-none-any.whl
Algorithm Hash digest
SHA256 07aaae4bbedc71ddbe40e3f4a0ef9ccdb44bc93bc5b768797f19cbaf9a55bea3
MD5 b6809df9929fb8fc593e24ecc507e2f3
BLAKE2b-256 1fa1984a70957fb23afed442e4a85d84fd2e1daa98aa76b9adad8062c3623a22

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page