-
Notifications
You must be signed in to change notification settings - Fork 1
/
ethereum-swarm-persistent-resources.yaml
55 lines (52 loc) · 1.39 KB
/
ethereum-swarm-persistent-resources.yaml
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
---
AWSTemplateFormatVersion: '2010-09-09'
Metadata:
License: MIT License
Description: Manage persistent resources for Ethereum Swarm
Parameters:
AvailabilityZone:
Description: (Required) Availability zone to be used
Type: AWS::EC2::AvailabilityZone::Name
SwarmDataDiskSize:
Description: (Required) Swarm data disk size in gigabytes
Default: 50
Type: Number
SnapshotID:
Description: (Optional) Restore EBS volume from a snapshot
Default: ''
Type: String
Conditions:
RestoreFromSnapshot: !Not [!Equals [ !Ref 'SnapshotID', '']]
Resources:
SwarmDataVolume:
Type: AWS::EC2::Volume
DeletionPolicy: Snapshot
Properties:
Size:
!If [RestoreFromSnapshot, !Ref 'AWS::NoValue', !Ref 'SwarmDataDiskSize']
VolumeType: gp2
AvailabilityZone: !Ref 'AvailabilityZone'
SnapshotId:
!If [RestoreFromSnapshot, !Ref 'SnapshotID', !Ref 'AWS::NoValue']
Tags:
-
Key: Name
Value: !Ref 'AWS::StackName'
PublicIP:
Type: AWS::EC2::EIP
Outputs:
PublicIP:
Description: Public IP address
Value: !Ref 'PublicIP'
Export:
Name: SwarmPublicIP
SwarmDataVolume:
Description: Swarm Data Volume
Value: !Ref 'SwarmDataVolume'
Export:
Name: SwarmDataVolume
AvailabilityZone:
Description: Availability Zone
Value: !Ref 'AvailabilityZone'
Export:
Name: AvailabilityZone