Commit graph

691 commits

Author SHA1 Message Date
Paul Stack 475250f82f
Adding pulumi.IsSecret and pulumi.Unsecret to the Go SDK (#6085) 2021-01-15 20:49:48 +00:00
Paul Stack 61ae57da0c
Add support for pulumi logout --all (#6101) 2021-01-15 13:38:58 +00:00
stack72 3853f530d2 Prepare for v2.17.2 release 2021-01-14 22:39:33 +00:00
Paul Stack 1cff1a4bcf
[sdk/python] Adding pulumi.unsecret and pulumi.is_secret (#6111) 2021-01-14 20:37:05 +00:00
Paul Stack ae9a6db36e
Add the ability to pulumi.unsecret an existing output (#6086)
Related: #5653

This will take an existing output and then unwrap the secret, and
return a new output

```
import * as pulumi from "@pulumi/pulumi";

const x = pulumi.secret("test")
export const xVal = x;

const y = pulumi.unsecret(x);
export const yVal = y;
```

```
▶ pulumi stack output
Current stack outputs (3):
    OUTPUT         VALUE
    xVal           [secret]
    yVal           test
```

Also adds the ability to check if an output is as secret:

```
import * as pulumi from "@pulumi/pulumi";

const x = pulumi.secret("test")
const isSecret = x.isSecret;

export const isSecretDeets = isSecret;
```
2021-01-14 20:36:52 +00:00
Komal dd66d8d2ab
Remove annotations import (#6109) 2021-01-14 12:36:11 -08:00
Pat Gavlin 683b4de2f0
Add .NET resource ref unit tests. (#6104)
- Add tests that serialize custom and component resources for targets
  that support resource references
- Add tests that serialize custom and component resources for downlevel
  targets
- Add tests that deserialize known custom and component resources
- Add tests that deserialize missing custom and component resources

These changes also fix a few bugs that were encountered during testing:
- Component resource construction was not supported
- Resources with missing packages could not be deserialized

In the latter case, a missing resource is deserialized as a generic
DependencyResource.

These changes also update the signature of IMocks.NewResourceAsync to
allow the returned ID to be null. This is technically a C# breaking change
with respect to nullability.

Contributes to #5943.

Co-authored-by: Mikhail Shilkov <github@mikhail.io>
2021-01-14 12:24:41 -08:00
Komal a35b61e0b5
[auto/go] - Set DryRun on RunInfo (#6099) 2021-01-13 13:05:36 -08:00
Vivek Lakshmanan 37487d3e61
Merge branch 'master' into vl/AutomationLogging 2021-01-13 10:24:12 -08:00
stack72 d25b74014e Prepare for v2.17.1 release 2021-01-13 14:48:16 +00:00
Komal 89b1d0d2c7
[automation-api/python] - Support recovery workflow (#6037) 2021-01-12 19:27:21 -08:00
Komal 059402483b
[Automation API] Python Implementation (#5979)
Co-authored-by: evanboyle <evan@pulumi.com>
2021-01-12 16:55:59 -08:00
Vivek Lakshmanan f68aa2396d Add changelog 2021-01-12 13:50:09 -08:00
Roderik van der Veer f5c65c18e8
fix: typo to get the outputs while registering them in a mock (#6040)
Resolves: #6039
2021-01-12 10:49:39 -08:00
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