-
Notifications
You must be signed in to change notification settings - Fork 2
/
cft_parameters.template
70 lines (66 loc) · 1.91 KB
/
cft_parameters.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
{
"Parameters": {
"LatestAmiId": {
"Type": "AWS::SSM::Parameter::Value<AWS::EC2::Image::Id>",
"Default": "/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-x86_64-ebs"
},
"myKeyPair" : {
"Description" : "Amazon EC2 Key Pair",
"Type" : "AWS::EC2::KeyPair::KeyName"
},
"mySubnetIDs" : {
"Description" : "Subnet IDs",
"Type" : "List<AWS::EC2::Subnet::Id>"
},
"Oksoftaccess":{
"Type":"AWS::SSM::Parameter::Value<String>",
"Default":"myEC2TypeDev"
},
"Oksoftsecret":{
"Type":"String",
"Default":"mysecret1"
}
},
"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": "c3.large",
"SpotPrice": "0.105",
"SubnetId": !Join [ " , ", !Ref mySubnetIDs ],
"KeyName": !Ref myKeyPair,
"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
service docker start\n
docker run -d -p 8887:8888 -v /tmp:/tmp shantanuo/notebook\n
/usr/local/bin/aws-ec2-assign-elastic-ip --access-key !Ref Oksoftaccess --secret-key !Ref Oksoftsecret --valid-ips 18.210.57.140\n"
}
},
}
],
"Type": "request"
}
}}}}