Commit graph

777 commits

Author SHA1 Message Date
Justin Van Patten 74580168c2
Fix looking up empty version in ResourcePackages.TryGetResourceType (#6084)
When a resource reference is deserialized, it may not have a version in which case `version` will be an empty string. This change fixes `TryGetResourceType` to work correctly when an empty version is passed.
2021-01-12 08:53:52 -08:00
Mikhail Shilkov 710f385447
[dotnet] Unsecret and IsSecret implementation for .NET (#6092) 2021-01-12 14:54:08 +00:00
Vivek Lakshmanan 4dec79b67d Update changelog 2021-01-11 09:58:32 -08:00
Nicolas Fløysvik 9fbdc51fcd
[sdk/dotnet] Moved urn value retrieval into if statement (#6081) 2021-01-11 06:39:17 -08:00
Komal ae7d95eb87
[sdk/python] - Don't log if debug and no engine (#6067) 2021-01-07 15:23:23 -08:00
Pulumi Bot 42f355b497
[CLI] Add Version to the output of pulumi stack history (#6063)
fixes: #4328

Allows events to be tracked back to those of the Pulumi SaaS

Co-authored-by: stack72 <public@paulstack.co.uk>
2021-01-07 19:44:15 +00:00
stack72 fa3490ba2b Prepare for v2.17.0 release 2021-01-06 19:22:20 +00:00
Luke Hoban db14188526
[sdk/go] Support maps in Invoke outputs and Read inputs (#6014)
* [sdk/go] Support maps in Invoke outputs and Read inputs

These are already supported by the implementation, but were prevented by overzealous input validation in Invoke and ReadResource.

Follow-up to #4522 and #4521.

* Add CHANGELOG

* PR feedback
2021-01-06 15:35:13 +11:00
Pat Gavlin e1ac01a9f2
Respect the version option for provider resources. (#6055)
Although raw provider resources accept an input that allows a user to
specifiy a provider version to use, this input is not reflected in
current SDK code generation. Furthermore, we already have a method to
specify the provider version that should be used for a resource: the
"version" resource option. These changes update the code that handles
provider resource registrations to autmoatically populate the version
input from the "version" resource option if the option is present.

Fixes https://github.com/pulumi/pulumi-azure/issues/803.
2021-01-05 15:57:11 -08:00
Komal 8e8129012e
[automation-api/nodejs] - Support recovery workflow (#6038) 2021-01-04 16:45:57 -08:00
Komal 1ef22c375d
Revert bulk config ops in nodejs auto-api (#6051) 2021-01-04 14:38:55 -08:00
Paul Stack 21de78291f
[CLI] Add a confirmation prompt when deleting a policy pack (#6034)
Fixes: #4292
2021-01-04 22:37:46 +00:00
Paul Stack 60991a5568
[CLI] Provider better user error when Pulumi credentials file is corrupt (#6044)
Fixes: #2779
2021-01-04 20:36:51 +00:00
Paul Stack a7cabc2519
[CLI] Allow pulumi console to accept a stack name (#6031)
Fixes: #5854

If a stackname is not passed as an argument then it will use the
currently selected stack
2020-12-31 00:45:32 +00:00
Luke Hoban 1ef2f10543
Allow serializeFunction to capture secrets (#6013)
Adds an opt-in `allowSecrets` flag to `serializeFunction` to allow it to capture secrets.  If passed, `serializeFunction` will now report back whether it captured any secrets.  This information can be used by callers to wrap the resulting text in a Secret value.

Fixes #2718.
2020-12-31 09:37:25 +11:00
Komal bc76068ae4
[auto/nodejs] - Parallelize config operations (#6022) 2020-12-29 15:40:22 -08:00
stack72 58c07c52c8 Prepare for v2.16.2 release 2020-12-23 22:02:13 +00:00
Pat Gavlin c6d22a25e5
gRPC bridge: fix unknowns in Update previews (#6006)
These changes are a combination of three commits, each of which
contributes to the testing and/or fixing of a problem with marshaling
unknowns in `plugin.provider.Update` when `preview` is true.

## deploytest: add support for gRPC adapters. 

These changes add support for communicating with providers using the
gRPC adapters to the deploytest pacakage. This makes it easier to test
the gRPC adapters across typical lifecycle patterns.

Supporting these changes are two additions to the `resource/plugin`
package:

1. A type that bridges between the `plugin.Provider` interface and the
  `pulumirpc.ResourceProviderServer`
2. A function to create a `plugin.Provider` given a
  `pulumirpc.ResourceProviderClient`

The deploytest package uses these to wrap an in-process
`plugin.Provider` in a gRPC interface and connect to it without using
the default plugin host, respectively.

## pulumi_test: test provider preview over gRPC.

Add a test that runs the provider preview lifecycle, but using a
provider that communicates over gRPC.

## gRPC bridge: fix unknowns in `Update` previews

Set the `KeepUnknowns` and `RejectUnknowns` bits in the `MarshalOptions`
used when unmarshaling update results to preserve unknowns during a
preview and reject them otherwise.

These changes also set the `RejectUnknowns` bit in the `MarshalOptions`
used by `Create` if `preview` is false, and fix a bug in the array
unmarshaler that could cause out-of-bounds accesses.

Fixes https://github.com/pulumi/pulumi/issues/6004.
2020-12-23 13:25:48 -08:00
Levi Blackstone dd9b02dcef
Prepare for v2.16.1 release (#5996) 2020-12-22 13:43:08 -07:00
Levi Blackstone 795a11c44e
Fix a panic due to unsafe concurrent map access (#5995)
State tracking for goals was implemented using a raw map,
but this was not safe for concurrent read/write access from
multiple goroutines. Switched to using a sync.Map, which
is threadsafe.
2020-12-22 12:04:49 -07:00
Komal d0676c19a3
Fix virtual env path (#5992) 2020-12-21 17:46:56 -08:00
stack72 0111fb60ba Prepare for v2.16.0 release 2020-12-21 17:52:24 +00:00
Pat Gavlin eeff5257c3
Do not read TGZs into memory. (#5983)
* Do not read TGZs into memory.

This runs a serious risk of exhausting the memory on lower-end machines
(e.g. certain CI VMs), especially given the potential size of some
plugins.

* CHANGELOG

* fixes
2020-12-20 12:54:11 -08:00
Levi Blackstone 8a9b381767
Fix panic related to update with refresh (#5980)
The step generator was incorrectly tracking goal states for
old resources, which could lead to a panic if the resource
was removed in the update. This fix only generates goal
states for resources that exist in the updated program.
2020-12-18 23:03:40 -08:00
Lee Zen 518ec3a8a5
Assume no terminal if the display width/height is 0 (#5959) 2020-12-18 15:38:15 -08:00
Levi Blackstone 1c87d58b4a
Fix bug with ComponentResource resource refs (#5949)
Now that resources are serialized as refs, ComponentResources
may try to unmarshal local resource refs before they are
initialized during the RegisterResource step.

This change avoids that issue by skipping Output marshaling
for local ComponentResources during the RegisterResource step.
These Outputs will be handled instead during the
RegisterResourceOutputs step.

Co-authored-by: Pat Gavlin <pat@pulumi.com>
2020-12-18 14:45:52 -07:00
Pat Gavlin 860ea4dc84
Add ignoreChanges preprocessing in ImportStep. (#5976)
The step generator applies `ignoreChanges` pre-processing for all
resources by copying old input values to the new goal for any properties
mentioned in the `ignoreChanges` list. However, this pre-processing
depends on the existence of prior inputs, which by definition does not
exist for a resource being imported prior to the issuance of the
`ImportStep`. These changes add this processing to the implementation of
`ImportStep`, using the inputs read from the provider as the prior
inputs.
2020-12-17 14:46:50 -08:00
Pat Gavlin 9b6a7a4397
Improve resource ref unit tests. (#5960)
- Add component ref coverage to the existing test
- Add coverage for a downlevel SDK communicating with an engine that
  supports resource refs
- Add coverage for a downlevel engine communicating with an SDK that
  supports resource refs

As part of improving coverage, these changes add a knob to explicitly
disable resource refs in the engine without the use of the environment
variable. The environment variable is now only read by the CLI, and has
been restored to its prior polarity (i.e. `PULUMI_ENABLE_RESOURCE_REFERENCES`).
2020-12-16 12:38:20 -08:00
Mikhail Shilkov 356fe195af
Extensions to support input collection initializers with union types (#5938) 2020-12-14 20:33:53 +01:00
Luke Hoban 8f9054f56c Prepare for v2.15.6 release 2020-12-12 13:04:38 -08:00
Levi Blackstone 54d6703fee
Temporarily disable resource ref support (#5932)
Disable resource ref support until https://github.com/pulumi/pulumi-kubernetes/issues/1405
is fixed. This bug currently affects Python users with recent versions of the pulumi SDK
who are using the pulumi-kubernetes provider.
2020-12-12 12:02:45 -08:00
Evan Boyle 069f9f28cf
Fix bug that could cause Go SDK to drop dependencies (#5930)
* fix bug that could cause Go SDK to drop dependencies

* changelog
2020-12-11 16:27:11 -08:00
Levi Blackstone d3c75afce1
[codegen/go] Fix Input/Output methods for Go resources (#5916) 2020-12-11 11:49:08 -07:00
stack72 93e621aef6 Prepare for v2.15.5 release 2020-12-11 11:49:50 +00:00
Justin Van Patten 160220bc4a
[sdk/dotnet] Fix deserializing resources (#5921)
This change implements getResource in the mock monitor. This uncovered some issues deserializing resources, which this change also addresses.
2020-12-10 22:58:08 -08:00
Justin Van Patten afd5ad6a97
[sdk/python] Implement getResource in the mock monitor (#5919) 2020-12-10 15:23:00 -08:00
Levi Blackstone 4d48ee0517
Enable resource reference feature by default (#5905)
* Enable resource reference feature by default

Unless the PULUMI_DISABLE_RESOURCE_REFERENCES flag
is explicitly set to a truthy value, the resource reference feature is now
enabled by default.

* Set AcceptResources in the language SDKs

This can be disabled by setting the `PULUMI_DISABLE_RESOURCE_REFERENCES` environment variable to a truthy value.

Co-authored-by: Justin Van Patten <jvp@justinvp.com>
2020-12-10 11:21:05 -07:00
Justin Van Patten 918615f072
[sdk/nodejs] Implement getResource in the mock monitor (#5914)
Otherwise, unit tests for programs that reference resources that have been registered with `registerResourceModule` fail with unhandled exceptions.
2020-12-10 09:30:34 -08:00
Paul Stack 3994fa8c22
Prevent panic when using pulumi import with local backend (#5906)
Fixes: #5876
2020-12-10 13:31:45 +00:00
Luke Hoban b45b3ed543
Re-apply #5857 (#5893)
This re-applies the fix in 5857 to make credentials.json writes concurrency safe.

The original fix used `path.Dir` instead of `filepath.Dir` - which led to not placing the temp file in the same folder (and drive) as the renamed file target.  This led to errors on Windows environments where the working directory was on a different drive than the `~/.pulumi` directory.  The change to use `filepath.Dir` instead ensures that even on Windows, the true directory containing the credentials file is used for the temp file as well.

Fixes #3877.
2020-12-08 17:38:59 -08:00
Aylei faebaa0dc5
[ciutil] Correct system name of Jenkins CI (#5891)
Signed-off-by: Aylei <rayingecho@gmail.com>
2020-12-08 18:36:31 +00:00
stack72 d804b7d99c Prepare for v2.15.4 release 2020-12-08 14:32:15 +00:00
Paul Stack 4f5b3c8522
Ensure we have an import error before using in import path (#5884)
Without this, we can panic
2020-12-08 00:43:35 +00:00
Vivek Lakshmanan aba03b8594
Merge pull request #5874 from pulumi/vl/Windows
Shim python interpreter for windows if interpreter uses reparse points
2020-12-07 15:13:21 -08:00
Vivek Lakshmanan 4e144e666c Add changelog entry 2020-12-07 14:17:45 -08:00
stack72 890a81ac4f Prepare for v2.15.3 release 2020-12-07 18:34:46 +00:00
Luke Hoban df8f01dba7
Revert #5857 (#5880)
Fixes #5879.
2020-12-07 10:06:41 -08:00
stack72 223f6501eb Prepare for v2.15.2 release 2020-12-07 12:48:25 +00:00
Joe Duffy a5c30f1547
Properly resize arrays when adding (#5872)
* Properly resize arrays when adding

The current logic attempts to update the array but, because
append may need to allocate a new array with adequate space,
the code can currently leave dest referring to the old,
under-sized array. The solution is to use the set(dest)
logic that already exists and is used for the IsNull case.

Added a test case that would fail before this fix and now passes.

This fixes pulumi/pulumi#5871.

* Add CHANGELOG entry
2020-12-06 21:23:50 +00:00
stack72 a70cb41731 Prepare for v2.15.1 release 2020-12-04 20:06:10 +00:00
Paul Stack 12dd0767ac
Ensure we can rotate pulumi passphrase secrets providers (#5865)
Fixes: #5452

When the user is requesting to change the secrets provider to a
passphrase provider, we now calculate that has been requested.

This means, we will prompt for a new passphrase for use in encrypting
the stack.

```
pulumi stack change-secrets-provider passphrase
Enter your passphrase to unlock config/secrets
    (set PULUMI_CONFIG_PASSPHRASE or PULUMI_CONFIG_PASSPHRASE_FILE to remember):
Enter your new passphrase to protect config/secrets:
Re-enter your new passphrase to confirm:
Migrating old configuration and state to new secrets provider
Enter your passphrase to unlock config/secrets
    (set PULUMI_CONFIG_PASSPHRASE or PULUMI_CONFIG_PASSPHRASE_FILE to remember):
```
2020-12-04 15:21:51 +00:00
Justin Van Patten 5ab051cd97
Implement GetRequiredPlugins for Python (#5787)
Implement GetRequiredPlugins for Python, which determines the plugins
required by the program.

Also, if the `virtualenv` runtime option is set, and the specified
virtual directory is missing or empty, automatically create it and
install dependencies into it.
2020-12-03 19:22:16 -08:00
Luke Hoban 9e955241fc
Make credentials.json file writes concurrency safe (#5857)
Running `pulumi` operations in parallel could occasionally result in truncating the `~/.pulumi/credentials.json` file and reading that truncated file from another process before the content could be written.

Instead, use `os.Rename` to atomically replace the file contents.

Concurrent `pulumi` operations could still compete for who gets to write the file first, and could lead to surprising results in some extreme cases.   But we should not see the corrupted file contents any longer.

Fixes #3877.
2020-12-03 15:07:55 -08:00
stack72 911eec4d55 Prepare for v2.15.0 release 2020-12-02 20:15:29 +00:00
Justin Van Patten ea1b962999
Revert "Enable resource reference feature by default" (#5850)
To de-risk the Pulumi v2.15.0 release, temporarily revert 679d40950f. Use of resource references will require `PULUMI_EXPERIMENTAL_RESOURCE_REFERENCES=1` to be set until the feature has been enabled by default.
2020-12-02 08:39:21 -08:00
Joe Duffy 01d0d64e84
Correctly rename stack files during a rename (#5812)
* Correctly rename stack files during a rename

This fixes pulumi/pulumi#4463, by renaming a stack's configuration
file based on its stack-part, and ignoring the owner-part. Our
workspace system doesn't recognize configuration files with fully
qualified names. That, by the way, causes problems if we have
multiple stacks in different organizations that share a stack-part.

The fix here is simple: propagate the new StackReference from the
Rename operation and rely on the backend's normalization to a
simple name, and then use that the same way we are using a
StackReference to determine the path for the origin stack.

An alternative fix is to recognize fully qualified config files,
however, there's a fair bit of cleanup we will be doing as part of
https://github.com/pulumi/pulumi/issues/2522 and
https://github.com/pulumi/pulumi/issues/4605, so figured it is best
to make this work the way the system expects first, and revisit it
as part of those overall workstreams. I also suspect we may want to
consider changing the default behavior here as part of
https://github.com/pulumi/pulumi/issues/5731.

Tests TBD; need some advice on how best to test this since it
only happens with our HTTP state backend -- all integration tests
appear to use the local filestate backend at the moment.

* Add a changelog entry for bug fix

* Add some stack rename tests

* Fix a typo

* Address CR feedback

* Make some logic clearer

Use "parsedName" instead of "qn", add a comment explaining why
we're doing this, and also explicitly ignore the error rather
than implicitly doing so with _.
2020-12-01 16:55:48 -08:00
Levi Blackstone 679d40950f
Enable resource reference feature by default (#5848)
Unless the PULUMI_DISABLE_RESOURCE_REFERENCES flag
is explicitly set to a truthy value, the resource reference feature is now
enabled by default.
2020-12-01 16:58:49 -07:00
Paul Stack eee053cb4c
Ensure EncryptionKey is regenerated when changing secrets provider (#5842)
Fixes: #5835

when rotating a key in the Azure KeyVault secrets provider, we had
the following error:

```
error: secrets (code=InvalidArgument): keyvault.BaseClient#Decrypt: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="BadParameter" Message="The parameter is incorrect.\r\n"
```

This was because we were not regenerating the EncrytpionKey when
we were changing the secrets provider. Therefore, we now ensure
that this key is regenerated and we can successfully change the secrets provider

```
▶ pulumi stack init dev --secrets-provider="azurekeyvault://stack72kv10.vault.azure.net/keys/pulumi-secret"
Created stack 'dev'

▶ pulumi config set MyDBRootPassword Password1234! --secret

▶ pulumi config --show-secrets
KEY               VALUE
MyDBRootPassword  Password1234!

▶ pulumi stack change-secrets-provider "azurekeyvault://stack72kv20.vault.azure.net/keys/pulumi-secret"

▶ pulumi config --show-secrets
KEY               VALUE
MyDBRootPassword  Password1234!
```
2020-12-01 15:26:23 +00:00
Nathan Winder 0bdf73341b
Enable creation of TStack using IServiceProvider (#5723)
* Enable creation of TStack using IServiceProvider to enable dependency injection.

* fixed line endings

* update change log

* Added PR link to change log

* fixed change log

* Added integration test

* Review adjustments

Co-authored-by: Mikhail Shilkov <github@mikhail.io>
2020-11-30 16:43:18 +01:00
Komal 48f43906f4
[sdk/python] - Support enums (#5615)
Co-authored-by: Pat Gavlin <pat@pulumi.com>
2020-11-24 19:15:11 -06:00
Luke Hoban 4ecd8f9f56
Add PULUMI_BACKEND_URL env var (#5789)
The PULUMI_BACKEND_URL env var allows specifying the backend to use instead of deferring to the project or the ~/.pulumi/credentials.json file to decide on the "current" backend.  This allows for using Pulumi without a dependence on this piece of global filesystem state, so that each `pulumi` invocation can control the exact backend it want's to operate on, without having to do stateful `pulumi login`/`pulumi logout` operations.

This is especially useful for automation scenarios like Automation API generally (and effectively solves https://github.com/pulumi/pulumi/issues/5591), or https://github.com/pulumi/pulumi-kubernetes-operator/issues/83 specifically.

This also makes things like efe7a599e6/dist/actions/entrypoint.sh (L10) less necessary, and possible to accomplish for any containerized `pulumi` execution without the need for this logic to be embedded in bash scripts wrapping the CLI.
2020-11-22 15:27:59 -08:00
Justin Van Patten 4c88e215ce
Respect PULUMI_PYTHON_CMD in scripts (#5782)
If `PULUMI_PYTHON_CMD` is set, use it instead of running `python` directly.
2020-11-18 19:08:41 -08:00
stack72 8ade2f8319 Prepare for v2.14.0 release 2020-11-18 16:56:26 +00:00
Paul Stack 41a881a374
Small UX change to the output of policy violations (#5773)
Fixes: #5626

It used to be:

```
Policy Violations:
    [advisory]  aws v0.1.20200912  allowed-image-owner (demo-aws-ts-webserver-server-0: aws:ec2/instance:Instance)
    Check machine image is from an approved publisher.
    Publisher [137112412989] is not one of [self,099720109477].

```

Notice that it was name: type

We would rather this was type: name

```
Policy Violations:
    [advisory]  aws v0.1.20200912  allowed-image-owner (aws:ec2/instance:Instance: demo-aws-ts-webserver-server-0)
    Check machine image is from an approved publisher.
    Publisher [137112412989] is not one of [self,099720109477].

```
2020-11-17 21:14:28 +00:00
Tomas Jansson 89daaa2ff1
Output key and correct stack on keynotfound (#5740)
* Output key and correct stack on keynotfound

Co-authored-by: Mikhail Shilkov <github@mikhail.io>
2020-11-17 19:58:56 +01:00
Justin Van Patten bfe4969f35
.NET: Report plugin install errors during pulumi new (#5760)
The way `pulumi new` installs dependencies for .NET projects is slightly different from other languages. For Node.js, Python, and Go, `pulumi new` runs the appropriate command to install project dependencies (e.g. `npm install`, `pip install`, or `go mod download`). For .NET, it calls the same routine used during `preview|up` to ensure required plugins are installed. For .NET, this ends up running `dotnet build` which implicitly installs Nuget packages, builds the project, and also attempts to determine and install the needed Pulumi plugins. When this operation runs during `preview|up`, and there are failures installing a plugin, the error is logged, but deliberately not returned, because an error will be shown for missing plugins later on during the `preview|up` operation. However, during `pulumi new`, we should show any plugin install errors.
2020-11-16 21:56:13 -08:00
Justin Van Patten 594da1e95c
Fix plugin install failures on Windows (#5759)
When installing a plugin, previous versions of Pulumi extracted the
plugin tarball to a temp directory and then renamed the temp directory
to the final plugin directory. This was done to prevent concurrent
installs: if a process fails to rename the temp dir because the final
dir already exists, it means another process already installed the
plugin. Unfortunately, on Windows the rename operation often fails due
to aggressive virus scanners opening files in the temp dir.

In order to provide reliable plugin installs on Windows, we now extract
the tarball directly into the final directory, and use file locks to
prevent concurrent installs from toppling over one another.

During install, a lock file is created in the plugin cache directory
with the same name as the plugin's final directory but suffixed with
`.lock`. The process that obtains the lock is responsible for extracting
the tarball. Before it does that, it cleans up any previous temp
directories of failed installs of previous versions of Pulumi. Then it
creates an empty `.partial` file next to the `.lock` file. The
`.partial` file indicates an installation is in-progress. The `.partial`
file is deleted when installation is complete, indicating the plugin was
successfully installed. If a failure occurs during installation, the
`.partial` file will remain indicating the plugin wasn't fully
installed. The next time the plugin is installed, the old installation
directory will be removed and replaced with a fresh install.

This is the same approach Go uses for installing modules in its
module cache.
2020-11-16 09:44:29 -08:00
Mikhail Shilkov b200e171a6
Update .NET Grpc to the latest and Protobuf to Pulumi fork (#5757) 2020-11-14 14:25:38 +01:00
Vivek Lakshmanan 9d6e380680
Merge pull request #5741 from pulumi/vl/GoVersion
Pulumi-language-go and pulumi new now checks go version is at least 1.14.0
2020-11-12 15:40:57 -08:00
Pat Gavlin 1e0c9efdd7
Respect provider config secretness. (#5742)
Just what it says on the tin. This is implemented by changing the
`GetPackageConfig` method of `ConfigSource` to return a `PropertyMap`
and ensuring that any secret config is represented by a `Secret`.
2020-11-12 12:18:12 -08:00
Vivek Lakshmanan bcb9d0f4c8 Refactor to add version check to pulumi new as well 2020-11-12 09:20:28 -08:00
Komal e3725a6e40
Support python 3.9 on windows (#5739) 2020-11-11 14:07:59 -08:00
Pat Gavlin 0ec12d01f9
Create a builtin provider during import. (#5730)
`pulumi import` may otherwise fail if there are providers in the
statefile.
2020-11-10 21:11:30 -08:00
Levi Blackstone 64e5de1edc
[codegen/go] Add support for ResourceType and isComponent (#5497) 2020-11-09 11:55:53 -07:00
Paul Stack 3d8068e355
adding the import documentation where specified (#5667) 2020-11-09 14:12:58 +00:00
stack72 8b8b538d08 Prepare for v2.13.2 release 2020-11-07 10:14:03 +00:00
Justin Van Patten 88f6b4c560
Report feature "resourceReferences" is not supported (#5709)
This feature isn't fully supported yet, so stop reporting it is.
2020-11-06 18:56:23 -08:00
stack72 ff22649925 Prepare for v2.13.1 release 2020-11-06 20:49:20 +00:00
Paul Stack 8685f96ce6
Ensure pulumi history marks secrets that can't be un-encrypted as such (#5701) 2020-11-06 19:54:33 +00:00
Pat Gavlin f6b687ea03
Fix feature support checks in the Python SDK. (#5702) 2020-11-06 19:53:24 +00:00
RyanW02 90fbe4bc8f
Add boolean values to Go SDK (#5647) (#5687)
* Add boolean values to Go SDK (#5647)

* Update changelog
2020-11-05 13:33:58 -08:00
stack72 f22b47e54f Prepare for v2.13.0 release 2020-11-04 21:55:05 +00:00
Paul Stack a42bafcf5c
Ensure the CLI doesn't panic when trying to build a graph for a stack with no snapshot (#5678)
Fixes: #4952
2020-11-04 17:33:39 +00:00
Paul Stack 056c82cd09
Ensure CLI doesn't panic when using pulumi watch and ComponentResources (#5675) 2020-11-04 01:14:43 +00:00
Komal f1f6a126bc
Support python 3.9 (#5669)
Co-authored-by: Justin Van Patten <jvp@justinvp.com>
Co-authored-by: stack72 <public@paulstack.co.uk>
2020-11-03 16:28:45 -08:00
Justin Van Patten 855f14c053
Support remote components in Go (#5558) 2020-10-29 15:13:17 -07:00
stack72 d76c1e4994 Prepare for v2.12.1 release 2020-10-23 11:46:32 +01:00
Paul Stack b75ca2602f
Ensure policy events do not cause a panic when using preview --json (#5610) 2020-10-22 20:28:39 +01:00
Paul Stack 7f0bc891c4
Ensure CLI doesn't panic when pulumi watch is used with policies enabled (#5569)
Fixes: #5561
2020-10-17 21:29:16 +01:00
stack72 74cb4d1d89 Prepare for v2.12.0 release 2020-10-14 18:26:34 +01:00
Pat Gavlin 89c71bb49e
[cli] Add an import command. (#4765)
Co-authored-by: stack72 <public@paulstack.co.uk>
2020-10-14 12:51:53 +01:00
Mikhail Shilkov 4f07891595
[dotnet] Add a lock around child resource manipulation (#5563)
[dotnet] Add a lock around child resource manipulation to prevent hashset concurrency issue

Co-authored-by: Justin Van Patten <jvp@justinvp.com>
2020-10-13 19:28:57 +02:00
Justin Van Patten ceec3eac0f
[sdk/python] Fix ResourceOptions annotations and doc strings (#5559) 2020-10-13 05:18:15 -07:00
Paul Stack 186e2f059e
Respect logging verbosity as part of pulumi plugin install (#5549)
Fixes: #4427

By default, there is no indepth logging:

```
pulumi plugin install resource azure-nextgen v0.2.1
[resource plugin azure-nextgen-0.2.1] installing
Downloading plugin: 17.82 MiB / 17.82 MiB [=========================] 100.00% 2s
Moving plugin... done.
```

We can increase the logging verosity get more detailed logging:
```
pulumi plugin install resource azure-nextgen v0.2.1 -v=1 --logtostderr
[resource plugin azure-nextgen-0.2.1] installing
I1010 19:30:58.472772    7128 plugins.go:201] azure-nextgen downloading from https://get.pulumi.com/releases/plugins
Downloading plugin: 0 B / 17.82 MiB [----------------------------------]   0.00%I1010 19:30:58.704168    7128 plugin_install.go:136] [resource plugin azure-nextgen-0.2.1] installing tarball ...
Downloading plugin: 17.82 MiB / 17.82 MiB [=========================] 100.00% 3s
Moving plugin...I1010 19:31:01.874427    7128 plugins.go:304] moving plugin from "/Users/myuser/.pulumi/plugins/resource-azure-nextgen-v0.2.1.tmp884796935" to "/Users/myuser/.pulumi/plugins/resource-azure-nextgen-v0.2.1"
 done.
```

The most verbose logging level will log the request and response headers
```
pulumi plugin install resource azure-nextgen v0.2.1 -v=9 --logtostderr
I1010 19:29:46.989150    7089 sink.go:146] defaultSink::Infoerr([resource plugin azure-nextgen-0.2.1] installing)
[resource plugin azure-nextgen-0.2.1] installing
I1010 19:29:46.989295    7089 plugins.go:591] SelectCompatiblePlugin(..., azure-nextgen): beginning
I1010 19:29:46.989300    7089 plugins.go:630] SelectCompatiblePlugin(..., azure-nextgen): failed to find match
I1010 19:29:46.989323    7089 plugins.go:201] azure-nextgen downloading from https://get.pulumi.com/releases/plugins
I1010 19:29:46.989333    7089 plugins.go:208] full plugin download url: https://get.pulumi.com/releases/plugins/pulumi-resource-azure-nextgen-v0.2.1-darwin-amd64.tar.gz
I1010 19:29:46.989360    7089 plugins.go:218] plugin install request headers: map[User-Agent:[pulumi-cli/1 (; darwin)]]
I1010 19:29:47.242941    7089 plugins.go:225] plugin install response headers: map[Accept-Ranges:[bytes] Age:[370098] Content-Disposition:[attachment; filename=pulumi-resource-azure-nextgen-v0.2.1-darwin-amd64.tar.gz] Content-Length:[18684382] Content-Type:[application/x-gzip] Date:[Tue, 06 Oct 2020 11:41:30 GMT] Etag:["518f2e7efd46fe5b7be9508dc785b9c9-4"] Last-Modified:[Sat, 03 Oct 2020 20:57:45 GMT] Server:[AmazonS3] Via:[1.1 198b7d1bb217783eef010e6636984c9f.cloudfront.net (CloudFront)] X-Amz-Cf-Id:[aaC3Q0WcecspsFbWROLxXnD6iF7sYoAfShQKYiS2xkFKAWlFRBu-1Q==] X-Amz-Cf-Pop:[MAN50-C2] X-Cache:[Hit from cloudfront]]
Downloading plugin: 0 B / 17.82 MiB [----------------------------------]   0.00%I1010 19:29:47.243189    7089 plugin_install.go:136] [resource plugin azure-nextgen-0.2.1] installing tarball ...
Downloading plugin: 17.82 MiB / 17.82 MiB [=========================] 100.00% 2s
Moving plugin...I1010 19:29:50.031099    7089 plugins.go:304] moving plugin from "/Users/myuser/.pulumi/plugins/resource-azure-nextgen-v0.2.1.tmp960784076" to "/Users/myuser/.pulumi/plugins/resource-azure-nextgen-v0.2.1"
 done.
```
2020-10-13 13:09:29 +01:00
Paul Stack 095da7084c
Accept -f as a shorthand for --skip-preview on up, refresh and destroy operations (#5556)
Fixes: #2321
2020-10-13 11:10:59 +01:00
Paul Stack 156aa9862e
Add the ability to specify privateKey contents to AutomationAPI (#5557)
Fixes: #5383
2020-10-12 19:51:26 +01:00
Paul Stack 38152ba6f0
Improve user message when pulumi plugin rm --all has no plugins to remove (#5547)
Fixes: #5376

```                                                                                                                                                                                          ⍉
pulumi plugin rm --all --yes
no plugins found to uninstall
echo $?
0
```
2020-10-12 18:31:55 +01:00
Paul Stack df9c9f195f
Validate and error on invalid cloudUrl formats on pulumi login (#5550)
Fixes: #3382

```
▶ pulumi login --cloud-url az://myblob
error: unknown backend cloudUrl format 'az' (supported Url formats are: azblob://, gs:// and s3://)
```
2020-10-12 17:35:22 +01:00
Paul Stack 36db22d488
Ensure secret provider variables are cleaned up when changing secret providers (#5545)
Fixes: #5509

When changing from a passphrase provider to a cloud secrets provider,
the encryptionsalt is not required, so we should ensure this is removed
2020-10-10 19:04:07 +01:00
Pat Gavlin 249140242e
Add support for provider-side preview. (#5443)
These changes add support for provider-side previews of create and
update operations, which allows resource providers to supply output
property values for resources that are being created or updated during a
preview.

If a plugin supports provider-side preview, its create/update methods
will be invoked during previews with the `preview` property set to true.
It is the responsibility of the provider to fill in any output
properties that are known before returning. It is a best practice for
providers to only fill in property values that are guaranteed to be
identical if the preview were instead an update (i.e. only those output
properties whose values can be conclusively determined without
actually performing the create/update operation should be populated).
Providers that support previews must accept unknown values in their
create and update methods.

If a plugin does not support provider-side preview, the inputs to a
create or update operation will be propagated to the outputs as they are
today.

Fixes #4992.
2020-10-09 13:13:55 -07:00
evanboyle bf68108193 changelog 2020-10-08 12:19:01 -07:00
Mikhail Shilkov 879066a60b
Execute self-contained .NET binary (#5519)
* Execute self-contained .NET binary
* Skip dotnet lookup for self-contained binaries
2020-10-07 11:46:24 +02:00
Justin Van Patten df75f0ed95
Support remote components in .NET (#5485) 2020-10-06 10:19:22 -07:00
Luke Hoban 32f13fabfa Merge branch 'fix_gzip_compression' of https://github.com/birdypme/pulumi into birdypme-fix_gzip_compression 2020-10-05 13:52:23 -07:00
Joe Duffy 12e5e46c73
Handle blank project names in 'new' (#5504)
The logic for validating prompted values in 'new' wasn't quite right,
leading to the possibility of creating Pulumi.yaml files with blank
project names.

This manifests in various ways and I've hit it a number of times
over the past few months because of the way we handle project/stack
name conflicts in 'new' -- which itself is a bit annoying too:

https://github.com/pulumi/pulumi/blob/master/pkg/cmd/pulumi/new.go#L206-L207

Because we substitue a default value of "", and because the prompting
logic assumed default values are always valid, we would skip validation
and therefore accept a blank Pulumi.yaml file.

This generates an invalid project which causes errors elsewhere, such as

    error: failed to load Pulumi project located at ".../Pulumi.yaml":
        project is missing a 'name' attribute

I hit this all the time with our getting started guide because I've
gone through it so many times and have leftover stacks from prior
run-throughs. I wouldn't be surprised if a lot of people hit this.

The solution here validates all values, including the default.

Note also that we failed to validate the value used by 'new --yes'
which meant you could bypass all validation by passing --yes, leading
to similar outcomes.

I've added a couple new tests for these cases. There is a risk we
depend on illegal default values somewhere which will now be rejected,
but that would seem strange, and assuming the tests pass, I would
assume that's not true. Let me know if that's wrong.

Fixes pulumi/pulumi#3255.
2020-10-05 13:40:24 -07:00
Mikhail Shilkov 3a2d7356a2
Quit if a static passphrase is invalid (#5507) 2020-10-05 14:57:48 +01:00
Mike Metral 08c8848375 feat(autoapi): expose EnvVars LocalWorkspaceOption to set in ctor 2020-10-02 09:01:28 -07:00
Julien Champseix 408d3cf219
Merge branch 'master' into fix_gzip_compression 2020-10-02 09:41:21 +02:00
stack72 b901292228 Prepare for v2.11.2 release 2020-10-01 23:09:23 +01:00
Justin Van Patten 97c006b5ce
[sdk/python] Fix secret regression (#5496)
A recent change to output deserialization resulted in secrets being returned unwrapped. This change addresses the regression, ensuring any unwrapped secret values are rewrapped before being returned.
2020-10-01 14:57:51 -07:00
Julien Champseix f2b75b1e5f Merge branch 'master' into fix_gzip_compression 2020-10-01 09:22:12 +02:00
Lee Briggs cedab0003b
Prepare for v2.11.1 release 2020-09-30 17:13:03 -07:00
Justin Van Patten 9bcf02e7ed
Support remote components in Python (#5375) 2020-09-30 14:09:20 -07:00
Julien Champseix 15bb586fa3 updated CHANGELOG 2020-09-30 23:06:13 +02:00
Lee Briggs d4263acbcf
Prepare for v2.11.0 release 2020-09-30 11:00:47 -07:00
Mikhail Shilkov 5e3c14c8be
[dotnet] Allow resources to define outputs of Output<object> (#5465) 2020-09-28 18:00:02 +02:00
jetvova b4c2a3521c
Fixed issue #5014 (Missing Pulumi console tags on Windows) (#5406)
Co-authored-by: Paul Stack <public@paulstack.co.uk>
2020-09-25 15:04:18 +01:00
Pat Gavlin 3278b6bf91
Simplify types more precisely. (#5440)
Instead of simplifying any module that ends with `/<name>`, only simplify
types where `<name>` matches the type name portion after camel-casing.
This continues to simplify tfbridge types like `aws:s3/bucket:Bucket`,
but would not simplify a type like `aws:s3:Bucket`.
2020-09-22 10:34:16 -07:00
Justin Van Patten 971a8bbacf Prepare for v2.10.2 2020-09-21 11:51:56 -07:00
Justin Van Patten 5794a3f482
[sdk/python] Cast numbers intended to be integers to int (#5419)
We recently made a change to the Python codegen to emit `int` type annotations, instead of `float`, for properties that are typed as `schema.IntType`.

But the number values that come back from protobuf structs are always floats (like JSON), so we need to cast the values intended to be integers to `int`.
2020-09-19 21:09:53 -07:00
Sean Holung c6dcb67677
Add pulumi console command (#5368) 2020-09-18 12:47:18 -07:00
Levi Blackstone ab70dd3d64
[sdk/go] Add missing Version field to invokeOptions (#5401) 2020-09-17 12:21:50 -06:00
stack72 a7abb37b70 Prepare for v2.10.1 release 2020-09-16 16:02:33 +01:00
Evan Boyle 0e3666cc36
Automation API - add recovery APIs (cancel/export/import) (#5369) 2020-09-15 14:20:58 -07:00
Mike Metral 4e6ea760db feat(autoapi): add GetPermalink for operation result 2020-09-15 10:49:02 -07:00
Evan Boyle c23ca46382
Automation API - add the ability to stream progress updates during up/refresh/destroy (#5367) 2020-09-14 18:56:04 -07:00
Evan Boyle c05ac500da
[Automation API] remove stack name validation and fqsn enforcement (#5337) 2020-09-14 17:45:07 -07:00
Pat Gavlin 855f1fd1cd
Revise host mode. (#5317)
* Revise host mode.

The current implementation of host mode uses a `pulumi host` command and
an ad-hoc communication protocol between the engine and client to
connect a language host after the host has begun listening. The most
significant disadvantages of this approach are the communication
protocol (which currently requires the use of stdout), the host-specific
command, and the difficulty of accommodating the typical program-bound
lifetime for an update.

These changes reimplement host mode by adding engine support for
connecting to an existing language runtime service rather than launching
a plugin. This capability is provided via an engine-specific language
runtime, `client`, which accepts the address of the existing languge
runtime service as a runtime option. The CLI exposes this runtime via
the `--client` flag to the `up` and `preview` commands, which similarly
accepts the address of an existing language runtime service as an
argument. These changes also adjust the automation API to consume the
new host mode implementation.
2020-09-14 17:40:17 -07:00
Paul Stack aafe84d823
Add support for cloning private repos as part of automation API (#5333) 2020-09-14 20:24:57 +01:00
Gili Tzabari 0504780346
Update CHANGELOG.md (#5342)
Fixed typo
2020-09-14 18:29:07 +01:00
Paul Stack 9a46dad7d0
Add the ability to set the passphrase secrets provider to read from a passphrase file (#5327)
* Addthe ability to set the passphrase secrets provider to read from a passphrase file

* Feedback about removing newlines
2020-09-11 22:25:47 +01:00
Mikhail Shilkov f0386bec8d
Prevent concurrency issues when completing tasks (#5324)
* Prevent concurrency issues when completing tasks
2020-09-11 14:34:43 +02:00
stack72 848a98d511 Prepare for v2.10.0 release 2020-09-10 19:30:56 +01:00
Paul Stack 9a74064d2b
Allow passing a non-default secrets provider to AutomationAPI (#5320) 2020-09-10 19:25:47 +01:00
Mike Metral 49152e6331 feat(autoapi): add Upsert methods for stacks 2020-09-10 09:49:49 -07:00
Mike Metral 51c235352c feat(autoapi): add IsSelectStack404Error and IsCreateStack409Error 2020-09-09 17:13:50 -07:00
Justin Van Patten d0ba9fbdcd
[sdk/python] Add support for Sequence (#5282)
We currently emit array types as `List[T]` for Python, but `List[T]` is invariant, which causes type checkers like mypy to produce errors when values like `["foo", "bar"]` are passed as args typed as `List[pulumi.Input[str]]` (since `Input[str]` is an alias for `Union[T, Awaitable[T], Output[T]]`. To address this, we should move to using [`Sequence[T]`](https://docs.python.org/3/library/typing.html#typing.Sequence) which is covariant, and does not have this problem.

We actually already do this for `Dict` vs. `Mapping`, emitting map types as `Mapping[str, T]` rather than `Dict[str, T]` because `Mapping[str, T]` is covariant for the value. This change makes us consistent for array types.

These are the SDK changes necessary to support `Sequence[T]`.
2020-09-08 22:22:35 -07:00
evanboyle 6cc095be07 changelog 2020-09-08 17:31:44 -07:00
Pat Gavlin 2585b86aa4
Initial support for remote component construction. (#5280)
These changes add initial support for the construction of remote
components. For now, this support is limited to the NodeJS SDK;
follow-up changes will implement support for the other SDKs.

Remote components are component resources that are constructed and
managed by plugins rather than by Pulumi programs. In this sense, they
are a bit like cloud resources, and are supported by the same
distribution and plugin loading mechanisms and described by the same
schema system.

The construction of a remote component is initiated by a
`RegisterResourceRequest` with the new `remote` field set to `true`.
When the resource monitor receives such a request, it loads the plugin
that implements the component resource and calls the `Construct`
method added to the resource provider interface as part of these
changes. This method accepts the information necessary to construct the
component and its children: the component's name, type, resource
options, inputs, and input dependencies. It is responsible for
dispatching to the appropriate component factory to create the
component, then returning its URN, resolved output properties, and
output property dependencies. The dependency information is necessary to
support features such as delete-before-replace, which rely on precise
dependency information for custom resources.

These changes also add initial support for more conveniently
implementing resource providers in NodeJS. The interface used to
implement such a provider is similar to the dynamic provider interface
(and may be unified with that interface in the future).

An example of a NodeJS program constructing a remote component resource
also implemented in NodeJS can be found in
`tests/construct_component/nodejs`.

This is the core of #2430.
2020-09-07 19:33:55 -07:00
Mike Metral 46da25492e feat(autoapi): add workspace scoped envvars to LocalWorkspace and Stack 2020-09-03 09:57:23 -07:00
Mike Metral dec6a6a49a refactor(autoapi-gitrepo): use Workspace in SetupFn callback 2020-09-02 19:15:40 -07:00
stack72 c5c6f7c780 Prepare for v2.9.2 release 2020-08-31 17:15:42 +01:00
Justin Van Patten d13b840b43
Update changelog (#5261) 2020-08-31 08:58:43 -07:00
Evan Boyle 09964d2031
Merge branch 'master' into evan/auto 2020-08-28 19:11:14 -07:00
Justin Van Patten 69fbd70330
Python: Ignore internal properties when unmarshaling (#5251) 2020-08-28 18:26:16 -07:00
Scott Murray 60fcc1951b Added --suppress-permalink option
Added `--suppress-permalink` option to suppress the permalink output which addresses https://github.com/pulumi/pulumi/issues/4103
2020-08-28 21:37:48 +01:00
Evan Boyle ed2e5c6680
Merge branch 'master' into evan/auto 2020-08-28 08:48:08 -07:00
stack72 c42e3ca80a Prepare for v2.9.1 release 2020-08-27 23:07:46 +01:00
Justin Van Patten 16d226d667
Avoid raising unexpected type errors with Any (#5238)
Avoid raising an `AssertionError` due to unexpected types when a type is annotated as `Any`.
2020-08-27 12:19:46 -07:00
evanboyle 7fcf833b80 changelog 2020-08-25 12:05:27 -07:00