怎样通过CloudFormation来给DocumentDB创建一些表和索引(how to create some table and index in DocumentDB by CloudFormation)

0

问题如标题,怎么通过CloudFormation来给DocumentDB创建一些表和索引 Questions such as titles, how to create some tables and indexes for DocumentDB through CloudFormat

我的项目现在在使用documentdb,还有S3桶,但是每次在配置新的环境时候,documentdb中所有的集合和索引,还有S3中的一些文件都需要手动再导入,如果忘记了就会遗漏,有什么办法可以让这些都自动导入吗~这样以后更新各个环境的时候就只需要维护一个就好了.

My project is currently using documentdb and S3 bucket, but every time I configure a new environment, all the collections and indexes in documentdb, as well as some files in S3, need to be manually imported. If I forget them, I will miss them. Is there any way to automatically import them? This way, when updating each environment in the future, only one needs to be maintained.

profile picture
Dgk
已提问 10 个月前265 查看次数
1 回答
1
已接受的回答
profile picture
专家
已回答 10 个月前
profile pictureAWS
专家
已审核 9 个月前
  • OK, Thanks for you answer. but I need to create tables and indexes when I want build a new environment, I don't want to manually create them. What should I do,Are there any good methods for automatic creation.looking for your answer.ありがとうございました!

  • If you do this with CloudFormation, I believe there is a way to create a custom resource and connect to it from a Lambda function to create the table. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-custom-resources-lambda.html
    If you want to operate in Python, I believe pymongo can be used. https://pymongo.readthedocs.io/en/stable/

  • ok, thanks you~ Maybe I need to write a Lambda function to solve this problem.>﹏<, emmm, I have another question, How to automatically import S3 buckets by CloudFormation. I have made some additions to my question,could you also answer this question~ thank you very much!

  • I think we need to use Lambda with custom resources for new questions as well. DocumentDB internal operations are basically not supported by CloudFormation and must be automated by creating custom resources, etc.

  • ok~~~~~,thank you very much! I should study (Lambda with custom resources) as soon as possible. Is this difficult to learn?(っ °Д °;)っ anyway,thank you very much!!!have a nice day []( ̄▽ ̄)*

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则