-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgreengo.yaml
99 lines (95 loc) · 2.65 KB
/
greengo.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
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
99
# Greeengrass Group definition file
Group:
name: PlantWatering
Cores:
- name: PlantWatering_core
key_path: ./certs
config_path: ./config
SyncShadow: True
Lambdas:
- name: WaterRelease
handler: handler.release_water
package: lambdas/WaterPumpControl
alias: dev
greengrassConfig:
MemorySize: 128000 # kb
Timeout: 60 # seconds
Pinned: False
Environment:
AccessSysfs: True
ResourceAccessPolicies:
- ResourceId: RaspberryGPIO
Permission: 'rw'
- name: DeviceBoot
handler: pinned.pinned_handler
package: lambdas/WaterPumpControl
alias: dev
greengrassConfig:
MemorySize: 128000 # kb
Timeout: 300 # seconds
Pinned: True
Environment:
AccessSysfs: True
ResourceAccessPolicies:
- ResourceId: RaspberryGPIO
Permission: 'rw'
- ResourceId: DataFolder
Permission: 'rw'
- name: Camera
handler: pinned.pinned_handler
package: lambdas/Camera
alias: dev
greengrassConfig:
MemorySize: 128000 # kb
Timeout: 30 # seconds
Pinned: True
Environment:
AccessSysfs: True
ResourceAccessPolicies:
- ResourceId: PiCamera
Permission: 'rw'
- ResourceId: PiCamera2
Permission: 'rw'
Subscriptions:
- Source: GGShadowService
Subject: '$aws/things/PlantWatering_core/shadow/get/#'
Target: cloud
- Source: GGShadowService
Subject: '$aws/things/PlantWatering_core/shadow/update/#'
Target: cloud
- Source: cloud
Subject: '$aws/things/PlantWatering_core/shadow/get/#'
Target: GGShadowService
- Source: cloud
Subject: '$aws/things/PlantWatering_core/shadow/update/#'
Target: GGShadowService
- Source: cloud
Subject: 'PlantWatering/WaterRelease'
Target: Lambda::WaterRelease
# Resource as defined at http://boto3.readthedocs.io/en/latest/reference/services/greengrass.html#Greengrass.Client.create_resource_definition_version
Resources:
- Name: RaspberryGPIO
Id: RaspberryGPIO
LocalDeviceResourceData:
SourcePath: /dev/gpiomem
GroupOwnerSetting:
AutoAddGroupOwner: True
- Name: DataFolder
Id: DataFolder
LocalVolumeResourceData:
SourcePath: /home/ggc_user/
DestinationPath: /home/ggc_user/
GroupOwnerSetting:
AutoAddGroupOwner: True
- Name: PiCamera
Id: PiCamera
LocalDeviceResourceData:
SourcePath: /dev/vcsm
GroupOwnerSetting:
AutoAddGroupOwner: True
- Name: PiCamera2
Id: PiCamera2
LocalDeviceResourceData:
SourcePath: /dev/vchiq
GroupOwnerSetting:
AutoAddGroupOwner: True