Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save konstantinvlasenko/cd0fca1e21646cd0b5c8 to your computer and use it in GitHub Desktop.
Save konstantinvlasenko/cd0fca1e21646cd0b5c8 to your computer and use it in GitHub Desktop.
AWS CloudFormation Custom Resource - Spot (template)
{
"AWSTemplateFormatVersion": "2010-09-09",
"Resources": {
"DC": {
"Type": "Custom::SPOT",
"Properties": {
"ServiceToken": "arn:aws:lambda:us-east-1:637921189560:function:cf_spot",
"params": {
"SpotPrice": "0.5",
"LaunchSpecification": {
"BlockDeviceMappings": [
{
"DeviceName": "/dev/sda1",
"Ebs": { "VolumeSize": 60 }
}
],
"ImageId": "ami-40f0d32a",
"InstanceType": "m1.large",
"KeyName": "firstkey",
"IamInstanceProfile": {
"Name": "S3Reader"
}
}
}
}
}
},
"Outputs": {
"DCPublicDnsName": {
"Description": "instance running",
"Value": {
"Fn::GetAtt": [
"DC",
"PublicDnsName"
]
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment