hashicorp / hashicorp/terraform-plugin-framework

Add "optional attribute" support for types.Object

Open
#955 4 comments 3 reactions 0 assignees View on GitHub
enhancement
Dominant language
Go
Stars
384
Forks
107
Avg merge
3m
Merged PRs (30d)
1

Description

### Module version

```
v1.6.1
```

### Relevant provider source code

```go
function.ObjectParameter{
Name: "args",
Description: "Extra variables for use in format.",
AllowNullValue: true,
AttributeTypes: map[string]attr.Type{
"location": types.StringType,
"extra_tokens": types.MapType{ElemType: types.StringType},
},
},
```

### Terraform Configuration Files

```hcl
provider::namep::custom_name("test", "azurerm_resource_group", { location = "westeurope" })
```

### Expected Behavior

extra_tokens should be null since it wasn't passed

### Actual Behavior

The function call fails and forces the user to explicitly pass `extra_tokens = null`

### Steps to Reproduce

Create a provider function
Have at least one parameter be an ObjectParameter
Try to call the function without explicitly passing every argument

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.