projectscope

package
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2026 License: Apache-2.0 Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package projectscope owns the policy for which Kernel project a single operation targets. An explicit attribute value wins, then the provider-level default. Empty means unscoped: no project header is sent and the API key's binding decides the project.

Resolve is for operations driven by configuration (resource Create, data source Read). Operations on existing resources (Read, Update, Delete) must use the project recorded in state instead, so a later change to the provider default never re-points them at a different project.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddError

func AddError(diags *diag.Diagnostics, operation, projectID string, err error)

AddError records err for a project-scoped operation. On calls that explicitly targeted a project, a 403 becomes a project-access diagnostic and a project_not_found 404 becomes a project diagnostic, both on project_id; every other error keeps its raw text under the operation name.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound reports whether err is the API's coded resource-not-found response. A 404 without code "not_found" — such as the middleware's project_not_found for a missing or suspended project — does not mean the resource is gone and must not remove it from state.

func Resolve

func Resolve(attribute types.String, defaultProjectID string) string

Resolve returns the project for a config-driven operation: the attribute value when set, otherwise the provider-level default. Unknown must fall back to the default, not error: an Optional+Computed resource attribute left unset arrives at apply time as unknown.

func ResolveDataSource

func ResolveDataSource(diags *diag.Diagnostics, attribute types.String, defaultProjectID string) string

ResolveDataSource resolves the project for a data source read. Terraform normally defers data source reads until the configuration is wholly known, but the framework documents that Config may still carry unknown values; an unknown project must error rather than silently read the provider default.

func StateValue

func StateValue(projectID string) types.String

StateValue converts a resolved project into its state representation: null when unscoped, so reads stay with the API key's binding.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL