Different GreenGrass v2 component configurations depending on tevice tag

0

Is there a way to deploy a component with different configuration for each device group or tag ? We have different kind of device that should have slightly different component behavior. For instance, a device A may not want to use sensor X. Is there a way to have a deployment that deploys to all my devices, but has a configuration parameter specifically for device A ?

I could implement htat using an API call ListTagsForResource but that would happen too late in my workflow. I could also have two different deployments with different config, but then I have no guarantee that all my device are running the same component version, plus the logic would now be replicated in two deployments.

Edit: There seems to be a way to achieve it by setting "platformOverride" to the nucleus component, altough I am not sure how that would be done

TSpark
질문됨 2년 전629회 조회
1개 답변
1
수락된 답변

Hi again TSpark,

I'd suggest that you create a component to hold the device-unique configurations you need. Let's call it simply "Config". You will create a deployment for each device that needs its own values and you will deploy only "Config". In the deployment, you will merge in the device-specific values.

Components in the group deployment which need device-specific information can use our GetConfiguration API in order to read the configuration. If you do not want to use IPC, then the configuration can also be interpolated into the component's lifecycle such as {Config:configuration:/configPath}, where "Config" is your config component name.

As another simple option if the configuration is going to be static, then of course you could simply have a file on the device that contains whatever unique information it needs.

AWS
전문가
답변함 2년 전
  • Awesome, thanks for all the answers ! It is really helping our migration

  • Having a config component and reverencing its config in another component seems to work nicely. Is it possible to use that variable to get a different artifact ? I would like to have an artifact similar to "URI": "S3://bucket/{com.comp.test:configuration:/script_name}". Alternatively, I would be okay to get the whole folder or all files in the S3 folder, but that also does not seem to work

  • No, you cannot use variables for artifacts. The artifacts must be known at the time that the component version is created. That being said, your component could just use the S3 API or AWS CLI to download whatever you want from S3.

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

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

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

관련 콘텐츠