Support Questions

Find answers, ask questions, and share your expertise

How to dynamically apply Parameter Contexts based on environment ?

avatar

in my Nifi flows I have created 3 parameter context group each for an environment(DEV, SIT, PROD) respectively.....


As of now whenever I migrate my flow to other environments , I manually select the paramater contexts based on the environment.

I want to know if there is a way I can dynamically apply them without me manually selecting the parameter context groups manually

Is there a way I can apply them dynamically ?

1 REPLY 1

avatar
Expert Contributor

Hi @SashankRamaraju 
Parameter Context Groups(PMG) have to be added manually only. But, you can have a Parameter Context Group specific to environment. I mean, for example, a PMG with name 'Env variables' (say) has DEV values in DEV environment and PROD values in PROD environment. So, you will only be selecting the PMG 'Env variables' in all the environments, but, the config(values) is specific to environment.
If it is mandatory to have 3 PMGs, selecting the PMG is manual, yet, if it is ok, you can use something like below.

 

Screenshot from 2020-09-19 18-48-49.png
Screenshot from 2020-09-19 18-52-03.png
Generate FlowFile config:
Generate FlowFile configGenerate FlowFile config
UpdateAttribute config:
UpdateAttribute configUpdateAttribute config
Here, I am trying to evaluate #{DEV_env}. And DEV is coming from the attribute env.