Package Exports
- cdk-spot-one
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (cdk-spot-one) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Welcome to cdk-spot-one
EC2 Spot Block with Single Instance and EIP
Sample
Create a single EC2 spot instance for 6 hours with EIP attached:
import { SpotFleet } from 'cdk-spot-one';
const fleet = new SpotFleet(stack, 'SpotFleet', {
targetCapacity: 1,
instanceInterruptionBehavior: InstanceInterruptionBehavior.HIBERNATE,
defaultInstanceType: new ec2.InstanceType('c5.large'),
eipAllocationId: 'eipalloc-0d1bc6d85895a5410',
vpcSubnet: {
subnetType: ec2.SubnetType.PUBLIC,
},
terminateInstancesWithExpiration: true,
})
// fleet to expire after 6 hours
fleet.expireAfter(Duration.hours(6))