{"id":36543415,"url":"https://github.com/tksst/cdk-ec2-spot-simple","last_synced_at":"2026-02-25T09:16:23.334Z","repository":{"id":64469385,"uuid":"573961481","full_name":"tksst/cdk-ec2-spot-simple","owner":"tksst","description":"AWS CDK construct library to create EC2 Spot Instances simply.","archived":false,"fork":false,"pushed_at":"2026-02-21T21:14:17.000Z","size":720,"stargazers_count":5,"open_issues_count":19,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-22T02:24:15.062Z","etag":null,"topics":["aws","cdk"],"latest_commit_sha":null,"homepage":"https://constructs.dev/packages/cdk-ec2-spot-simple","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tksst.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-12-04T01:05:23.000Z","updated_at":"2025-03-16T07:22:31.000Z","dependencies_parsed_at":"2023-01-03T20:22:02.079Z","dependency_job_id":"45be8e04-a35c-43a5-af5d-e666d24e7d65","html_url":"https://github.com/tksst/cdk-ec2-spot-simple","commit_stats":{"total_commits":64,"total_committers":3,"mean_commits":"21.333333333333332","dds":0.359375,"last_synced_commit":"060f9d3da0a8da0c9635dc345937825839611c41"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/tksst/cdk-ec2-spot-simple","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tksst%2Fcdk-ec2-spot-simple","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tksst%2Fcdk-ec2-spot-simple/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tksst%2Fcdk-ec2-spot-simple/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tksst%2Fcdk-ec2-spot-simple/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tksst","download_url":"https://codeload.github.com/tksst/cdk-ec2-spot-simple/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tksst%2Fcdk-ec2-spot-simple/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29815582,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-25T05:36:42.804Z","status":"ssl_error","status_checked_at":"2026-02-25T05:36:31.934Z","response_time":61,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws","cdk"],"created_at":"2026-01-12T05:51:51.602Z","updated_at":"2026-02-25T09:16:23.300Z","avatar_url":"https://github.com/tksst.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cdk-ec2-spot-simple\n\n[![npm](https://img.shields.io/npm/v/cdk-ec2-spot-simple)](https://www.npmjs.com/package/cdk-ec2-spot-simple)\n[![PyPI](https://img.shields.io/pypi/v/cdk-ec2-spot-simple)](https://pypi.org/project/cdk-ec2-spot-simple)\n[![Nuget](https://img.shields.io/nuget/v/TksSt.Cdk.Ec2SpotSimple)](https://www.nuget.org/packages/TksSt.Cdk.Ec2SpotSimple)\n[![Maven Central](https://img.shields.io/maven-central/v/st.tks.cdk/ec2-spot-simple)](https://search.maven.org/artifact/st.tks.cdk/ec2-spot-simple)  \n[![View on Construct Hub](https://constructs.dev/badge?package=cdk-ec2-spot-simple)](https://constructs.dev/packages/cdk-ec2-spot-simple)\n\nCDK construct library to create EC2 Spot Instances simply.\n\n## Install\n\n### TypeScript/JavaScript\n\n```shell\nnpm install cdk-ec2-spot-simple\n```\n\n```shell\npnpm add cdk-ec2-spot-simple\n```\n\n```shell\nyarn add cdk-ec2-spot-simple\n```\n\n### Python\n\n```shell\npip install cdk-ec2-spot-simple\n```\n\n### .NET\n\n```shell\ndotnet add package TksSt.Cdk.Ec2SpotSimple\n```\n\n### Java\n\n```xml\n\u003cdependency\u003e\n    \u003cgroupId\u003est.tks.cdk\u003c/groupId\u003e\n    \u003cartifactId\u003eec2-spot-simple\u003c/artifactId\u003e\n\u003c/dependency\u003e\n```\n\n### Go\n\n```shell\ngo get github.com/tksst/cdk-ec2-spot-simple-go/cdkec2spotsimple/v2\n```\n\n## Usage\n\nTo set up a spot instance with default parameters, simply use \"SpotInstance\" instead of \"ec2.Instance\".\n\n```typescript\nimport { SpotInstance } from \"cdk-ec2-spot-simple\";\nimport * as ec2 from \"aws-cdk-lib/aws-ec2\";\n\n// Simple usage\nnew SpotInstance(this, \"DefaultConfigSpotInstance\", {\n  // Required properties of \"ec2.Instance\"\n  vpc: ec2.Vpc.fromLookup(this, \"defaultVPC\", { isDefault: true }),\n  instanceType: ec2.InstanceType.of(ec2.InstanceClass.T3A, ec2.InstanceSize.NANO),\n  machineImage: new ec2.AmazonLinuxImage()\n});\n\n// Advanced usage\nnew SpotInstance(this, \"StoppableSpotInstance\", {\n  // Required properties of \"ec2.Instance\"\n  vpc: ec2.Vpc.fromLookup(this, \"defaultVPC\", { isDefault: true }),\n  instanceType: ec2.InstanceType.of(ec2.InstanceClass.T3A, ec2.InstanceSize.NANO),\n  machineImage: new ec2.AmazonLinuxImage(),\n  // SpotInstance specific property\n  spotOptions: {\n    interruptionBehavior: ec2.SpotInstanceInterruption.STOP,\n    requestType: ec2.SpotRequestType.PERSISTENT,\n    maxPrice: 0.007\n  }\n});\n```\n\n## API document\n\n[See Construct Hub](https://constructs.dev/packages/cdk-ec2-spot-simple)\n\n## Background\n\nThe `Instance` construct in `aws-cdk-lib/aws-ec2` does not have any spot instance functionality.\n\nThis `SpotInstance` construct creates `LaunchTemplate` that is enabled spot request internally and associate with `Instance`.\n\nAlso, `SpotInstance` creates a Lambda-backed custom resource if the spot requiest type is PERSISTENT. That resource deletes the spot request when the stack is destroyed.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftksst%2Fcdk-ec2-spot-simple","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftksst%2Fcdk-ec2-spot-simple","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftksst%2Fcdk-ec2-spot-simple/lists"}