Module terraform

Typedefs

typedef terraform::config::nesting_mode_t
  • Base type string

  • Type constraint (self in ['set','list','dict','single'])

Entities

entity terraform::Provider

Parents: std::Entity

A Terraform provider

attribute string namespace

Organization in the terraform registry, packaging this provider

attribute string type

The provider type (e.g. “aws”, “vsphere”, “local”)

attribute string version='latest'

The version of the provider to use, setting it to null will get the latest one

attribute string alias=''

An alias to differentiate this provider from other providers with the same binary but different config

attribute dict config

The config to apply to this provider

attribute bool manual_config=true

Whether the user wishes to provide the config as a dict, if false the config should be provided as a config block entity tree via the root_config relation.

attribute bool auto_agent=true

Whether to start an agent automatically or not. If set to false the relation agent_config should be set manually. :rel agent_config: This needs to be set only if auto_agent=false

relation std::AgentConfig agent_config [1]

Relation to the agent config

relation terraform::config::Block root_config [0:1]

Relation to the root configuration, or null if manual_config is true

The following implementations are defined for this entity:

The following implements statements select implementations for this entity:

entity terraform::Resource

Parents: std::PurgeableResource

A Terraform resource

attribute string type

The type of resource this is

attribute string name

An arbitrary name to identify this resource

attribute string? terraform_id=null

If this is set, and the resource state is not stored in parameter yet, the handler will first try to import it, using the provided value as terraform id. :rel provider: The terraform provider for this resource

attribute dict config

The configuration for this resource

attribute bool manual_config=true

Whether the user wishes to provide the config as a dict, if false the config should be provided as a config block entity tree via the root_config relation.

attribute bool purge_on_delete=false
relation terraform::Provider provider [1]

Relation to the resource provider

relation terraform::config::Block root_config [0:1]

Relation to the root configuration, or null if manual_config is true

The following implementations are defined for this entity:

The following implements statements select implementations for this entity:

entity terraform::config::Block

Parents: std::Entity

This entity represents a block of attributes in a terraform module. It can be used for anyone using the module to build a config. It is being used by the generator to generate the config of a resource or provider.

Source for the schema:

https://github.com/inmanta/inmanta-tfplugin/blob/7269bc7d28d751b5dc110161dae29a6209c3fb63/docs/tf_grpc_plugin/proto/inmanta_tfplugin/tfplugin5.proto

tfplugin5.proto: L81: message Block { L82: int64 version = 1; L83: repeated Attribute attributes = 2; L84: repeated NestedBlock block_types = 3; L85: string description = 4; L86: StringKind description_kind = 5; L87: bool deprecated = 6; L88: }

attribute string name

The name of this config section in the parent config block.

attribute dict attributes

A dictionary of attributes. The key is the attribute name as specified in the terraform provider schema. The value is the value assigned to this attribute in the corresponding inmanta entity.

attribute bool deprecated=false

If true, will raise a warning everytime the configuration block is used.

attribute terraform::config::nesting_mode_t nesting_mode='single'
attribute string? key=null

The key, required for list and dict nesting mode, ignored otherwise.

attribute dict _config

Generated, the serialized version of this config. i.e. The following configuration structure can be constructed with entities. .. code-block:: terraform::config::Block( name=”root”, attributes={“name”: “Albert”}, children=[ terraform::config::Block( name=”children”, attributes={“name”: “Bob”, “age”: 12}, nesting_mode=”set”, ), terraform::config::Block( name=”children”, attributes={“name”: “Alice”, “age”: 14}, nesting_mode=”set”, ), terraform::config::Block( name=”pets”, attributes={“type”: “dog”}, nesting_mode=”dict”, key=”Brutus”, ), terraform::config::Block( name=”favorite_dishes”, attributes={“name”: “Pizza”}, nesting_mode=”list”, key=”1”, ), terraform::config::Block( name=”favorite_dishes”, attributes={“name”: “Pasta”}, nesting_mode=”list”, key=”2”, ) ], parent=null, ) It will be serialized as follows (the order of the children list might differ): .. code-block:: { “name”: “Albert”, “children”: [ { “name”: “Alice”, “age”: 14, }, { “name”: “Bob”, “age”: 12, }, ], “pets”: { “Brutus”: { “type”: “dog”, }, }, “favorite_dishes”: [ {“name”: “Pizza”}, {“name”: “Pasta”}, ], }

relation terraform::config::Block children [0:*]

other end: terraform::config::Block.parent [0:1]

relation terraform::config::Block parent [0:1]

other end: terraform::config::Block.children [0:*]

The following implementations are defined for this entity:

The following implements statements select implementations for this entity:

Implementations

implementation terraform::agentConfig
implementation terraform::providerConfig

If self.manual_config is true, the user should provide the config as a dict directly to the entity. The root_config relation should then be set to null. If self.manual_config is false, the user should provide the root_config relation, the Block entity will be serialized and attached to this entity config attribute.

implementation terraform::resourceConfig

If self.manual_config is true, the user should provide the config as a dict directly to the entity. The root_config relation should then be set to null. If self.manual_config is false, the user should provide the root_config relation, the Block entity will be serialized and attached to this entity config attribute.

implementation terraform::config::deprecation_warning

Send a warning that the usage of this block is deprecated

implementation terraform::config::serialize

Serialize this block into a config dict.

Plugins

terraform.deprecated_config_block(config_block: terraform::config::Block)

Log a warning for the usage of a deprecated config block

terraform.get_resource_attribute(resource: terraform::Resource, attribute_path: any) any

Get a resource attribute from the saved parameters (facts). :param resource: The resource we which to get an attribute from. :param attribute_path: The path, in the resource state dict, to the desired value.

terraform.get_resource_attribute_ref(resource: terraform::Resource, attribute_path: any) dict

Get a resource attribute reference. The difference with get_resource_attribute is that the value is not resolved at compile time but during the handler execution. This means that:

  1. The value can not be manipulated in the model.

  2. We save some time during the compile as we don’t need to make api calls.

  3. We avoid multiple recompile due to unknown values.

  4. If the targeted value changes, but none of the other attributes of this

    resource, we will need a full deploy to have our value up to date.

Parameters
  • resource – The resource we which to get an attribute from.

  • attribute_path – The path, in the resource state dict, to the desired value.

terraform.serialize_config(config_block: terraform::config::Block) dict

Serialize a config block into a dictionnary.

Resources

class terraform.terraform_resource.TerraformResource

Handlers

class terraform.terraform_resource.TerraformResourceHandler