简体   繁体   English

如何在 Pulumi 中实现共享资源

[英]How to implement shared resources in Pulumi

I'm trying to understand how to implement Pulumi in our AWS environment.我试图了解如何在我们的 AWS 环境中实施 Pulumi。

I understand that a stack can be used to have the same resource structure for production and development, but that results in independant instances, which is great.我知道可以使用堆栈来为生产和开发提供相同的资源结构,但这会产生独立的实例,这很棒。

However we also have a shared management VPC where certain tools reside such as pgadmin, gitlab, monitoring tools,...但是,我们也有一个共享管理 VPC,其中驻留了某些工具,例如 pgadmin、gitlab、监控工具……

So what would be the best approach for that?那么最好的方法是什么?

  • Force a stack for that management project (if that is possible)?为该管理项目强制堆栈(如果可能的话)?
  • Put a constraint in code so that this management stuff is only deployed in production stack?在代码中设置约束,以便这些管理内容仅部署在生产堆栈中?

Or am I missing the approach of stacks here?还是我在这里错过了堆栈的方法?

Your first thought is the right way to go.您首先想到的是 go 的正确方法。 Deploy shared resources in their own stack(s) and use Stack References to share information across stacks.在自己的堆栈中部署共享资源,并使用堆栈引用跨堆栈共享信息。

These links discuss these concepts: https://www.pulumi.com/docs/intro/concepts/organizing-stacks-projects/ https://www.pulumi.com/docs/intro/concepts/programming-model/#stack-references这些链接讨论了这些概念: https://www.pulumi.com/docs/intro/concepts/organizing-stacks-projects/ https://www.pulumi.com/docs/intro/concepts/programming-model/#stack -参考

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM