0.0.4-development • Published 3 years ago
@tksst/vlvtf68453i3jt57swttasdfasdf v0.0.4-development
cdk-ec2-spot-simple
CDK construct library to create EC2 Spot Instances simply.
Install
npm install xxxxxxxx
Usage
import { SpotInstance } from "xxxx"
import * as ec2 from "aws-cdk-lib/ec2"
// You should just use "SpotInstance" instead of "ec2.Instance"
new SpotInstance(this, "StoppableSpotInstance", {
// Required properties of "ec2.Instance"
vpc: ec2.Vpc.fromLookup(this, "defaultVPC", { isDefault: true });,
instanceType: ec2.InstanceType.of(ec2.InstanceClass.T3A, ec2.InstanceSize.NANO),
machineImage: new ec2.AmazonLinuxImage(),
});
// You should just use "SpotInstance" instead of "ec2.Instance"
new SpotInstance(this, "StoppableSpotInstance", {
// Required properties of "ec2.Instance"
vpc: ec2.Vpc.fromLookup(this, "defaultVPC", { isDefault: true });,
instanceType: ec2.InstanceType.of(ec2.InstanceClass.T3A, ec2.InstanceSize.NANO),
machineImage: new ec2.AmazonLinuxImage(),
// SpotInstance specific property
spotOptions: {
interruptionBehavior: ec2.SpotInstanceInterruption.STOP,
requestType: ec2.SpotRequestType.PERSISTENT,
},
});
0.0.4-development
3 years ago
0.0.3-development
3 years ago
0.0.2-development
3 years ago
0.0.1-development
3 years ago
0.0.0-development
3 years ago