Commit graph

5364 commits

Author SHA1 Message Date
stack72 a70cb41731 Prepare for v2.15.1 release 2020-12-04 20:06:10 +00:00
Sean Fausett 15941d58d9
Bump Grpc NuGet packages to 2.34.0 (#5862)
* Bump Grpc NuGet packages to 2.34.0

https://github.com/grpc/grpc/releases/tag/v1.34.0

* Remove redundant package reference

Transitive via project reference.
2020-12-04 16:58:18 +01: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
Justin Van Patten 260620430c
[codegen/(nodejs|python)] package/module registration with version info (#5839)
Generate ResourcePackage and ResourceModule implementations and
registrations. A ResourcePackage is generated for any module that
includes a provider resource (which should be the root module only), and
a ResourceModule is generated for any module that includes a resource.

And add version info to Python registrations.
2020-12-02 13:45:25 -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
Justin Van Patten c27d2921c1
Remove console.log call (#5845)
Remove console.log call that's adding unnecessary diagnostic messages to programs that use multi-lang components.
2020-12-01 16:35:30 -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
Levi Blackstone c3814a240c
Delete unused GCP creds (#5847)
These creds were previously used for TravisCI and
are no longer needed.
2020-12-01 21:39:46 +00:00
Levi Blackstone 948a9cc27d
[codegen/docs] Exclude eks package API links (#5843) 2020-12-01 12:03:08 -07:00
Justin Van Patten edc79325fe
Add support for getResource to Node.js SDK (#5837)
And update Node's resource ref deserialization to match Python.

Also, fixed a bug in Python resource ref deserialization that I noticed.
2020-12-01 10:58:15 -08:00
Levi Blackstone aec5ada15d
[sdk/go]: Add support for getResource to Go SDK (#5823)
- Clean up resourceOptions and associated methods
- Add URN field and setter function
- Invoke getResource if URN set
2020-12-01 11:03:47 -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
Eric Rudder fb78d1d9dd
go 1.13 to 1.15
as above
2020-11-30 10:41:03 -08: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
Justin Van Patten 06da84a752
Turn on support for resourceReferences behind feature flag (#5830) 2020-11-25 10:43:46 -08:00
Komal 600e296ee2
[codegen/python] - Enums (#5553) 2020-11-24 23:43:32 -06:00
Komal 995d3b9b6c
Remove UsesIOClasses check. (#5827) 2020-11-24 19:15:37 -06:00
Komal 48f43906f4
[sdk/python] - Support enums (#5615)
Co-authored-by: Pat Gavlin <pat@pulumi.com>
2020-11-24 19:15:11 -06:00
Pat Gavlin 4b90205f3f
[codegen/python/sdk]: package/module registration (#5806)
Generate ResourcePackage and ResourceModule implementations and
registrations. A ResourcePackage is generated for any module that
includes a provider resource (which should be the root module only), and
a ResourceModule is generated for any module that includes a resource.

Note that version information is currently omitted. We should fix this
up before enabling resource reference deserialization end-to-end.
2020-11-24 12:43:23 -08:00
Paul Stack b0580ab998
Ensure we don't panic or write import helper text on import errors (#5825)
Fixes: #5688
Fixes: #5737
2020-11-24 17:14:09 +00:00
Mikhail Shilkov 6138ee1cc7
Populate package for doc args types (#5822) 2020-11-24 11:20:25 +01:00
Lee Briggs bed7c64afb
use correct repository for actions build (#5820) 2020-11-24 02:49:09 +00:00
Paul Stack d64c58c731
Ensure the correct qualified code is emitted for Python ResourceOptions (#5824) 2020-11-24 02:21:25 +00:00
Pat Gavlin ef6da5709d
Update Python resource ref deserialization. (#5805)
There are two significant changes in this commit: one to the way
resource packages/modules are stored and retrieved, and one to resource
ref deserialization in the face of missing resource packages/modules.

Resource packages and modules no longer require an exact version match
during deserialization. Instead, the newest compatible version of the
package or module is selected. If no version was specified, the newest
version of the package or module will be chosen. As a special case, a
package or module that has no version will always be treated as the best
version for that package or module.

If a resource package or module is not found when attempting to
deserialize a resource reference, the SDK no longer emits an error, and
instead deserializes the reference as its URN or ID (if present). This
accommodates providers that have not yet been updated to include the
appropriate factory registrations.
2020-11-23 15:37:44 -08:00
Justin Van Patten a9d213107b
[codegen/(dotnet|python)]: Emit refs to provider resources (#5810) 2020-11-23 12:28:00 -08:00
Mikhail Shilkov ebb4ddb86a
Add support for getResource to the .NET SDK (#5817) 2020-11-23 20:55:03 +01:00
Pat Gavlin 807b09d6a6
Fix a few issues with resource references. (#5804)
- Differentiate between resource references that have no ID (i.e. because
  the referenced resource is not a CustomResource) and resource references
  that have IDs that are not known. This is necessary for proper
  backwards-compatible serialization of resource references.
- Fix the key that stores a resource reference's package version in the
  .NET, NodeJS, and Python SDKs.
- Ensure that the resource monitor's marshalling/unmarshalling  of inputs
  and outputs to/from calls to `Construct` retain resource references as
  appropriate.
- Fix serialization behavior for resources -> resource references in the
  Go SDK: if a resource's ID is unknown, it should still be serialized
  as a resource reference, albeit a reference with an unknown ID.
2020-11-23 11:15:10 -08:00
Paul Stack 8df7d24523
Trigger Template and Examples tests on a release (#5815)
Fixes: #5738

This will ensure we find any potential issues after a release
2020-11-23 17:47:57 +00:00
Komal 505d53421e
[codegen/python] - Include inputs import in provider.py (#5818) 2020-11-23 10:39:42 -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 9a707c4e03
Improve the output when installing plugins (#5808)
Two improvements:

1. Don't display "[resource plugin <foo>] installing" if the plugin is already installed.

2. Close the plugin download progress bar before displaying any subsequent output, and only show output of `npm install` when there is an error.
2020-11-21 08:02:05 -08:00
Pat Gavlin 20f7720869
Add support for getResource to the Python SDK. (#5694)
Just what it says on the tin.

The SDK code generator will be updated to use the new `urn`
resource option inside of each module's implementation of
`ResourceModule.construct`.

Part of #2430.

Co-authored-by: Justin Van Patten <jvp@justinvp.com>
2020-11-20 13:13:23 -08:00
Mikhail Shilkov a056daafd7
[codegen/dotnet] Handle external resource refs (#5791) 2020-11-20 21:09:34 +01:00
Pat Gavlin f527e06b21
Allow schemas to reference to provider types. (#5788)
These changes extend the type reference parser in the schema package to
accept references of the form "(package/version/schema.json)?#/provider".
These references refer to the package's provider type, which is
otherwise not referenceable, as it is not present in the "resources"
array.
2020-11-20 09:16:45 -08:00
Levi Blackstone 3586ab5d85
[codegen/python] Handle external schema refs (#5684) 2020-11-19 13:56:28 -07:00
Paul Stack 509be5003f
Ensure we pass a version with v prefix to bump-homebrew version (#5786) 2020-11-19 18:16:59 +00: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
Vivek Lakshmanan 2b435bb1a7
Merge pull request #5670 from pulumi/vl/GoEnumsCodegen
Adding support for go enum generation
2020-11-18 11:54:30 -08:00
Pat Gavlin f0951ce650
Rename engine.plan to engine.deployment. (#5777)
This name better suits the semantics of the type, and aligns with the
rename of deploy.Plan to deploy.Deployment. These changes also refactor
the `update` method s.t. previews and updates are more consistent in
their behavior (e.g. duration and resource changes are now reported for
both, incl. on error paths).
2020-11-18 11:16:30 -08:00
Vivek Lakshmanan 1cfbe5bdd5 Linting fixes 2020-11-18 10:57:01 -08:00
Vivek Lakshmanan 1ba418ee7b
Merge pull request #5751 from pulumi/vl/VerboseBuild
Reduce verbosity on tests
2020-11-18 10:38:06 -08:00
stack72 3919ef5010 Ensure we call the correct build container action in the container build command-dispatch 2020-11-18 18:12:42 +00:00
stack72 342a024207 Ensuring that a GitHub Token is present in the workflow release for docker builds 2020-11-18 18:04:11 +00:00
Pat Gavlin 0981df6a7a
Rename deploy.Plan to deploy.Deployment. (#5774)
Rename deploy.Plan to deploy.Deployment.

There are two benefits to this change:

1. The name "Deployment" more accurately reflects the behavior of the
   type, which is responsible for previewing or executing a deployment.
2. Renaming this type frees up the name "Plan" for use when addressing
   #2318.
2020-11-18 09:47:52 -08:00
Vivek Lakshmanan d1caee26d3 Update makeSafeEnum semantics to match other languages 2020-11-18 09:44:30 -08:00
Vivek Lakshmanan 55e86bf078
Update sdk/python/Makefile
Co-authored-by: Komal <komal@pulumi.com>
2020-11-18 09:21:41 -08:00