can you use the recipe variable {iot:thingName} in the merge update for the shadow manager?

0

The documentation is a bit confusing:

Merge Configuration Update says you can use the the {iot:thingName} variable.

I have tried using it in the merge update for the Shadow Manager.

{
	"strategy": {
		"type": "realTime",
		"delay": 300
	},
	"synchronize": {
		"shadowDocumentsMap": {
			"{iot:thingName}": {
				"classic": true,
				"namedShadows": [
					"test-plugin",
					"notifications-plugin"
				]
			}
		},
		"direction": "betweenDeviceAndCloud"
	},
	"rateLimits": {
		"maxOutboundSyncUpdatesPerSecond": 100,
		"maxTotalLocalRequestsRate": 200,
		"maxLocalRequestsPerSecondPerThing": 20
	},
	"shadowDocumentSizeLimitBytes": 8192
}

When I deploy it I get an error:

2023-08-11T05:29:42.430Z [WARN] (Serialized listener processor) com.aws.greengrass.shadowmanager.ShadowManager: service-invalid-state-error. Invalid reported state. {serviceName=aws.greengrass.ShadowManager, currentState=ERRORED, newState=ERRORED}
2023-08-11T05:29:42.435Z [ERROR] (Serialized listener processor) com.aws.greengrass.shadowmanager.ShadowManager: service-errored. {serviceName=aws.greengrass.ShadowManager, currentState=ERRORED}
com.aws.greengrass.shadowmanager.exception.InvalidRequestParametersException: ThingName must match pattern [a-zA-Z0-9:_-]+
        at com.aws.greengrass.shadowmanager.util.Validator.validateThingName(Validator.java:86)
        at com.aws.greengrass.shadowmanager.model.configuration.ShadowSyncConfiguration.processThingShadowSyncConfiguration(ShadowSyncConfiguration.java:225)
        at com.aws.greengrass.shadowmanager.model.configuration.ShadowSyncConfiguration.processThingConfiguration(ShadowSyncConfiguration.java:165)
        at com.aws.greengrass.shadowmanager.model.configuration.ShadowSyncConfiguration.lambda$processOtherThingConfigurations$0(ShadowSyncConfiguration.java:107)
        at java.base/java.util.TreeMap.forEach(TreeMap.java:1002)
        at com.aws.greengrass.shadowmanager.model.configuration.ShadowSyncConfiguration.lambda$processOtherThingConfigurations$1(ShadowSyncConfiguration.java:106)
        at java.base/java.util.Map.computeIfPresent(Map.java:1079)
        at com.aws.greengrass.shadowmanager.model.configuration.ShadowSyncConfiguration.processOtherThingConfigurations(ShadowSyncConfiguration.java:102)
        at com.aws.greengrass.shadowmanager.model.configuration.ShadowSyncConfiguration.processConfiguration(ShadowSyncConfiguration.java:79)
        at com.aws.greengrass.shadowmanager.ShadowManager.configureSynchronization(ShadowManager.java:298)
        at com.aws.greengrass.shadowmanager.ShadowManager.lambda$install$5(ShadowManager.java:251)
        at com.aws.greengrass.config.Topics.childChanged(Topics.java:439)
        at com.aws.greengrass.config.Topics.childChanged(Topics.java:461)
        at com.aws.greengrass.config.Topics.childChanged(Topics.java:461)
        at com.aws.greengrass.config.Topics.childChanged(Topics.java:461)
        at com.aws.greengrass.config.Topic.fire(Topic.java:283)
        at com.aws.greengrass.config.Topic.lambda$withNewerValue$0(Topic.java:255)
        at com.aws.greengrass.dependency.Context$1.run(Context.java:68)

2023-08-11T05:29:42.436Z [WARN] (Serialized listener processor) com.aws.greengrass.shadowmanager.ShadowManager: service-invalid-state-error. Invalid reported state. {serviceName=aws.greengrass.ShadowManager, currentState=ERRORED, newState=ERRORED}

Basically I want to complete a deployment on all my core Devices (100+) and it should just sync the shadows that are associated with that core device and not the others.... Is this possible or do we need to explicitly list the thingName?

질문됨 10달 전205회 조회
1개 답변
0
수락된 답변

Hi Phil. Not sure if I misunderstand, but wouldn't you just use the coreThing specifier to sync shadows for your particular Greengrass core device? The shadowDocumentsMap is when you want to synchronize shadows for other things/devices.

profile pictureAWS
전문가
Greg_B
답변함 10달 전
AWS
전문가
검토됨 10달 전
  • ahhhh I see, I kept over looking that, I assumed it was a placeholder for the thingName in the documentation and not refering to the actual coreThing.

    but this should work I guess?

    { "reset": [ "" ], "merge": { "strategy": { "type": "realTime" }, "synchronize": { "coreThing": { "classic": true, "namedShadows": [ "test-plugin", "notifications-plugin" ] }, "direction": "betweenDeviceAndCloud" } } }

    Thanks

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠