cdk-ec2spot


Namecdk-ec2spot JSON
Version 2.0.292 PyPI version JSON
download
home_pagehttps://github.com/pahud/cdk-ec2spot.git
SummaryCDK construct library for EC2 Spot
upload_time2023-03-21 00:17:59
maintainer
docs_urlNone
authorPahud Hsieh<pahudnet@gmail.com>
requires_python~=3.7
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![NPM version](https://badge.fury.io/js/cdk-ec2spot.svg)](https://badge.fury.io/js/cdk-ec2spot)
[![PyPI version](https://badge.fury.io/py/cdk-ec2spot.svg)](https://badge.fury.io/py/cdk-ec2spot)
![Release](https://github.com/pahud/cdk-ec2spot/workflows/Release/badge.svg)

# `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:

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

// for CDKv1
npm install cdk-ec2spot@cdkv1
```

# Sample

```python
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:

```python
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()`:

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

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/pahud/cdk-ec2spot.git",
    "name": "cdk-ec2spot",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "~=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "Pahud Hsieh<pahudnet@gmail.com>",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/08/0e/f5988e89de414cf1169fbdca0e8e2915500221b1586ee432f67c76b358dc/cdk-ec2spot-2.0.292.tar.gz",
    "platform": null,
    "description": "[![NPM version](https://badge.fury.io/js/cdk-ec2spot.svg)](https://badge.fury.io/js/cdk-ec2spot)\n[![PyPI version](https://badge.fury.io/py/cdk-ec2spot.svg)](https://badge.fury.io/py/cdk-ec2spot)\n![Release](https://github.com/pahud/cdk-ec2spot/workflows/Release/badge.svg)\n\n# `cdk-ec2spot`\n\nCDK construct library that allows you to create EC2 Spot instances with `AWS AutoScaling Group`, `Spot Fleet` or just single `Spot Instance`.\n\n# Install\n\nUse the npm dist tag to opt in CDKv1 or CDKv2:\n\n```sh\n// for CDKv2\nnpm install cdk-ec2spot\nor\nnpm install cdk-ec2spot@latest\n\n// for CDKv1\nnpm install cdk-ec2spot@cdkv1\n```\n\n# Sample\n\n```python\nimport * as ec2spot from 'cdk-ec2spot';\n\n// create a ec2spot provider\nconst provider = new ec2spot.Provider(stack, 'Provider');\n\n// import or create a vpc\nconst vpc = provider.getOrCreateVpc(stack);\n\n// create an AutoScalingGroup with Launch Template for spot instances\nprovider.createAutoScalingGroup('SpotASG', {\n  vpc,\n  defaultCapacitySize: 2,\n  instanceType: new ec2.InstanceType('m5.large'),\n});\n```\n\n# EC2 Spot Fleet support\n\nIn addition to EC2 AutoScaling Group, you may use `createFleet()` to create an EC2 Spot Fleet:\n\n```python\nprovider.createFleet('SpotFleet', {\n  vpc,\n  defaultCapacitySize: 2,\n  instanceType: new ec2.InstanceType('t3.large'),\n});\n```\n\n# Single Spot Instnce\n\nIf you just need single spot instance without any autoscaling group or spot fleet, use `createInstance()`:\n\n```python\nprovider.createInstance('SpotInstance', { vpc })\n```\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "CDK construct library for EC2 Spot",
    "version": "2.0.292",
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "7b47142137d0e0dc4a88f94e36d4ff10d06ccb98587208d23a878585741caf21",
                "md5": "9ca6596d95c4e6ef1d76ab2cfa06d7ef",
                "sha256": "8ed7fc3b838f07f07e0714f241c05c3e39859d973e1683110d3fcf11662c7665"
            },
            "downloads": -1,
            "filename": "cdk_ec2spot-2.0.292-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9ca6596d95c4e6ef1d76ab2cfa06d7ef",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "~=3.7",
            "size": 39610,
            "upload_time": "2023-03-21T00:17:56",
            "upload_time_iso_8601": "2023-03-21T00:17:56.671146Z",
            "url": "https://files.pythonhosted.org/packages/7b/47/142137d0e0dc4a88f94e36d4ff10d06ccb98587208d23a878585741caf21/cdk_ec2spot-2.0.292-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "080ef5988e89de414cf1169fbdca0e8e2915500221b1586ee432f67c76b358dc",
                "md5": "db2eb832d55183b90eeed0a45a759c21",
                "sha256": "df497ed6d72192ffd8f26967fb1654c226c819631a8504d68697578604ca4335"
            },
            "downloads": -1,
            "filename": "cdk-ec2spot-2.0.292.tar.gz",
            "has_sig": false,
            "md5_digest": "db2eb832d55183b90eeed0a45a759c21",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "~=3.7",
            "size": 41329,
            "upload_time": "2023-03-21T00:17:59",
            "upload_time_iso_8601": "2023-03-21T00:17:59.265917Z",
            "url": "https://files.pythonhosted.org/packages/08/0e/f5988e89de414cf1169fbdca0e8e2915500221b1586ee432f67c76b358dc/cdk-ec2spot-2.0.292.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-03-21 00:17:59",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "pahud",
    "github_project": "cdk-ec2spot.git",
    "lcname": "cdk-ec2spot"
}
        
Elapsed time: 0.04466s