用于在terrascript组件之间共享变量的terraobject包

terraobject的Python项目详细描述


TerraObject

用于在terrascript组件之间共享变量的terraobject包

您可以使用terraobject为多个类设置参数,并共享其他terraform资源使用的资源。

示例:

# Create the referencefromterraobjectimportTerraobject# Import the terrascript resources you needfromterrascriptimportproviderfromterrascript.digitalocean.dimportdigitalocean_volume# Create the objecto=Terraobject()# Add the providers, resources, data, as usualo.terrascript.add(provider("digitalocean",token="tokentoken"))# Get some info (e.g. data) and share to be used on other commandspersistent_volume=digitalocean_volume("persistent_volume",name="volume-nyc3-01",region="abc")o.terrascript.add(persistent_volume)o.shared['persistent_volume']=persistent_volume# And you can use and another place:o.shared['persistent_volume'].name# Dump the XMLprint(o.terrascript.dump())

有关terrascript的更多信息:

https://github.com/mjuenema/python-terrascript

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java如何在jetty请求日志中添加milliscond字段?   java在使用Scanner类从文件读取信息时遇到问题   为什么。类不适用于泛型类型?   SQLite插入上的java空指针异常   java能告诉我们Guava缓存是在禁用统计数据的情况下构建的吗?   java在应用程序中使用常量   java无法使用AutoIT和Selenium Webdriver在所需位置/文件夹保存图像   java如何在jtable中更新jprogress栏   java是比较给定日期和当前日期(在给定时区中没有时间段)的最佳方法   安卓代码中的java错误   java无法访问实体类中的字段   java如何在tomcat中处理三个JDBC连接池?   java无法使用Spring Security保护AngularJS页面   如何在没有TCP/IP协议栈的情况下用Java发送以太帧