Documentation
¶
Index ¶
- Constants
- Variables
- func AgentAccessTokenExpiresAt(account Account, now time.Time) (*time.Time, bool)
- func AgentCredentialsFallbackEnabled() bool
- func ClearAgentClaimUnavailable() error
- func DeleteAccount(key string) error
- func DeleteAgentAccount(key string) error
- func DeleteAgentCredentials() error
- func DeleteAllAccounts() error
- func DeleteAllAccountsAndCredentialsKey() error
- func DeleteExpiredAgentCredentials(now time.Time) (bool, error)
- func DetectPluginPathAt(dir string) (string, error)
- func DetectPluginPathFrom(dir string) (string, error)
- func DetectPolicyPackPathAt(path string) (string, error)
- func DetectPolicyPackPathFrom(path string) (string, error)
- func DetectProjectPath() (string, error)
- func DetectProjectPathFrom(dir string) (string, error)
- func DownloadToFile(ctx context.Context, pkgPlugin PluginDescriptor, ...) (*os.File, error)
- func GetAgentAccessTokenExpiresAt(cloudURL string, now time.Time) (*time.Time, bool, error)
- func GetPluginDir() (string, error)
- func GetPluginPath(ctx context.Context, d diag.Sink, spec PluginDescriptor, ...) (string, error)
- func GetPolicyDir(orgName string) (string, error)
- func GetPolicyPath(orgName, name, version string) (string, bool, error)
- func GetPulumiHomeDir() (string, error)
- func GetPulumiPath(elem ...string) (string, error)
- func HasPlugin(spec PluginDescriptor) bool
- func HasPluginGTE(spec PluginDescriptor) (bool, *semver.Version, error)
- func InferFullTypeName(typeName string, itemsType *ProjectConfigItemsType) string
- func IsExternalURL(source string) bool
- func IsPluginBundled(kind apitype.PluginKind, name string) bool
- func IsPluginKind(k string) booldeprecated
- func IsUndecryptableCredentials(err error) bool
- func MarkAgentClaimUnavailable(unavailableAt time.Time) error
- func NewMissingError(spec PluginDescriptor, includeAmbient bool) error
- func ProjectStackPath(projPath string, proj *Project, stackName tokens.QName) string
- func ResetStoredCredentials() error
- func RetrieveGitFolder(ctx context.Context, rawurl string, path string) (string, error)deprecated
- func RewriteConfigPathIntoStackConfigDir(project map[string]any) (map[string]any, error)
- func RewriteShorthandConfigValues(project map[string]any) map[string]any
- func SetBackendConfigDefaultOrg(backendURL, defaultOrg string) error
- func SimplifyMarshalledProject(raw any) (map[string]any, error)
- func SimplifyMarshalledValue(raw any) (any, error)
- func SortPackageDescriptors(x PackageDescriptor, y PackageDescriptor) int
- func StoreAccount(key string, account Account, current bool) error
- func StoreAgentAccount(key string, account Account, current bool) error
- func StoreAgentClaim(claim AgentClaim) error
- func StoreAgentCredentials(creds Credentials) error
- func StoreCredentials(creds Credentials) error
- func StorePulumiConfig(config PulumiConfig) error
- func SuppressPlaintextPendingWarning()
- func ValidateConfigValue(typeName string, itemsType *ProjectConfigItemsType, value any) bool
- func ValidateProject(raw any) error
- type Account
- type AgentClaim
- type Analyzers
- type BackendConfig
- type BaseProject
- type CredentialHelper
- type Credentials
- type Environment
- func (e *Environment) Append(envs ...string) *Environment
- func (e *Environment) Definition() []byte
- func (e *Environment) DefinitionNode() (*yaml.Node, error)
- func (e *Environment) Imports() []string
- func (e Environment) MarshalJSON() ([]byte, error)
- func (e Environment) MarshalYAML() (any, error)
- func (e *Environment) Remove(env string) *Environment
- func (e *Environment) UnmarshalJSON(b []byte) error
- func (e *Environment) UnmarshalYAML(n *yaml.Node) error
- type LinkablePackageDescriptor
- type MissingError
- type PackageDescriptor
- type PackageSpec
- func (p PackageSpec) LogValue() slog.Value
- func (ps PackageSpec) MarshalJSON() ([]byte, error)
- func (ps PackageSpec) MarshalYAML() (any, error)
- func (p PackageSpec) String() string
- func (ps *PackageSpec) UnmarshalJSON(bytes []byte) error
- func (ps *PackageSpec) UnmarshalYAML(unmarshal func(any) error) error
- type Parameterization
- type PluginDescriptor
- func (spec PluginDescriptor) Dir() string
- func (spec PluginDescriptor) DirPath() (string, error)
- func (spec PluginDescriptor) Download(ctx context.Context) (io.ReadCloser, int64, error)
- func (spec PluginDescriptor) File() string
- func (spec PluginDescriptor) GetLatestVersion(ctx context.Context) (*semver.Version, error)
- func (spec PluginDescriptor) GetSource() (PluginSource, error)
- func (spec PluginDescriptor) IsGitPlugin() bool
- func (spec PluginDescriptor) LocalName() (string, string)
- func (spec PluginDescriptor) LockFilePath() (string, error)
- func (spec PluginDescriptor) PartialFilePath() (string, error)
- func (spec PluginDescriptor) String() string
- func (spec PluginDescriptor) SubDir() string
- type PluginFS
- type PluginInfo
- func GetPluginInfo(ctx context.Context, d diag.Sink, spec PluginDescriptor, ...) (*PluginInfo, error)
- func GetPlugins() ([]PluginInfo, error)
- func GetPluginsFromDir(dir string) ([]PluginInfo, error)
- func LegacySelectCompatiblePlugin(plugins []PluginInfo, spec PluginDescriptor) *PluginInfo
- func SelectCompatiblePlugin(plugins []PluginInfo, spec PluginDescriptor) *PluginInfo
- func SelectPrereleasePlugin(plugins []PluginInfo, spec PluginDescriptor) *PluginInfo
- type PluginKinddeprecated
- type PluginOptions
- type PluginProject
- type PluginSource
- type PluginSpecdeprecated
- type PluginTemplate
- type PluginVersionNotFoundError
- type Plugins
- type PolicyPackProject
- type Project
- func (proj *Project) AddConfigStackTags(tags map[string]string)
- func (proj *Project) AddPackage(name string, spec PackageSpec)
- func (proj *Project) GetPackageSpecs() map[string]PackageSpec
- func (proj Project) RawValue() []byte
- func (proj Project) RuntimeInfo() *ProjectRuntimeInfo
- func (proj *Project) Save(path string) error
- func (proj *Project) Validate() error
- type ProjectBackend
- type ProjectConfigItemsType
- type ProjectConfigType
- type ProjectOptions
- type ProjectPlugin
- type ProjectRuntimeInfo
- func (info ProjectRuntimeInfo) IsZero() bool
- func (info ProjectRuntimeInfo) MarshalJSON() ([]byte, error)
- func (info ProjectRuntimeInfo) MarshalYAML() (any, error)
- func (info *ProjectRuntimeInfo) Name() string
- func (info *ProjectRuntimeInfo) Options() map[string]any
- func (info *ProjectRuntimeInfo) SetOption(key string, value any)
- func (info *ProjectRuntimeInfo) UnmarshalJSON(data []byte) error
- func (info *ProjectRuntimeInfo) UnmarshalYAML(unmarshal func(any) error) error
- type ProjectStack
- type ProjectTemplate
- type ProjectTemplateConfigValue
- type PulumiConfig
- type SortedPluginInfo
- type TokenInformation
- type UndecryptableCredentialsError
- type UnresolvedPackageDescriptor
Constants ¶
const ( // BookkeepingDir is the name of our bookkeeping folder, we store state here (like .git for git). BookkeepingDir = pulumihome.BookkeepingDir // PluginDir is the name of the directory containing plugins. PluginDir = "plugins" // PolicyDir is the name of the directory that holds policy packs. PolicyDir = "policies" // ProjectFile is the base name of a project file. ProjectFile = "Pulumi" // PulumiHomeEnvVar is a path to the '.pulumi' folder with plugins, access token, etc. // The folder can have any name, not necessarily '.pulumi'. // It defaults to the '<user's home>/.pulumi' if not specified. // // Deprecated: use [github.com/pulumi/pulumi/sdk/v3/go/common/env.Home] instead. PulumiHomeEnvVar = "PULUMI_HOME" // PolicyPackFile is the base name of a Pulumi policy pack file. PolicyPackFile = "PulumiPolicy" // PluginFile is the base name of a Pulumi plugin file. PluginFile = "PulumiPlugin" )
const ( AnalyzerPlugin = apitype.AnalyzerPlugin LanguagePlugin = apitype.LanguagePlugin ResourcePlugin = apitype.ResourcePlugin ConverterPlugin = apitype.ConverterPlugin ToolPlugin = apitype.ToolPlugin )
ProductKind types definition
Deprecated: PluginKind type was moved to "github.com/pulumi/pulumi/sdk/v3/go/common/apitype"
const PulumiCredentialsPathEnvVar = "PULUMI_CREDENTIALS_PATH"
PulumiCredentialsPathEnvVar is a path to the folder where credentials are stored. We use this in testing so that tests which log in and out do not impact the local developer's credentials or tests interacting with one another
const PulumiTagsConfigKey = "pulumi:tags"
To mitigate an import cycle, we define this here.
Variables ¶
var ( ErrProjectNotFound = errors.New("no project file found") ErrPluginNotFound = errors.New("no plugin file found") ErrBaseProjectNotFound = fmt.Errorf("%w and %w", ErrProjectNotFound, ErrPluginNotFound) )
var ( ErrNoManagedDefinition = errors.New("environment definition must be a YAML mapping with at least one key") ErrJSONManagedDefinition = errors.New("environment definition is JSON, not YAML") )
var ErrGetLatestVersionNotSupported = errors.New("GetLatestVersion is not supported for plugins from http sources")
var PluginNameRegexp = func() *regexp.Regexp { part := func(name string) string { return "(?P<" + name + ">[a-zA-Z0-9-][a-zA-Z0-9-_.]*[a-zA-Z0-9])" } return regexp.MustCompile(`^((` + part("Source") + `/)?(` + part("Publisher") + `/))?` + part("Name") + `$`) }()
var ProjectSchema *jsonschema.Schema
Functions ¶
func AgentAccessTokenExpiresAt ¶ added in v3.243.0
AgentAccessTokenExpiresAt returns the locally stored agent account access-token expiration, plus whether that expiration is still in the future.
func AgentCredentialsFallbackEnabled ¶ added in v3.245.0
func AgentCredentialsFallbackEnabled() bool
AgentCredentialsFallbackEnabled reports whether shared temporary agent credentials may be used as an implicit fallback.
func ClearAgentClaimUnavailable ¶ added in v3.262.0
func ClearAgentClaimUnavailable() error
ClearAgentClaimUnavailable removes a persisted claim-unavailable marker, e.g. after the service reports the claim usable again.
func DeleteAccount ¶
DeleteAccount deletes an account underneath the given key.
func DeleteAgentAccount ¶ added in v3.243.0
DeleteAgentAccount deletes an account from the shared temporary agent credentials file and removes matching claim and backend config metadata.
func DeleteAgentCredentials ¶ added in v3.243.0
func DeleteAgentCredentials() error
DeleteAgentCredentials removes shared temporary agent credentials, claim metadata, and config.
func DeleteAllAccounts ¶
func DeleteAllAccounts() error
func DeleteAllAccountsAndCredentialsKey ¶ added in v3.265.0
func DeleteAllAccountsAndCredentialsKey() error
DeleteAllAccountsAndCredentialsKey is DeleteAllAccounts that also deletes the credentials encryption key shared by all credentials files.
func DeleteExpiredAgentCredentials ¶ added in v3.243.0
DeleteExpiredAgentCredentials removes shared temporary agent credentials when both the claim URL and access token have expired. It returns true when credentials were removed.
func DetectPluginPathAt ¶ added in v3.217.0
DetectPluginPathAt locates the PulumiPlugin file in the given directory. If no project is found, ErrPluginNotFound. Unlike DetectPluginPathFrom, this function does not search upwards in the directory hierarchy.
func DetectPluginPathFrom ¶ added in v3.171.0
DetectPluginPathFrom locates the closest plugin from the given path, searching "upwards" in the directory hierarchy. If no project is found, ErrPluginNotFound is returned.
func DetectPolicyPackPathAt ¶ added in v3.128.0
DetectPolicyPackPathAt locates the PulumiPolicy file at the given path. If no project is found, an empty path is returned. Unlike DetectPolicyPackPathFrom, this function does not search upwards in the directory hierarchy.
func DetectPolicyPackPathFrom ¶
DetectPolicyPackPathFrom locates the closest Pulumi policy project from the given path, searching "upwards" in the directory hierarchy. If no project is found, an empty path is returned.
func DetectProjectPath ¶
DetectProjectPath locates the closest project from the current working directory, or an error if not found.
func DetectProjectPathFrom ¶
DetectProjectPathFrom locates the closest project from the given path, searching "upwards" in the directory hierarchy. If no project is found, ErrProjectNotFound is returned.
func DownloadToFile ¶ added in v3.37.0
func DownloadToFile( ctx context.Context, pkgPlugin PluginDescriptor, wrapper func(stream io.ReadCloser, size int64) io.ReadCloser, retry func(err error, attempt int, limit int, delay time.Duration), ) (*os.File, error)
DownloadToFile downloads the given PluginInfo to a temporary file and returns that temporary file. This has some retry logic to re-attempt the download if it errors for any reason. The context supplied may be used for cancellable I/O.
func GetAgentAccessTokenExpiresAt ¶ added in v3.243.0
GetAgentAccessTokenExpiresAt returns the locally stored access-token expiration for the shared temporary agent credentials for cloudURL.
func GetPluginDir ¶
GetPluginDir returns the directory in which plugins on the current machine are managed.
func GetPluginPath ¶
func GetPluginPath(ctx context.Context, d diag.Sink, spec PluginDescriptor, projectPlugins []ProjectPlugin, ) (string, error)
GetPluginPath finds a plugin's path by its kind, name, and optional version. It will match the latest version that is >= the version specified. If no version is supplied, the latest plugin for that given kind/name pair is loaded, using standard semver sorting rules. A plugin may be overridden entirely by placing it on your $PATH, though it is possible to opt out of this behavior by setting PULUMI_IGNORE_AMBIENT_PLUGINS to any non-empty value.
func GetPolicyDir ¶
GetPolicyDir returns the directory in which an organization's Policy Packs on the current machine are managed.
func GetPolicyPath ¶
GetPolicyPath finds a PolicyPack by its name version, as well as a bool marked true if the path already exists and is a directory.
func GetPulumiHomeDir ¶
GetPulumiHomeDir returns the path of the '.pulumi' folder where Pulumi puts its artifacts.
func GetPulumiPath ¶
GetPulumiPath returns the path to a file or directory under the '.pulumi' folder. It joins the path of the '.pulumi' folder with elements passed as arguments.
func HasPlugin ¶
func HasPlugin(spec PluginDescriptor) bool
HasPlugin returns true if the given plugin exists.
func HasPluginGTE ¶
func HasPluginGTE(spec PluginDescriptor) (bool, *semver.Version, error)
HasPluginGTE returns the version selected if the given plugin exists at the given version number or greater.
func InferFullTypeName ¶ added in v3.44.0
func InferFullTypeName(typeName string, itemsType *ProjectConfigItemsType) string
func IsExternalURL ¶ added in v3.193.0
func IsPluginBundled ¶ added in v3.78.0
func IsPluginBundled(kind apitype.PluginKind, name string) bool
We currently bundle some plugins with "pulumi" and thus expect them to be next to the pulumi binary. Eventually we want to fix this so new plugins are true plugins in the plugin cache.
func IsPluginKind
deprecated
func IsUndecryptableCredentials ¶ added in v3.258.0
func MarkAgentClaimUnavailable ¶ added in v3.243.0
MarkAgentClaimUnavailable records that the shared temporary agent claim is no longer claimable.
func NewMissingError ¶
func NewMissingError( spec PluginDescriptor, includeAmbient bool, ) error
NewMissingError allocates a new error indicating the given plugin info was not found.
func ProjectStackPath ¶ added in v3.258.0
ProjectStackPath returns the stack-specific Pulumi.<stack-name>.<ext> path for the given project. Use this when the project location is already known (e.g. from a caller-supplied root) so the caller does not have to walk from CWD.
func ResetStoredCredentials ¶ added in v3.258.0
func ResetStoredCredentials() error
func RetrieveGitFolder
deprecated
func RewriteConfigPathIntoStackConfigDir ¶ added in v3.44.0
RewriteConfigPathIntoStackConfigDir checks if the project is using the old "config" property to declare a path to the stack configuration directory. If that is the case, we rewrite it such that the value in config: {value} is moved to stackConfigDir: {value}. if the user defines both values as strings, we error out.
func RewriteShorthandConfigValues ¶ added in v3.44.0
RewriteShorthandConfigValues rewrites short-hand version of configuration into a configuration type for example the following config block definition:
config: instanceSize: t3.mirco aws:region: us-west-2
will be rewritten into a typed value:
config:
instanceSize:
default: t3.micro
aws:region:
value: us-west-2
Note that short-hand values without namespaces (project config) are turned into a type where as short-hand values with namespaces (such as aws:region) are turned into a value.
func SetBackendConfigDefaultOrg ¶ added in v3.18.0
func SimplifyMarshalledProject ¶ added in v3.44.0
func SimplifyMarshalledValue ¶ added in v3.45.0
Cast any map[any] from the yaml decoder to map[string]
func SortPackageDescriptors ¶ added in v3.146.0
func SortPackageDescriptors(x PackageDescriptor, y PackageDescriptor) int
SortPackageDescriptors is a comparison function for PackageDescriptors that sorts by version, with version-less package descriptors appearing first. It returns -1 if the first argument should appear before the second, 0 if they are equal, and 1 if the first argument should appear after the second. Designed for use with functions like slices.SortFunc.
func StoreAccount ¶
StoreAccount saves the given account underneath the given key in the default credentials file.
func StoreAgentAccount ¶ added in v3.243.0
StoreAgentAccount saves the account for the given cloud URL in the shared temporary agent credentials file.
func StoreAgentClaim ¶ added in v3.243.0
func StoreAgentClaim(claim AgentClaim) error
StoreAgentClaim stores claim metadata for an automatically created agent account alongside the shared temporary agent credentials.
func StoreAgentCredentials ¶ added in v3.243.0
func StoreAgentCredentials(creds Credentials) error
StoreAgentCredentials replaces the shared temporary agent credentials file.
func StoreCredentials ¶
func StoreCredentials(creds Credentials) error
StoreCredentials updates the stored credentials on the machine, replacing the existing set. If the credentials are empty, the auth file will be deleted rather than just serializing an empty map.
func StorePulumiConfig ¶ added in v3.18.0
func StorePulumiConfig(config PulumiConfig) error
func SuppressPlaintextPendingWarning ¶ added in v3.258.0
func SuppressPlaintextPendingWarning()
SuppressPlaintextPendingWarning silences the "the next `pulumi login` will encrypt them" warning for commands that perform that migration themselves.
func ValidateConfigValue ¶ added in v3.44.0
func ValidateConfigValue(typeName string, itemsType *ProjectConfigItemsType, value any) bool
ValidateConfig validates the config value against its config type definition. We use this to validate the default config values alongside their type definition but also to validate config values coming from individual stacks.
func ValidateProject ¶ added in v3.40.1
Types ¶
type Account ¶
type Account struct {
// The access token for this account.
AccessToken string `json:"accessToken,omitempty"`
// The OAuth refresh token, if the server issued one alongside the access token. When set, the
// CLI exchanges this token at /api/oauth/token for a fresh access token whenever the current
// one expires. Held off-the-wire — only sent to the token endpoint, not on every request.
RefreshToken string `json:"refreshToken,omitempty"`
// The username for this account.
Username string `json:"username,omitempty"`
// The organizations for this account.
Organizations []string `json:"organizations,omitempty"`
// The last time this token was validated.
LastValidatedAt time.Time `json:"lastValidatedAt,omitempty"`
// Allow insecure server connections when using SSL.
Insecure bool `json:"insecure,omitempty"`
// Information about the token used to authenticate.
TokenInformation *TokenInformation `json:"tokenInformation,omitempty"`
// contains filtered or unexported fields
}
Account holds the information associated with a Pulumi account.
func GetAccount ¶
GetAccount returns an account underneath a given key.
Note that the account may not be fully populated: it may only have a valid AccessToken. In that case, it is up to the caller to fill in the username and last validation time.
func GetAccountWithAgentFallback ¶ added in v3.243.0
GetAccountWithAgentFallback returns an account from default credentials, or from shared temporary agent credentials when running in a detected agent environment without an explicit Pulumi credential path. The boolean return is true only when the returned account came from shared agent credentials.
func GetAgentAccount ¶ added in v3.243.0
GetAgentAccount returns the account for the given cloud URL from the shared agent credentials file.
func (Account) HasCredential ¶ added in v3.247.0
HasCredential reports whether this account carries anything the CLI can use to authenticate — either a current access token or a refresh token to mint one with. Used at credential-selection time so that an account with only a refresh token is treated as usable rather than skipped.
func (Account) Save ¶ added in v3.247.0
Save persists this account back to the credentials file it was loaded from. Returns an error if the account has no known source (constructed in memory rather than loaded) — callers in that case should use StoreAccount / StoreAgentAccount with an explicit destination.
func (*Account) SetCredentials ¶ added in v3.247.0
func (a *Account) SetCredentials(accessToken string, accessTokenExpiresAt time.Time, refreshToken string)
SetCredentials writes a credential-grant result to this account. A zero accessTokenExpiresAt or empty refreshToken keeps the existing value — for grant responses that omit the field (e.g. a refresh that didn't rotate the refresh token).
type AgentClaim ¶ added in v3.243.0
type AgentClaim struct {
ClaimURL string `json:"claimUrl"`
ClaimToken string `json:"claimToken,omitempty"`
ValidUntil time.Time `json:"validUntil"`
CloudURL string `json:"cloudUrl"`
}
AgentClaim is the claim metadata returned when the CLI automatically creates an account for an agent.
func GetAgentClaim ¶ added in v3.243.0
func GetAgentClaim() (AgentClaim, error)
GetAgentClaim returns claim metadata for an automatically created agent account, if one has been stored.
type BackendConfig ¶ added in v3.18.0
type BackendConfig struct {
DefaultOrg string `json:"defaultOrg,omitempty"` // The default org for this backend config.
}
type BaseProject ¶ added in v3.199.0
type BaseProject interface {
Validate() error
Save(path string) error
RuntimeInfo() *ProjectRuntimeInfo
AddPackage(name string, spec PackageSpec)
GetPackageSpecs() map[string]PackageSpec
}
BaseProject is the base interface for project types. Projects have runtime information (the language and its options) and packages.
func LoadBaseProjectFrom ¶ added in v3.211.0
func LoadBaseProjectFrom(wd string) (BaseProject, string, error)
Detect the nearest enclosing Pulumi Project or Pulumi Plugin root directory.
The returned BaseProject will be one of: - *PluginProject - *Project
The returned string is the path to the returned file. If no plugin or project is found upwards of wd, then ErrBaseProjectNotFound will be returned.
type CredentialHelper ¶ added in v3.274.0
CredentialHelper configures a local command that supplies backend credentials.
type Credentials ¶
type Credentials struct {
Version int `json:"version,omitempty"`
CredentialHelper *CredentialHelper `json:"credentialHelper,omitempty"`
Current string `json:"current,omitempty"` // the currently selected key.
Accounts map[string]Account `json:"accounts,omitempty"` // a map of backend URLs to account info.
}
Credentials hold backend accounts, the current backend, and optional helper configuration.
func GetAgentStoredCredentials ¶ added in v3.243.0
func GetAgentStoredCredentials() (Credentials, error)
GetAgentStoredCredentials returns credentials stored in the shared temporary agent credentials file.
func GetStoredCredentials ¶
func GetStoredCredentials() (Credentials, error)
GetStoredCredentials returns any credentials stored on the local machine.
func (Credentials) MarshalJSON ¶ added in v3.266.0
func (c Credentials) MarshalJSON() ([]byte, error)
type Environment ¶ added in v3.88.0
type Environment struct {
// contains filtered or unexported fields
}
func NewEnvironment ¶ added in v3.89.0
func NewEnvironment(envs []string) *Environment
func (*Environment) Append ¶ added in v3.95.0
func (e *Environment) Append(envs ...string) *Environment
func (*Environment) Definition ¶ added in v3.95.0
func (e *Environment) Definition() []byte
func (*Environment) DefinitionNode ¶ added in v3.273.0
func (e *Environment) DefinitionNode() (*yaml.Node, error)
DefinitionNode returns the environment's definition only if it is a non-empty YAML mapping, the form a stack-managed environment requires. The returned node backs this Environment, so edits to it are saved with the stack file.
func (*Environment) Imports ¶ added in v3.95.0
func (e *Environment) Imports() []string
func (Environment) MarshalJSON ¶ added in v3.88.0
func (e Environment) MarshalJSON() ([]byte, error)
func (Environment) MarshalYAML ¶ added in v3.88.0
func (e Environment) MarshalYAML() (any, error)
func (*Environment) Remove ¶ added in v3.95.0
func (e *Environment) Remove(env string) *Environment
func (*Environment) UnmarshalJSON ¶ added in v3.88.0
func (e *Environment) UnmarshalJSON(b []byte) error
func (*Environment) UnmarshalYAML ¶ added in v3.88.0
func (e *Environment) UnmarshalYAML(n *yaml.Node) error
type LinkablePackageDescriptor ¶ added in v3.203.0
type LinkablePackageDescriptor struct {
// Path to the package, either a binary artifact like a Python wheel, or a source directory.
Path string
// The descriptor for the package
Descriptor PackageDescriptor
}
LinkablePackageDescriptor contains the information necessary to link an SDK for a package specified by a PackageDescriptor into a project.
type MissingError ¶
type MissingError struct {
// contains filtered or unexported fields
}
MissingError is returned by functions that attempt to load plugins if a plugin can't be located.
func (*MissingError) Error ¶
func (err *MissingError) Error() string
func (*MissingError) Spec ¶ added in v3.227.0
func (err *MissingError) Spec() PluginDescriptor
Spec returns the descriptor of the plugin that is missing.
type PackageDescriptor ¶ added in v3.133.0
type PackageDescriptor struct {
// A specification for the plugin that provides the package.
PluginDescriptor
// An optional replacement parameterization to apply to the providing plugin
// to produce the package.
Parameterization *Parameterization
// An optional extension parameterization to apply to the providing plugin to
// produce the package. Extension parameterizations share the base plugin's
// source and are not separate providers.
ExtensionParameterization *Parameterization
}
A PackageDescriptor specifies a package: the source PluginSpec that provides it, and any parameterization that must be applied to that plugin in order to produce the package.
func NewPackageDescriptor ¶ added in v3.159.0
func NewPackageDescriptor(spec PluginDescriptor, parameterization *Parameterization) PackageDescriptor
func (PackageDescriptor) PackageName ¶ added in v3.144.0
func (pd PackageDescriptor) PackageName() string
PackageName returns the name of the package.
func (PackageDescriptor) PackageVersion ¶ added in v3.144.0
func (pd PackageDescriptor) PackageVersion() *semver.Version
PackageVersion returns the version of the package.
func (PackageDescriptor) String ¶ added in v3.144.0
func (pd PackageDescriptor) String() string
type PackageSpec ¶ added in v3.157.0
type PackageSpec struct {
// The "name" of the plugin.
//
// Source may be one of:
// - A simple name, like "pkg"
// - A registry double or triple: "org/pkg", "source/org/pkg"
// - A git URL, "git://github.com/pulumi/pulumi-example/path"
// - An un-prefixed URL, like github.com/pulumi/pulumi-example/path
// - A local path, like /usr/bin/pkg
Source string
// The version of the provider, may be Semver 2.0 or a git hash.
Version string
// Any parameters needed to configure the package.
Parameters []string
// if set will be used to validate the plugin downloaded matches. This is keyed by
// "$os-$arch", e.g. "linux-x64".
Checksums map[string][]byte
// The server to download the plugin from, if needed.
PluginDownloadURL string
// CLI args passed to the extension's Parameterize call. This must be implemented in the provider.
Extensions []string
// contains filtered or unexported fields
}
PackageSpec defines the structured format for a package dependency, as represented on disk.
When marshaling, PackageSpec will be represented as <source>@<version> if that is sufficient to represent the struct. Otherwise the full object will be used.
PackageSpecs are unresolved, and must be resolved before usage.
func (PackageSpec) LogValue ¶ added in v3.261.0
func (p PackageSpec) LogValue() slog.Value
func (PackageSpec) MarshalJSON ¶ added in v3.213.0
func (ps PackageSpec) MarshalJSON() ([]byte, error)
func (PackageSpec) MarshalYAML ¶ added in v3.213.0
func (ps PackageSpec) MarshalYAML() (any, error)
func (PackageSpec) String ¶ added in v3.219.0
func (p PackageSpec) String() string
func (*PackageSpec) UnmarshalJSON ¶ added in v3.213.0
func (ps *PackageSpec) UnmarshalJSON(bytes []byte) error
func (*PackageSpec) UnmarshalYAML ¶ added in v3.213.0
func (ps *PackageSpec) UnmarshalYAML(unmarshal func(any) error) error
type Parameterization ¶ added in v3.133.0
type Parameterization struct {
// The name of the package that will be produced by the parameterization.
Name string
// The version of the package that will be produced by the parameterization.
Version semver.Version
// A plugin-dependent bytestring representing the value of the parameter to be
// passed to the plugin.
Value []byte
}
A Parameterization may be applied to a supporting plugin to yield a package.
type PluginDescriptor ¶ added in v3.213.0
type PluginDescriptor struct {
Name string // the simple name of the plugin.
Kind apitype.PluginKind // the kind of the plugin (language, resource, etc).
Version *semver.Version // the plugin's semantic version, if present.
PluginDownloadURL string // an optional server to use when downloading this plugin.
// if set will be used to validate the plugin downloaded matches. This is keyed by "$os-$arch", e.g. "linux-x64".
Checksums map[string][]byte
}
PluginDescriptor is a resolved plugin, ready for download.
func NewPluginDescriptor ¶ added in v3.214.0
func NewPluginDescriptor( ctx context.Context, source string, kind apitype.PluginKind, version *semver.Version, pluginDownloadURL string, checksums map[string][]byte, ) (PluginDescriptor, error)
NewPluginDescriptor creates a new PluginDescriptor from a source string.
If you are using this to resolve a "package", consider using [packageresolution.Resolve] instead.
func NewPluginSpec
deprecated
added in
v3.145.0
func NewPluginSpec( ctx context.Context, source string, kind apitype.PluginKind, version *semver.Version, pluginDownloadURL string, checksums map[string][]byte, ) (PluginDescriptor, error)
NewPluginDescriptor creates a new PluginDescriptor from a source string.
If you are using this to resolve a "package", consider using [packageresolution.Resolve] instead.
Deprecated: NewPluginSpec has been renamed to NewPluginDescriptor.
func (PluginDescriptor) Dir ¶ added in v3.213.0
func (spec PluginDescriptor) Dir() string
Dir gets the expected plugin directory for this plugin.
func (PluginDescriptor) DirPath ¶ added in v3.213.0
func (spec PluginDescriptor) DirPath() (string, error)
DirPath returns the directory where this plugin should be installed.
func (PluginDescriptor) Download ¶ added in v3.213.0
func (spec PluginDescriptor) Download(ctx context.Context) (io.ReadCloser, int64, error)
Download fetches an io.ReadCloser for this plugin and also returns the size of the response (if known). The context allows for I/O cancellation.
func (PluginDescriptor) File ¶ added in v3.213.0
func (spec PluginDescriptor) File() string
File gets the expected filename for this plugin, excluding any platform specific suffixes (e.g. ".exe" on windows).
func (PluginDescriptor) GetLatestVersion ¶ added in v3.213.0
GetLatestVersion tries to find the latest version for this plugin. This is currently only supported for plugins we can get from github releases. The context allows for I/O cancellation.
func (PluginDescriptor) GetSource ¶ added in v3.213.0
func (spec PluginDescriptor) GetSource() (PluginSource, error)
func (PluginDescriptor) IsGitPlugin ¶ added in v3.213.0
func (spec PluginDescriptor) IsGitPlugin() bool
IsGitPlugin returns if the plugin comes from the git source
func (PluginDescriptor) LocalName ¶ added in v3.213.0
func (spec PluginDescriptor) LocalName() (string, string)
LocalName returns the local name of the plugin, which is used in the directory name, and a path within that directory if the plugin is located in a subdirectory.
func (PluginDescriptor) LockFilePath ¶ added in v3.213.0
func (spec PluginDescriptor) LockFilePath() (string, error)
LockFilePath returns the full path to the plugin's lock file used during installation to prevent concurrent installs.
func (PluginDescriptor) PartialFilePath ¶ added in v3.213.0
func (spec PluginDescriptor) PartialFilePath() (string, error)
PartialFilePath returns the full path to the plugin's partial file used during installation to indicate installation of the plugin hasn't completed yet.
func (PluginDescriptor) String ¶ added in v3.213.0
func (spec PluginDescriptor) String() string
func (PluginDescriptor) SubDir ¶ added in v3.213.0
func (spec PluginDescriptor) SubDir() string
SubDir gets the expected subdirectory for this plugin.
type PluginFS ¶ added in v3.252.0
type PluginFS interface {
Stat(name string) (os.FileInfo, error)
Remove(name string) error
RemoveAll(path string) error
GetTimes(fi os.FileInfo) times.Timespec
}
PluginFS captures the filesystem operations used by PluginInfo (see Delete and setFileMetadata). It exists so that plugin removal and metadata lookups can be exercised without touching the real filesystem. A PluginInfo with a nil FS uses the real filesystem.
type PluginInfo ¶
type PluginInfo struct {
Name string // the simple name of the plugin.
Path string // the path that a plugin was loaded from (this will always be a directory)
Kind apitype.PluginKind // the kind of the plugin (language, resource, etc).
Version *semver.Version // the plugin's semantic version, if present.
// FS is the filesystem backing the plugin's on-disk state. A nil FS uses the real filesystem.
FS PluginFS
// contains filtered or unexported fields
}
PluginInfo provides basic information about a plugin. Each plugin gets installed into a system-wide location, by default `~/.pulumi/plugins/<kind>-<name>-<version>/`. A plugin may contain multiple files, however the primary loadable executable must be named `pulumi-<kind>-<name>`.
func GetPluginInfo ¶ added in v3.35.0
func GetPluginInfo(ctx context.Context, d diag.Sink, spec PluginDescriptor, projectPlugins []ProjectPlugin, ) (*PluginInfo, error)
func GetPlugins ¶
func GetPlugins() ([]PluginInfo, error)
GetPlugins returns a list of installed plugins without size info and last accessed metadata. Plugin size requires recursively traversing the plugin directory, which can be extremely expensive with the introduction of nodejs multilang components that have deeply nested node_modules folders.
func GetPluginsFromDir ¶ added in v3.198.0
func GetPluginsFromDir(dir string) ([]PluginInfo, error)
func LegacySelectCompatiblePlugin ¶ added in v3.96.0
func LegacySelectCompatiblePlugin( plugins []PluginInfo, spec PluginDescriptor, ) *PluginInfo
LegacySelectCompatiblePlugin selects a plugin from the list of plugins with the given kind and name that satisfies the requested version. It returns the highest version plugin greater than the requested version, or an error if no such plugin could be found.
If there exist plugins in the plugin list that don't have a version, LegacySelectCompatiblePlugin will select them if there are no other compatible plugins available.
func SelectCompatiblePlugin ¶
func SelectCompatiblePlugin( plugins []PluginInfo, spec PluginDescriptor, ) *PluginInfo
SelectCompatiblePlugin selects a plugin from the list of plugins with the given kind and name that sastisfies the requested semver range. It returns the highest version plugin that satisfies the requested constraints, or an error if no such plugin could be found.
If there exist plugins in the plugin list that don't have a version, SelectCompatiblePlugin will select them if there are no other compatible plugins available.
func SelectPrereleasePlugin ¶ added in v3.147.0
func SelectPrereleasePlugin( plugins []PluginInfo, spec PluginDescriptor, ) *PluginInfo
SelectPrereleasePlugin selects a plugin from the list of plugins, which matches the exact version we are looking for, based on the commit hash.
func (*PluginInfo) Delete ¶
func (info *PluginInfo) Delete() error
Delete removes the plugin from the cache. It also deletes any supporting files in the cache, which includes any files that contain the same prefix as the plugin itself.
func (*PluginInfo) InstallTime ¶
func (info *PluginInfo) InstallTime() time.Time
InstallTime returns the time the plugin was installed.
func (*PluginInfo) LastUsedTime ¶
func (info *PluginInfo) LastUsedTime() time.Time
LastUsedTime returns the last time the plugin was used.
func (*PluginInfo) Size ¶
func (info *PluginInfo) Size() uint64
Size calculates the size of the plugin, in bytes.
func (*PluginInfo) Spec ¶ added in v3.39.0
func (info *PluginInfo) Spec() PluginDescriptor
Spec returns the PluginSpec for this PluginInfo
func (PluginInfo) String ¶
func (info PluginInfo) String() string
type PluginKind
deprecated
type PluginKind = apitype.PluginKind
Re exporting PluginKind to keep backward compatibility, this should be kept in sync with the definitions in sdk/go/common/apitype/plugins.go
Deprecated: PluginKind type was moved to "github.com/pulumi/pulumi/sdk/v3/go/common/apitype"
type PluginOptions ¶ added in v3.37.0
type PluginProject ¶
type PluginProject struct {
// Runtime is a required runtime that executes code.
Runtime ProjectRuntimeInfo `json:"runtime" yaml:"runtime"`
// Packages is a map of package dependencies that can be either strings or PackageSpecs
Packages map[string]PackageSpec `json:"packages,omitempty" yaml:"packages,omitempty"`
// The CLI version range required for this provider to work correctly. If no version range is specified, the
// provider will be considered compatible with any CLI version. The supported syntax for ranges is that of
// https://pkg.go.dev/github.com/blang/semver#ParseRange. For example ">=3.0.0", or "!3.1.2". Ranges can be AND-ed
// together by concatenating with spaces ">=3.5.0 !3.7.7", meaning greater-or-equal to 3.5.0 and not exactly 3.7.7.
// Ranges can be OR-ed with the `||` operator: "<3.4.0 || >3.8.0", meaning less-than 3.4.0 or greater-than 3.8.0.
RequiredPulumiVersion string `json:"requiredPulumiVersion,omitempty" yaml:"requiredPulumiVersion,omitempty"`
// Template is an optional template manifest, if this directory is a package template.
Template *PluginTemplate `json:"template,omitempty" yaml:"template,omitempty"`
}
func LoadPluginProject ¶
func LoadPluginProject(path string) (*PluginProject, error)
LoadPluginProject reads a plugin project definition from a file.
func (*PluginProject) AddPackage ¶ added in v3.199.0
func (proj *PluginProject) AddPackage(name string, spec PackageSpec)
func (*PluginProject) GetPackageSpecs ¶ added in v3.199.0
func (proj *PluginProject) GetPackageSpecs() map[string]PackageSpec
GetPackageSpecs returns a map of package names to their corresponding PackageSpecs
func (*PluginProject) RuntimeInfo ¶ added in v3.199.0
func (proj *PluginProject) RuntimeInfo() *ProjectRuntimeInfo
func (*PluginProject) Save ¶ added in v3.199.0
func (proj *PluginProject) Save(path string) error
func (*PluginProject) Validate ¶
func (proj *PluginProject) Validate() error
type PluginSource ¶ added in v3.26.0
type PluginSource interface {
// Download fetches an io.ReadCloser for this plugin and also returns the size of the response (if known).
// The context supplied enables I/O to be canceled as needed.
Download(ctx context.Context,
version semver.Version, opSy string, arch string,
getHTTPResponse func(*http.Request) (io.ReadCloser, int64, error)) (io.ReadCloser, int64, error)
// GetLatestVersion tries to find the latest version for this plugin. This is currently only supported for
// plugins we can get from GitHub releases. The context supplied enables I/O to be canceled as needed.
GetLatestVersion(ctx context.Context,
getHTTPResponse func(*http.Request) (io.ReadCloser, int64, error)) (*semver.Version, error)
// A base URL that can uniquely identify the source. Has the same structure as the PluginDownloadURL
// schema option. Example: "github://api.github.com/pulumi/pulumi-aws".
URL() string
}
PluginSource deals with downloading a specific version of a plugin, or looking up the latest version of it.
type PluginSpec
deprecated
added in
v3.39.0
type PluginSpec = PluginDescriptor
PluginSpec is a resolved plugin, ready for download.
Deprecated: workspace.PluginSpec has been renamed to PluginDescriptor. If you are looking for the unresolved variant, see PackageSpec.
type PluginTemplate ¶ added in v3.237.0
type PluginTemplate struct {
// Description is an optional description of the template.
Description string `json:"description,omitempty" yaml:"description,omitempty"`
// Quickstart contains optional text to be displayed after template creation.
Quickstart string `json:"quickstart,omitempty" yaml:"quickstart,omitempty"`
}
PluginTemplate is a manifest describing a package template, embedded in PulumiPlugin.yaml.
type PluginVersionNotFoundError ¶ added in v3.166.0
type PluginVersionNotFoundError error
type Plugins ¶ added in v3.37.0
type Plugins struct {
Providers []PluginOptions `json:"providers,omitempty" yaml:"providers,omitempty"`
Languages []PluginOptions `json:"languages,omitempty" yaml:"languages,omitempty"`
Analyzers []PluginOptions `json:"analyzers,omitempty" yaml:"analyzers,omitempty"`
}
type PolicyPackProject ¶
type PolicyPackProject struct {
// Runtime is a required runtime that executes code.
Runtime ProjectRuntimeInfo `json:"runtime" yaml:"runtime"`
// Version specifies the version of the policy pack. If set, it will override the
// version specified in `package.json` for Node.js policy packs.
Version string `json:"version,omitempty" yaml:"version,omitempty"`
// Main is an optional override for the program's main entry-point location.
Main string `json:"main,omitempty" yaml:"main,omitempty"`
// Description is an optional informational description.
Description *string `json:"description,omitempty" yaml:"description,omitempty"`
// Author is an optional author that created this project.
Author *string `json:"author,omitempty" yaml:"author,omitempty"`
// Website is an optional website for additional info about this project.
Website *string `json:"website,omitempty" yaml:"website,omitempty"`
// License is the optional license governing this project's usage.
License *string `json:"license,omitempty" yaml:"license,omitempty"`
// contains filtered or unexported fields
}
func LoadPolicyPack ¶
func LoadPolicyPack(path string) (*PolicyPackProject, error)
LoadPolicyPack reads a policy pack definition from a file.
func (PolicyPackProject) RawValue ¶ added in v3.50.0
func (proj PolicyPackProject) RawValue() []byte
func (*PolicyPackProject) Save ¶
func (proj *PolicyPackProject) Save(path string) error
Save writes a project definition to a file.
func (*PolicyPackProject) Validate ¶
func (proj *PolicyPackProject) Validate() error
type Project ¶
type Project struct {
// Name is a required fully qualified name.
Name tokens.PackageName `json:"name" yaml:"name"`
// Runtime is an optional runtime that executes code. Its name may be empty.
Runtime ProjectRuntimeInfo `json:"runtime,omitempty" yaml:"runtime,omitempty"`
// Main is an optional override for the program's main entry-point location.
Main string `json:"main,omitempty" yaml:"main,omitempty"`
// Description is an optional informational description.
Description *string `json:"description,omitempty" yaml:"description,omitempty"`
// Author is an optional author that created this project.
Author *string `json:"author,omitempty" yaml:"author,omitempty"`
// Website is an optional website for additional info about this project.
Website *string `json:"website,omitempty" yaml:"website,omitempty"`
// License is the optional license governing this project's usage.
License *string `json:"license,omitempty" yaml:"license,omitempty"`
// Config has been renamed to StackConfigDir.
Config map[string]ProjectConfigType `json:"config,omitempty" yaml:"config,omitempty"`
// StackConfigDir indicates where to store the Pulumi.<stack-name>.yaml files, combined with the folder
// Pulumi.yaml is in.
StackConfigDir string `json:"stackConfigDir,omitempty" yaml:"stackConfigDir,omitempty"`
// Template is an optional template manifest, if this project is a template.
Template *ProjectTemplate `json:"template,omitempty" yaml:"template,omitempty"`
// Backend is an optional backend configuration
Backend *ProjectBackend `json:"backend,omitempty" yaml:"backend,omitempty"`
// Options is an optional set of project options
Options *ProjectOptions `json:"options,omitempty" yaml:"options,omitempty"`
// Packages is a map of package dependencies that can be either strings or PackageSpecs
Packages map[string]PackageSpec `json:"packages,omitempty" yaml:"packages,omitempty"`
Plugins *Plugins `json:"plugins,omitempty" yaml:"plugins,omitempty"`
// Handle additional keys, albeit in a way that will remove comments and trivia.
AdditionalKeys map[string]any `yaml:",inline"`
// Optional, validates that the CLI version satisfies the passed version range. The supported syntax for ranges is
// that of https://pkg.go.dev/github.com/blang/semver#ParseRange. For example ">=3.0.0", or "!3.1.2". Ranges can be
// AND-ed together by concatenating with spaces ">=3.5.0 !3.7.7", meaning greater-or-equal to 3.5.0 and not exactly
// 3.7.7. Ranges can be OR-ed with the `||` operator: "<3.4.0 || >3.8.0", meaning less-than 3.4.0 or greater-than
// 3.8.0.
RequiredPulumiVersion string `json:"requiredPulumiVersion,omitempty" yaml:"requiredPulumiVersion,omitempty"`
// contains filtered or unexported fields
}
Project is a Pulumi project manifest.
We explicitly add yaml tags (instead of using the default behavior from https://github.com/ghodss/yaml which works in terms of the JSON tags) so we can directly marshall and unmarshall this struct using go-yaml an have the fields in the serialized object match the order they are defined in this struct.
TODO[pulumi/pulumi#423]: use DOM based marshalling so we can roundtrip the seralized structure perfectly.
func DetectProjectStackPath ¶
DetectProjectStackPath returns the name of the file to store stack specific project settings in. We place stack specific settings next to the Pulumi.yaml file, named like: Pulumi.<stack-name>.yaml
func LoadProject ¶
LoadProject reads a project definition from a file.
func LoadProjectBytes ¶ added in v3.95.0
LoadProjectBytes reads a project definition from a byte slice.
func (*Project) AddConfigStackTags ¶ added in v3.103.0
AddConfigStackTags sets the project tags config to the given map of tags.
func (*Project) AddPackage ¶ added in v3.163.0
func (proj *Project) AddPackage(name string, spec PackageSpec)
func (*Project) GetPackageSpecs ¶ added in v3.157.0
func (proj *Project) GetPackageSpecs() map[string]PackageSpec
GetPackageSpecs returns a map of package names to their corresponding PackageSpecs
func (Project) RuntimeInfo ¶ added in v3.199.0
func (proj Project) RuntimeInfo() *ProjectRuntimeInfo
type ProjectBackend ¶
type ProjectBackend struct {
// URL is optional field to explicitly set backend url
URL string `json:"url,omitempty" yaml:"url,omitempty"`
}
ProjectBackend is the configuration for where the backend state is stored. If unset, will use the system's currently logged-in backend.
Use the same URL format that is passed to "pulumi login", see https://www.pulumi.com/docs/cli/commands/pulumi_login/
To explicitly use the Pulumi Cloud backend, use URL "https://api.pulumi.com"
type ProjectConfigItemsType ¶ added in v3.44.0
type ProjectConfigItemsType struct {
Type string `json:"type,omitempty" yaml:"type,omitempty"`
Items *ProjectConfigItemsType `json:"items,omitempty" yaml:"items,omitempty"`
}
type ProjectConfigType ¶ added in v3.44.0
type ProjectConfigType struct {
Type *string `json:"type,omitempty" yaml:"type,omitempty"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
Items *ProjectConfigItemsType `json:"items,omitempty" yaml:"items,omitempty"`
Default any `json:"default,omitempty" yaml:"default,omitempty"`
Value any `json:"value,omitempty" yaml:"value,omitempty"`
Secret bool `json:"secret,omitempty" yaml:"secret,omitempty"`
}
func (*ProjectConfigType) IsExplicitlyTyped ¶ added in v3.45.0
func (configType *ProjectConfigType) IsExplicitlyTyped() bool
IsExplicitlyTyped returns whether the project config type is explicitly typed. When that is the case, we validate stack config values against this type, given that the stack config value is namespaced by the project.
func (*ProjectConfigType) TypeName ¶ added in v3.45.0
func (configType *ProjectConfigType) TypeName() string
type ProjectOptions ¶ added in v3.14.0
type ProjectOptions struct {
// Refresh is the ability to always run a refresh as part of a pulumi update / preview / destroy
Refresh string `json:"refresh,omitempty" yaml:"refresh,omitempty"`
}
type ProjectPlugin ¶ added in v3.39.0
type ProjectPlugin struct {
Name string // the simple name of the plugin.
Kind apitype.PluginKind // the kind of the plugin (language, resource, etc).
Version *semver.Version // the plugin's semantic version, if present.
Path string // the path that a plugin is to be loaded from (this will always be a directory)
}
ProjectPlugin Information about a locally installed plugin specified by the project.
func (ProjectPlugin) Spec ¶ added in v3.39.0
func (pp ProjectPlugin) Spec(ctx context.Context) (PluginDescriptor, error)
Spec Return a PluginSpec object for this project plugin.
type ProjectRuntimeInfo ¶
type ProjectRuntimeInfo struct {
// contains filtered or unexported fields
}
func NewProjectRuntimeInfo ¶
func NewProjectRuntimeInfo(name string, options map[string]any) ProjectRuntimeInfo
func (ProjectRuntimeInfo) IsZero ¶ added in v3.243.0
func (info ProjectRuntimeInfo) IsZero() bool
Used for json/yaml marshalling so omitempty works.
func (ProjectRuntimeInfo) MarshalJSON ¶
func (info ProjectRuntimeInfo) MarshalJSON() ([]byte, error)
func (ProjectRuntimeInfo) MarshalYAML ¶
func (info ProjectRuntimeInfo) MarshalYAML() (any, error)
func (*ProjectRuntimeInfo) Name ¶
func (info *ProjectRuntimeInfo) Name() string
func (*ProjectRuntimeInfo) Options ¶
func (info *ProjectRuntimeInfo) Options() map[string]any
func (*ProjectRuntimeInfo) SetOption ¶
func (info *ProjectRuntimeInfo) SetOption(key string, value any)
func (*ProjectRuntimeInfo) UnmarshalJSON ¶
func (info *ProjectRuntimeInfo) UnmarshalJSON(data []byte) error
func (*ProjectRuntimeInfo) UnmarshalYAML ¶
func (info *ProjectRuntimeInfo) UnmarshalYAML(unmarshal func(any) error) error
type ProjectStack ¶
type ProjectStack struct {
// SecretsProvider is this stack's secrets provider.
SecretsProvider string `json:"secretsprovider,omitempty" yaml:"secretsprovider,omitempty"`
// EncryptedKey is the KMS-encrypted ciphertext for the data key used for secrets encryption.
// Only used for cloud-based secrets providers.
EncryptedKey string `json:"encryptedkey,omitempty" yaml:"encryptedkey,omitempty"`
// EncryptionSalt is this stack's base64 encoded encryption salt. Only used for
// passphrase-based secrets providers.
EncryptionSalt string `json:"encryptionsalt,omitempty" yaml:"encryptionsalt,omitempty"`
// Config is an optional config bag.
Config config.Map `json:"config,omitempty" yaml:"config,omitempty"`
// Environment is an optional environment definition or list of environments.
Environment *Environment `json:"environment,omitempty" yaml:"environment,omitempty"`
// contains filtered or unexported fields
}
ProjectStack holds stack specific information about a project.
func LoadProjectStack ¶
LoadProjectStack reads a stack definition from a file.
func LoadProjectStackBytes ¶ added in v3.95.0
func LoadProjectStackBytes( diags diag.Sink, project *Project, b []byte, path string, marshaller encoding.Marshaler, ) (*ProjectStack, error)
LoadProjectStack reads a stack definition from a byte slice.
func (ProjectStack) EnvironmentBytes ¶ added in v3.88.0
func (ps ProjectStack) EnvironmentBytes() []byte
func (ProjectStack) RawValue ¶ added in v3.50.0
func (ps ProjectStack) RawValue() []byte
func (*ProjectStack) Save ¶
func (ps *ProjectStack) Save(path string) error
Save writes a project definition to a file.
type ProjectTemplate ¶
type ProjectTemplate = apitype.ProjectTemplate
ProjectTemplate is a Pulumi project template manifest.
type ProjectTemplateConfigValue ¶
type ProjectTemplateConfigValue = apitype.ProjectTemplateConfigValue
ProjectTemplateConfigValue is a config value included in the project template manifest.
type PulumiConfig ¶ added in v3.18.0
type PulumiConfig struct {
BackendConfig map[string]BackendConfig `json:"backends,omitempty"` // a map of arbitrary backends configs.
}
func GetPulumiConfig ¶ added in v3.18.0
func GetPulumiConfig() (PulumiConfig, error)
type SortedPluginInfo ¶
type SortedPluginInfo []PluginInfo
SortedPluginInfo is a wrapper around PluginInfo that allows for sorting by version.
func (SortedPluginInfo) Len ¶
func (sp SortedPluginInfo) Len() int
func (SortedPluginInfo) Less ¶
func (sp SortedPluginInfo) Less(i, j int) bool
func (SortedPluginInfo) Swap ¶
func (sp SortedPluginInfo) Swap(i, j int)
type TokenInformation ¶ added in v3.86.0
type TokenInformation struct {
Name string `json:"name"` // The name of the token.
Organization string `json:"organization,omitempty"` //nolint:lll // If this was an organization token, the organization it was for.
Team string `json:"team,omitempty"` // If this was a team token, the team it was for.
ExpiresAt *time.Time `json:"expiresAt,omitempty"` // The time when this token expires.
}
Information about the token that was used to authenticate the current user. One (or none) of Team or Organization will be set, but not both.
type UndecryptableCredentialsError ¶ added in v3.258.0
Read paths surface this; `pulumi login` and `pulumi logout` recover by replacing or removing the file.
func (*UndecryptableCredentialsError) Error ¶ added in v3.258.0
func (e *UndecryptableCredentialsError) Error() string
func (*UndecryptableCredentialsError) Unwrap ¶ added in v3.258.0
func (e *UndecryptableCredentialsError) Unwrap() error
type UnresolvedPackageDescriptor ¶ added in v3.214.0
type UnresolvedPackageDescriptor struct {
// The fully resolved plugin descriptor.
PluginDescriptor
// The parameterization args to be applied against the plugin descriptor.
ParameterizationArgs []string
}
A resolved plugin with parameterization arguments.
This is different then a PackageDescriptor, which holds a parameterization value.
func (UnresolvedPackageDescriptor) LogValue ¶ added in v3.261.0
func (u UnresolvedPackageDescriptor) LogValue() slog.Value