使用BOTO3创建SSM文档,该文档关闭微服务及其相关的EC2实例
我被分配了一个任务来开发一个解决方案,该解决方案可以并行关闭在给定的EC2实例上运行的所有微服务过程,然后关闭EC2实例本身,并在同一组EC2实例上并行执行此操作。这应该从yaml配置文件(让我们称为父)中获取类似于以下标识的Micro Services安装点的输入:
fabric: usprod1
sequence:
stateless:
- admin-portal
- dashboard
- haraka
- vm-prometheus
- watchtower-server
- web-analytics-service
dbclusters:
- kafka
- druid
- rabbitmq
zkclusters:
- zookeeper
shared:
- eureka
bootstrap:
- consul
- census
我的解决方案应该创建与与每个安装点相对应的“儿童” SSM文档一个服务组,其中可能存在与每个安装点相关的多个EC2实例。我已经查看了以下网页,但是他们对我应该如何使用父母文件生成孩子的方式没有任何见解:
我如何将多个参数传递给aws ssm send_command with boto3 https://docs.aws。 Amazon.com/systems-manager/latest/userguide/create-ssm-document-api.html
I have been assigned a task to develop a solution that shut down all microservice processes running on a given EC2 instance in parallel and then shut down the EC2 instance itself and do this on a set of EC2 instances in parallel. This is supposed to take input from a YAML configuration file (let's call it the parent) similar to the following that identifies the mount point of the micro services:
fabric: usprod1
sequence:
stateless:
- admin-portal
- dashboard
- haraka
- vm-prometheus
- watchtower-server
- web-analytics-service
dbclusters:
- kafka
- druid
- rabbitmq
zkclusters:
- zookeeper
shared:
- eureka
bootstrap:
- consul
- census
My solution is supposed to create "child" SSM documents that correspond to each mount point within a service group where there might be multiple EC2 instances associated with each mount point. I've reviewed the following web pages, but they don't give me any insight as to how I'm supposed to use the parent YAML file to generate the children:
How do I pass multiple parameters to AWS SSM send_command with Boto3
https://docs.aws.amazon.com/systems-manager/latest/userguide/create-ssm-document-api.html
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可以使用几种方法来解决此情况,但我建议您在lambda或步骤函数首先,然后您应该很好。
This case can be tackled using few approaches but I would suggest do some reading on Lambda or Step Functions first and then you should be good to go.