Configuration merge (not --merge) accepts a proper JSON document, so simply write out the JSON which you want to be merged such as:
{
"<componentName>":{
"MERGE":{
"accessControl":{
"aws.greengrass.ShadowManager":{
"mtdshadowconfig-dev-shadowconfigpython::1":{
"policyDescription":"allow access to config# shadow",
"operations":[
"aws.greengrass#GetThingShadow",
"aws.greengrass#UpdateThingShadow",
"aws.greengrass#ListNamedShadowsForThing"
],
"resources":[
"$aws/things/thingName/shadow/name/config1"
]
}
}
}
},
"RESET":[
]
}
}
Save as "config.json"
then use the deployment create command with --update-config config.json --merge componentName=1.0.0
The option --merge is used to tell Greengrass to add the following component and version onto the device. To set the configuration you use the --update-config option, not --merge.
Hello,
Try greengrass-cli deployment create --help. Our local CLI has builtin help for you.
To answer the question you would use the --update-config option and provide a path to a JSON file which contains new configuration to apply. Use the format: {"componentName": {"MERGE": {"<key>": "<value>"}, "RESET": ["</path/to/reset>"]}}
In your case, you can merge the accessControl values which you need.
Cheers,
Michael
would I need to use a
AccessControl="{ <full json access control document here }"
Or do i need to add every value in the
{
"aws.greengrass.ShadowManager": {
"mtdshadowconfig-dev-shadowconfigpython::1": {
"policyDescription": "allow access to config# shadow",
"operations": [
"aws.greengrass#GetThingShadow",
"aws.greengrass#UpdateThingShadow",
"aws.greengrass#ListNamedShadowsForThing"
],
"resources": [
"$aws/things/thingName/shadow/name/config1"
]
}
}
}
document ? How does that work with the tree structure that is in that document ?
Are there any examples ?
The documentation
*-m, --merge=Component and version*
*The name and version of the target component you want to add*
*or update.*
*Format: <component-name>=<version>. Example: HelloWorld=1.*
*0.0. Use a separate argument for each additional component*
*to specify.*
is not very specific about how to merge json document like this
Relevant content
- asked 6 months ago
- asked 2 years ago
- AWS OFFICIALUpdated 7 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 6 months ago