EC2 Spot Block with Single Instance and EIP
Project description
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:
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
from cdk_spot_one import SpotFleet
fleet = SpotFleet(stack, "SpotFleet",
target_capacity=1,
instance_interruption_behavior=InstanceInterruptionBehavior.HIBERNATE,
default_instance_type=ec2.InstanceType("c5.large"),
eip_allocation_id="eipalloc-0d1bc6d85895a5410",
vpc_subnet={
"subnet_type": ec2.SubnetType.PUBLIC
},
terminate_instances_with_expiration=True
)
# fleet to expire after 6 hours
fleet.expire_after(Duration.hours(6))
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-spot-one-0.1.6.tar.gz
(29.4 kB
view hashes)
Built Distribution
Close
Hashes for cdk_spot_one-0.1.6-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3895a14448f33b908e382937ceb7eba7bce23d7c1d4309bef5e506bb35544532 |
|
MD5 | b93fdaca938019295c8d8031dcaf31f6 |
|
BLAKE2b-256 | 55a35b59cdcebe7d6073812db3761b41136a8b4bb88651bb9605a6d7ade6dca6 |