用于在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在Hibernate中是否可以实现独占析取?   java使用Hashset计算数组中的字符串数量,无重复项   javascript如何在java中使用正则表达式实现字符限制?   java是否有最大值或输出到BigInteger?   java无法正确生成校验和   简单的java程序“你好,世界!”在eclipse中安装Android插件后不工作   使用Eureka服务器AWS Elastic Beanstalk注册java Eureka客户端   Liferay中的javajunit和mock   java Hibernate如何正确使用关系中的级联   javajlabel。setText的工作方式很奇怪   java Search()StringIndexOutOfBoundsException   是否可以使用Java将PDF文档转换为Word?   java在iText元素上添加阴影效果