Using AWS lambda with python or java code to get JSON from RestAPI call and insert into oracle DB

huangapple go评论76阅读模式
英文:

Using AWS lambda with python or java code to get JSON from RestAPI call and insert into oracle DB

问题

Sure, here's the translation:

我可以使用AWS Lambda调用一个RestAPI,遍历JSON,提取数据并将数据加载到AWS RDS上的Oracle数据库中,通过将参数传递给Oracle包来实现吗?如果可以,有人能告诉我如何安全地获取用于调用RestAPI的凭据以及Oracle用户的凭据吗?

英文:

Can i use AWS lambda to call a RestAPI and iterate thru JSON, extract and load data into oracle DB on AWS RDS by passing the parameters to an oracle package? If yes can someone please let me know to secure credentials to call RestAPI and Oracle user?

答案1

得分: 2

你应该使用AWS Secrets Manager,这里有一篇来自AWS的很好的指南

英文:

You should use AWS Secrets Manager, Here is a good guide from AWS.

答案2

得分: 2

如其他答案所指出,如果您想存储秘密信息,可以使用AWS Secrets Manager。但在您与AWS托管的RDS Oracle数据库一起工作时,它最有用。从您的问题中并不清楚是否是这种情况。

如果不是这种情况,那么使用带有SecretString类型的AWS Systems Manager Parameter Store可能会更好,因为它是免费的(AWS Secrets Manager并非免费)。

AWS并未在Lambda中为不同数据库提供内置SDK。然而,Oracle提供了cx_Oracle,这是Python的一个模块。要在Lambda上使用它,您需要构建一个自定义开发包或者您自己的Lambda层来使用cx_Oracle

总之,我认为您完全可以使用Lambda来处理您的数据库。然而,这不是开箱即用的,需要一些开发工作。

英文:

As the other answer pointed out, you can use AWS Secrets Manager if you want to store secrets. But its most useful when you are working with AWS Managed RDS Oracle DB. Its not clear from your question whether this is the case.

If that is not the case, then AWS Systems Manager Parameter Store with SecretString type could be better, as it is free (AWS Secrets Manager is not free).

AWS does not provide build-in SDKs in lambda for different databases. However, Orcale provides cx_Oracle which is module for Python. To use that on lambda you would have to construct a custom development package or your own lambda layer to use cx_Oracle.

To sum up, I don't see a reason why you wouldn't be able to use lambda to work with your DB. However, this is something that will not work out-of-the box and requires some development.

huangapple
  • 本文由 发表于 2020年8月23日 12:53:45
  • 转载请务必保留本文链接:https://go.coder-hub.com/63543525.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定