Skip to content

Add "optional attribute" support for types.ObjectΒ #955

@jason-johnson

Description

@jason-johnson

Module version

v1.6.1

Relevant provider source code

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

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions