如何使用apache骆驼创建IAM用户? [英] How to create an IAM User using apache camel?
问题描述
我有一个骆驼的api.我试图使用apache骆驼框架创建IAM用户.代码就像这样->
.post("iam-create-user")
.route()
.process(new Processor(){
@Override
public void process(Exchange exchange) throws Exception {
exchange.getIn().setHeader("CamelAwsIAMUsername", "new-user");
})
.to("aws2-iam://current-user?accessKey=insert&secretKey=insert&operation=createUser")
.endRest();
我收到此错误java.lang.NullPointerException: null
.正确的做法是什么?它在骆驼文档中显示使用to("aws2-iam://test?iamClient=#amazonIAMClient&operation=createUser")
这样的URL.我们把iamClient
放在什么位置?
示例(#amazonIAMClient)中报告的iamClient是IAMClient的实例,您需要将其绑定名称为amazonIAMClient放入Camel注册表中. >
我认为您需要为此特定组件将区域指定为aws-global.
也许添加您的错误的完整堆栈跟踪.
I have a camel rest api. I was trying to create an IAM User using apache camel framework. The code is like so ->
.post("iam-create-user")
.route()
.process(new Processor(){
@Override
public void process(Exchange exchange) throws Exception {
exchange.getIn().setHeader("CamelAwsIAMUsername", "new-user");
})
.to("aws2-iam://current-user?accessKey=insert&secretKey=insert&operation=createUser")
.endRest();
I am getting this error java.lang.NullPointerException: null
. What is the correct way of doing this? It shows in the camel docs to use a URL like so to("aws2-iam://test?iamClient=#amazonIAMClient&operation=createUser")
. What do we put as iamClient
?
The iamClient reported in the example (#amazonIAMClient) is an instance of IAMClient you'll need to put in the Camel registry with a bind name amazonIAMClient.
I think you need to specify region as aws-global for this particular component.
Maybe add the full stack trace of your error.
这篇关于如何使用apache骆驼创建IAM用户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!