Skip to content

Commit

Permalink
metadata_host is marked as required upstream but actually isn't (#1233)
Browse files Browse the repository at this point in the history
Resolves #362 - users of this provider need to specify this config even
if the default is fine.

The upstream provider [has this property marked as required](https://github.com/hashicorp/terraform-provider-azuread/blob/6594e1c6cd59ffc7f5e9a881412609d9cde816e7/internal/provider/provider.go#L126),
but that works differently in Terraform: since there's also a
`DefaultFunc` configured, the function's return value will be used if
the user doesn't specify a value, and the function itself returns a
default of `""`. So a value is guaranteed, even if it's the empty
string.

In Pulumi, "required" means needs to be configured by the user.
Therefore, we mark this property as optional to get the same behavior as
upstream.
  • Loading branch information
thomas11 authored Jul 19, 2024
1 parent e75c2de commit 13dbb59
Show file tree
Hide file tree
Showing 9 changed files with 48 additions and 64 deletions.
11 changes: 2 additions & 9 deletions provider/cmd/pulumi-resource-azuread/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,7 @@
}
},
"defaults": [
"environment",
"metadataHost"
"environment"
]
},
"types": {
Expand Down Expand Up @@ -3141,9 +3140,6 @@
"description": "Allow OpenID Connect to be used for authentication\n"
}
},
"required": [
"metadataHost"
],
"inputProperties": {
"clientCertificate": {
"type": "string",
Expand Down Expand Up @@ -3248,10 +3244,7 @@
"type": "boolean",
"description": "Allow OpenID Connect to be used for authentication\n"
}
},
"requiredInputs": [
"metadataHost"
]
}
},
"resources": {
"azuread:index/accessPackage:AccessPackage": {
Expand Down
3 changes: 3 additions & 0 deletions provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,9 @@ func Provider() tfbridge.ProviderInfo {
EnvVars: []string{"ARM_ENVIRONMENT"},
},
},
"metadata_host": {
MarkAsOptional: tfbridge.True(),
},
"msi_endpoint": {
Default: &tfbridge.DefaultInfo{
EnvVars: []string{"ARM_MSI_ENDPOINT"},
Expand Down
8 changes: 4 additions & 4 deletions sdk/dotnet/Provider.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 6 additions & 10 deletions sdk/go/azuread/provider.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions sdk/java/src/main/java/com/pulumi/azuread/Config.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions sdk/java/src/main/java/com/pulumi/azuread/Provider.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 5 additions & 9 deletions sdk/java/src/main/java/com/pulumi/azuread/ProviderArgs.java

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 3 additions & 6 deletions sdk/nodejs/provider.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

37 changes: 18 additions & 19 deletions sdk/python/pulumi_azuread/provider.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 13dbb59

Please sign in to comment.