pulumi/sdk/go/common/env/env.go

100 lines
4.0 KiB
Go
Raw Permalink Normal View History

2022-12-14 12:21:30 +00:00
// Copyright 2016-2022, Pulumi Corporation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// A small library for creating consistent and documented environmental variable accesses.
//
// Public environmental variables should be declared as a module level variable.
package env
import "github.com/pulumi/pulumi/sdk/v3/go/common/util/env"
// Re-export some types and functions from the env library.
type Env = env.Env
2022-12-14 14:18:13 +00:00
2022-12-14 12:21:30 +00:00
type MapStore = env.MapStore
func NewEnv(s env.Store) env.Env { return env.NewEnv(s) }
2022-12-14 14:18:13 +00:00
// Global is the environment defined by environmental variables.
2022-12-14 12:21:30 +00:00
func Global() env.Env {
return env.NewEnv(env.Global)
}
// That Pulumi is running in experimental mode.
//
// This is our standard gate for an existing feature that's not quite ready to be stable
// and publicly consumed.
var Experimental = env.Bool("EXPERIMENTAL", "Enable experimental options and commands.")
2022-12-14 12:21:30 +00:00
var SkipUpdateCheck = env.Bool("SKIP_UPDATE_CHECK", "Disable checking for a new version of pulumi.")
2022-12-14 12:21:30 +00:00
var Dev = env.Bool("DEV", "Enable features for hacking on pulumi itself.")
2022-12-14 14:18:13 +00:00
var SkipCheckpoints = env.Bool("SKIP_CHECKPOINTS", "Experimental flag to skip saving state "+
"checkpoints and only save the final deployment. See #10668.", env.Needs(Experimental))
var DebugCommands = env.Bool("DEBUG_COMMANDS", "List commands helpful for debugging pulumi itself.")
var EnableLegacyDiff = env.Bool("ENABLE_LEGACY_DIFF", "")
var DisableProviderPreview = env.Bool("DISABLE_PROVIDER_PREVIEW", "")
var DisableResourceReferences = env.Bool("DISABLE_RESOURCE_REFERENCES", "")
var DisableOutputValues = env.Bool("DISABLE_OUTPUT_VALUES", "")
2022-12-14 14:18:13 +00:00
var IgnoreAmbientPlugins = env.Bool("IGNORE_AMBIENT_PLUGINS",
"Discover additional plugins by examining $PATH.")
Add an envar to disable automatic provider installation (#14083) <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> This is primarily for the providers team to enable during builds so they can have more confidence about reproducibility of builds (especially examples conversion), but I imagine some customers would enable this as well. Fixes #14086 ## Checklist - [x] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [ ] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [ ] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-10-03 15:35:23 +00:00
var DisableAutomaticPluginAcquisition = env.Bool("DISABLE_AUTOMATIC_PLUGIN_ACQUISITION",
"Disables the automatic installation of missing plugins.")
var SkipConfirmations = env.Bool("SKIP_CONFIRMATIONS",
`Whether or not confirmation prompts should be skipped. This should be used by pass any requirement
that a --yes parameter has been set for non-interactive scenarios.
This should NOT be used to bypass protections for destructive operations, such as those that will
fail without a --force parameter.`)
var DebugGRPC = env.String("DEBUG_GRPC", `Enables debug tracing of Pulumi gRPC internals.
The variable should be set to the log file to which gRPC debug traces will be sent.`)
var GitSSHPassphrase = env.String("GITSSH_PASSPHRASE",
"The passphrase to use with Git operations that use SSH.", env.Secret)
// Environment variables that affect the self-managed backend.
var (
SelfManagedStateNoLegacyWarning = env.Bool("SELF_MANAGED_STATE_NO_LEGACY_WARNING",
"Disables the warning about legacy stack files mixed with project-scoped stack files.")
SelfManagedStateLegacyLayout = env.Bool("SELF_MANAGED_STATE_LEGACY_LAYOUT",
"Uses the legacy layout for new buckets, which currently default to project-scoped stacks.")
SelfManagedGzip = env.Bool("SELF_MANAGED_STATE_GZIP",
"Enables gzip compression when writing state files.")
SelfManagedRetainCheckpoints = env.Bool("RETAIN_CHECKPOINTS",
"If set every checkpoint will be duplicated to a timestamped file.")
SelfManagedDisableCheckpointBackups = env.Bool("DISABLE_CHECKPOINT_BACKUPS",
"If set checkpoint backups will not be written the to the backup folder.")
)
Kp/adds root pulumi ai command (#13808) <!--- Thanks so much for your contribution! If this is your first time contributing, please ensure that you have read the [CONTRIBUTING](https://github.com/pulumi/pulumi/blob/master/CONTRIBUTING.md) documentation. --> # Description <!--- Please include a summary of the change and which issue is fixed. Please also include relevant motivation and context. --> This PR is intended to add the beginnings of a set of `pulumi ai` commands to the Pulumi CLI. The first implementation is relatively straightforward - we want to be able to open the Pulumi AI app from the CLI while providing a simple set of operations for users - pre-filling the AI prompt, and optionally not running that prompt when the page is opened. The CLI should open the appropriate URL in the user's default browser, and the app should take over from there. This was implemented as a subcommand for `pulumi ai` as we intend to add more features both as siblings and at the parent `pulumi ai` command in the future, as this current functionality does not represent the "final default" experience we'd like users to have when running `pulumi ai`. Fixes https://github.com/pulumi/pulumi.ai/issues/126 ## Checklist - [x] I have run `make tidy` to update any new dependencies - [x] I have run `make lint` to verify my code passes the lint check - [ ] I have formatted my code using `gofumpt` <!--- Please provide details if the checkbox below is to be left unchecked. --> - [ ] I have added tests that prove my fix is effective or that my feature works <!--- User-facing changes require a CHANGELOG entry. --> - [x] I have run `make changelog` and committed the `changelog/pending/<file>` documenting my change <!-- If the change(s) in this PR is a modification of an existing call to the Pulumi Cloud, then the service should honor older versions of the CLI where this change would not exist. You must then bump the API version in /pkg/backend/httpstate/client/api.go, as well as add it to the service. --> - [ ] Yes, there are changes in this PR that warrants bumping the Pulumi Cloud API version <!-- @Pulumi employees: If yes, you must submit corresponding changes in the service repo. -->
2023-09-05 23:18:03 +00:00
// Environment variables which affect Pulumi AI integrations
var (
AIServiceEndpoint = env.String("AI_SERVICE_ENDPOINT", "Endpoint for Pulumi AI service")
)