By using AWS re:Post, you agree to the Terms of Use

Different GreenGrass v2 component configurations depending on tevice tag


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

1 Answer
Accepted Answer

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.

answered 6 months ago
  • 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.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions