Nifi:如何独立于环境读取 AWSCredentialsProviderControlerService 的访问/密钥 [英] Nifi: How to read access/secret key for AWSCredentialsProviderControlerService independent of environment

查看:37
本文介绍了Nifi:如何独立于环境读取 AWSCredentialsProviderControlerService 的访问/密钥的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们当前设置了属性文件的路径,其中包含 AWSCredentialsProviderControlerService 凭证文件的秘密/访问密钥.问题是,我们每次运行 nifi 工作流时都在更改 prod 和 non prod 的属性路径.试图在凭据文件路径上的配置上不做任何更改,以便无论生产和非生产如何都可以读取访问/秘密密钥.由于凭证文件不支持 Nifi Expresion 语言,尝试利用 ACCESS KEY/SECRET 属性 ${ENV:equalsIgnoreCase("prod"):ifElse(${ACESS_PROD},${ACESS_NONPROD})} 我们面临的问题,我们无法将这些访问密钥/秘密密钥存储到注册表中.因此无法实施此更改.无论Nifi中的环境如何,有没有办法读取访问/密钥.目前,我们使用 1 个属性文件用于非 prod nifi,将第二个属性文件用于 prod 属性.在此设置中,从生产切换到非生产时需要手动更改凭据文件路径.尝试在不更改凭证文件路径的情况下无缝工作.有什么办法可以做到这一点吗?

We are currently set path of properties file which contains secret/access key for Credentials File for AWSCredentialsProviderControlerService . Issue, is we are changing properties path for prod and non prod each time we run nifi workflow. trying to come up no change on Configuration on Credential File path, so that access/secret key would be read regardless of prod and non prod. Since credential file wont support Nifi Expresion language, trying to make use of ACCESS KEY/SECRET properties ${ENV:equalsIgnoreCase("prod"):ifElse(${ACESS_PROD},${ACESS_NONPROD})} Issue we are facing, we are not able to store these access key/secret keys to the registry. Hence unable to implement this change. Is there any way to read access/secret key regardless of environment in Nifi. Curently we are using 1 property file for non prod nifi and 2nd property file for prod properties. In this set up, manually need to changed to credential file path when switching from prod to non prod. Trying to seamlessly work without changing path of credential file. Is there any way to make this happen?

在此处输入图片说明

推荐答案

使用 AWSCredentialsProviderControlerService 的进程不支持 param 或变量,但 AWSCredentialsProviderControlerService 凭证文件"支持属性支持参数上下文"作为条目,请将此用于您的解决方案.

The process that uses the AWSCredentialsProviderControlerService does not support param or variables, but the AWSCredentialsProviderControlerService "credential file" property supports "Parameters Context" as entries, make use of this for your solution.

示例:

触发某事-->RouteOnAttribute -->If Prod(运行 executestreamcmd 并将参数上下文值更改为指向 prod credfile) else if DEV(运行 executestreamcmd 并将参数上下文值更改为指向 prod credfile)-->然后运行您的 AWS 处理器.

Trigger something --> RouteOnAttribute --> If Prod (run executestreamcmd and change the Parameter Context Value to point to prod credfile) else if DEV(run executestreamcmd and change the Parameter Context Value to point to prod credfile) --> then run you AWS Processor.

您可以使用工具包客户端编辑参数上下文,或事件 nipyapi python 模块.不会很快的.

You can use the toolkit client to edit the parameter context, or event nipyapi python module. It will not be fast tohu.

这篇关于Nifi:如何独立于环境读取 AWSCredentialsProviderControlerService 的访问/密钥的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆