func configureDefaults()

in internal/provider/provider.go [444:497]


func configureDefaults(ctx context.Context, data *gen.AlzModel) {
	// Use azure public cloud by default.
	if data.Environment.IsNull() {
		data.Environment = types.StringValue("public")
	}

	// Do not skip provider registration by default.
	if data.SkipProviderRegistration.IsNull() {
		data.SkipProviderRegistration = types.BoolValue(false)
	}

	// Do not use OIDC auth by default.
	if data.UseOidc.IsNull() {
		data.UseOidc = types.BoolValue(false)
	}

	// Do not use MSI auth by default.
	if data.UseMsi.IsNull() {
		data.UseMsi = types.BoolValue(false)
	}

	// Use CLI auth by default.
	if data.UseCli.IsNull() {
		data.UseCli = types.BoolValue(true)
	}

	// Do not allow library overwrite by default.
	if data.LibraryOverwriteEnabled.IsNull() {
		data.LibraryOverwriteEnabled = types.BoolValue(false)
	}

	// Automatically download dependencies by default.
	if data.LibraryFetchDependencies.IsNull() {
		data.LibraryFetchDependencies = types.BoolValue(true)
	}

	// Set alz library references to the default value if not already set.
	if data.LibraryReferences.IsNull() {
		element := gen.NewLibraryReferencesValueMust(
			gen.NewLibraryReferencesValueNull().AttributeTypes(ctx),
			map[string]attr.Value{
				"ref":        types.StringValue(alzLibRef),
				"path":       types.StringValue(alzLibPath),
				"custom_url": types.StringNull(),
			},
		)
		data.LibraryReferences = types.ListValueMust(element.Type(ctx), []attr.Value{element})
	}

	// Do not skip warning policy role assignments by default.
	if data.SuppressWarningPolicyRoleAssignments.IsNull() {
		data.SuppressWarningPolicyRoleAssignments = types.BoolValue(false)
	}
}