-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcf.template
98 lines (88 loc) · 2.6 KB
/
cf.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
{
"Parameters" : {
"LatestAmiId" : {
"Type" : "AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>",
"Default" : "/aws/service/ami-amazon-linux-latest/amzn-ami-hvm-x86_64-ebs"
}},
"Resources":{
"MySpotFleet":{
"Type":"AWS::EC2::SpotFleet",
"Properties":{
"SpotFleetRequestConfigData":{
"IamFleetRole": "arn:aws:iam::513469704633:role/aws-ec2-spot-fleet-tagging-role",
"AllocationStrategy": "lowestPrice",
"TargetCapacity": 1,
"SpotPrice": "1.105",
"LaunchSpecifications": [
{
"ImageId": !Ref LatestAmiId,
"InstanceType": "c4.large",
"SpotPrice": "0.105",
"NetworkInterfaces": [
{
"DeviceIndex": 0,
"SubnetId": "subnet-718bd259",
"Groups": [ "sg-f8a9189d" ],
"AssociatePublicIpAddress": true
}
],
"KeyName": "dec15a",
"BlockDeviceMappings": [
{
"DeviceName": "/dev/xvda",
"Ebs": {
"DeleteOnTermination": true,
"VolumeType": "standard",
"VolumeSize": 400
}
}
],
"UserData":{
"Fn::Base64":{
"Fn::Sub":"#!/bin/bash -xe\n
yum install -y docker mysql git python-pip\n
pip install aws-ec2-assign-elastic-ip\n
sudo amazon-linux-extras install -y docker\n
aws-ec2-assign-elastic-ip --access-key !Ref Oksoftaccess --secret-key !Ref Oksoftsecret --valid-ips 35.174.198.170\n
service docker start\n
docker run -d -p 8887:8888 -v /tmp:/tmp shantanuo/notebook\n"
}
}
}
],
"Type":"request"
}
}
}
}
}
For windows:
{
"Resources":{
"MySpotFleet":{
"Type":"AWS::EC2::SpotFleet",
"Properties":{
"SpotFleetRequestConfigData":{
"IamFleetRole": "arn:aws:iam::302378362623:role/aws-ec2-spot-fleet-tagging-role",
"AllocationStrategy": "lowestPrice",
"TargetCapacity": 1,
"SpotPrice": "1.105",
"LaunchSpecifications": [
{
"ImageId": "ami-0b839332cdd586918",
"InstanceType": "t2.small",
"SpotPrice": "1.105",
"NetworkInterfaces": [
{
"DeviceIndex": 0,
"SubnetId": "subnet-7639c23b",
"Groups": [ "sg-282e5e41" ],
"AssociatePublicIpAddress": true
}
],
"KeyName": "dec15a",
}
],
"Type": "request"
}
}}}}