Commit graph

346 commits

Author SHA1 Message Date
CyrusNajmabadi b9c57858ed
Update changelog. (#2819) 2019-06-12 15:47:17 -07:00
CyrusNajmabadi 54cbda80c1
Store information about a CustomResource's provider in __providers. (#2816) 2019-06-11 16:57:37 -07:00
Matt Ellis bc9448b1cf Fix crash in pulumi stack output when stack is empty 2019-06-11 12:58:29 -07:00
Matt Ellis 1e519ce150 Fix a bug when logging into bucket urls
Currently if you log into s3://bucket/subdirectory, Pulumi will write
files to s3://bucket/.pulumi and not s3://bucket/subdirectory/.pulumi,
this corrects the error.
2019-06-10 13:43:17 -07:00
Mike Metral 803533d7d4 docs(login): escape codeblocks, and add object store state instructions 2019-06-07 10:37:06 -07:00
CyrusNajmabadi 55bb3b2486
Simplify API for passing providers to a ComponentResource. (#2609) 2019-06-06 16:20:12 -07:00
Matt Ellis e8a5acf1f2 Prepare CHANGELOG.md for release 2019-06-06 10:35:24 -07:00
Pat Gavlin dfa120e6b4
Check for provider changes in mustWrite (#2805)
Recent changes to default provider semantics and the addition of
resource aliases allow a resource's provider reference to change even if
the resource itself is considered to have no diffs. `mustWrite` did not
expect this scenario, and indeed asserted against it. These changes
update `mustWrite` to detect such changes and require that the
checkpoint be written if and when they occur.

Fixes #2804.
2019-06-05 16:27:26 -07:00
Matt Ellis fdc4c64789 Update v0.17.15 release date 2019-06-05 09:39:11 -07:00
Matt Ellis 4e429592d6 Update CHANGELOG.md for release
[skip ci]
2019-06-04 11:39:19 -07:00
Sean Gillespie 2870518a64 Refine resource replacement logic for providers (#2767)
This commit touches an intersection of a few different provider-oriented
features that combined to cause a particularly severe bug that made it
impossible for users to upgrade provider versions without seeing
replacements with their resources.

For some context, Pulumi models all providers as resources and places
them in the snapshot like any other resource. Every resource has a
reference to the provider that created it. If a Pulumi program does not
specify a particular provider to use when performing a resource
operation, the Pulumi engine injects one automatically; these are called
"default providers" and are the most common ways that users end up with
providers in their snapshot. Default providers can be identified by
their name, which is always prefixed with "default".

Recently, in an effort to make the Pulumi engine more flexible with
provider versions, it was made possible for the engine to have multiple
default providers active for a provider of a particular type, which was
previously not possible. Because a provider is identified as a tuple of
package name and version, it was difficult to find a name for these
duplicate default providers that did not cause additional problems. The
provider versioning PR gave these default providers a name that was
derived from the version of the package. This proved to be a problem,
because when users upgraded from one version of a package to another,
this changed the name of their default provider which in turn caused all
of their resources created using that provider (read: everything) to be
replaced.

To combat this, this PR introduces a rule that the engine will apply
when diffing a resource to determine whether or not it needs to be
replaced: "If a resource's provider changes, and both old and new
providers are default providers whose properties do not require
replacement, proceed as if there were no diff." This allows the engine
to gracefully recognize and recover when a resource's default provider changes
names, as long as the provider's config has not changed.
2019-06-03 12:16:31 -07:00
Matt Ellis 0fbce2c9ce Update CHANGELOG.md 2019-06-03 09:31:50 -07:00
Luke Hoban 15e924b5cf
Support aliases for renaming, re-typing, or re-parenting resources (#2774)
Adds a new resource option `aliases` which can be used to rename a resource.  When making a breaking change to the name or type of a resource or component, the old name can be added to the list of `aliases` for a resource to ensure that existing resources will be migrated to the new name instead of being deleted and replaced with the new named resource.

There are two key places this change is implemented. 

The first is the step generator in the engine.  When computing whether there is an old version of a registered resource, we now take into account the aliases specified on the registered resource.  That is, we first look up the resource by its new URN in the old state, and then by any aliases provided (in order).  This can allow the resource to be matched as a (potential) update to an existing resource with a different URN.

The second is the core `Resource` constructor in the JavaScript (and soon Python) SDKs.  This change ensures that when a parent resource is aliased, that all children implicitly inherit corresponding aliases.  It is similar to how many other resource options are "inherited" implicitly from the parent.

Four specific scenarios are explicitly tested as part of this PR:
1. Renaming a resource
2. Adopting a resource into a component (as the owner of both component and consumption codebases)
3. Renaming a component instance (as the owner of the consumption codebase without changes to the component)
4. Changing the type of a component (as the owner of the component codebase without changes to the consumption codebase)
4. Combining (1) and (3) to make both changes to a resource at the same time
2019-05-31 23:01:01 -07:00
Praneet Loke 5ac446fffd
Add CI vars for Bitbucket Pipelines (#2783)
* Introduce a new package under ciutil for individual CI systems. Split-out each CI system with env var detection for each.

* Add Bitbucket Piplines env var detection.

* Update changelog with note about adding Bitbucket Pipelines detection.

* Rename the CI system structs.

* Move files from ciutil/systems to ciutil. Un-export some types that don't need visibility beyond the ciutil package.

* Un-export DetectSystem function and the System type.

* Add a test for CI systems which we only know by name and nothing else, i.e. those with just a baseCI implementation.
2019-05-30 17:35:41 -07:00
Pat Gavlin 2324eaaa59
Add StackReference to the Python SDK (#2786)
This commit adds StackReference to the Python SDK, which uses
read_resource to read the remote state of a a Pulumi stack.
2019-05-30 14:12:37 -07:00
Sean Gillespie eda5de0f88 Implementation of Read for Python (#2752)
This commit implements read_resource functionality for Python in a
manner identical to the NodeJS implementation. If an "id" option is
passed to a resource via ResourceOptions on construction, that resource
will be read and not created.
2019-05-30 11:04:47 -07:00
Justin Van Patten 5df2b15320
Update CHANGELOG.md (#2778) 2019-05-28 17:31:41 -07:00
CyrusNajmabadi b84b3d487d
Revert "Simplify signature of pulumi.all (#2527)" (#2775)
This reverts commit b32892e0c1.
2019-05-28 10:54:56 -07:00
Joe Duffy bf75fe0662
Suppress JSON outputs in preview correctly (#2771)
If --suppress-outputs is passed to `pulumi preview --json`, we
should not emit the stack outputs. This change fixes pulumi/pulumi#2765.

Also adds a test case for this plus some variants of updates.
2019-05-25 12:10:38 +02:00
Matt Ellis 0574d8cd6f Attempt to download plugins before doing a refresh
Like `preview`, `update` and `destroy` we should ensure any plugins
that are listed in the snapshot are present.

Fixes #2669
2019-05-24 16:12:22 -07:00
stack72 19bf51d89a cmd/whoami: Move the changelog entry to unreleased
This was originally part of an older release but it has since been
moved to unreleased as it was only recently merged
2019-05-23 12:37:19 +02:00
Paul Stack fa691d8c40
cli/whoami: Addition of the currently connected backend to whoami (#2686)
cli/whoami: Addition of the currently connected backend to whoami
2019-05-22 15:57:52 +03:00
stack72 6ab390a815 cli/whoami: Addition of the currently connected backend to whoami
This is an attempt towards #2684

I am not sure if this is too simplistic for now OR we need to
consider if this will break anyones automation as they maybe using
the output of that command as plain text

Before:

```
▶ pulumi whoami
stack72
```

After:

```
▶ pulumi whoami
User: stack72
Backend URL: https://app.pulumi.com/stack72
```
2019-05-22 14:45:04 +02:00
Matt Ellis 61bff0c3a4 Do not parse version from resource providers
Until we can come up with a solution for #2753, just ignore the
version that comes in as part of a resource monitor RPC.
2019-05-21 19:20:18 -07:00
Fraser Waters d5b45ac5ad Move windows path fix changelog entry to 17.13 (#2749)
Was merged into the 17.11 changelog
2019-05-21 18:11:44 -07:00
Matt Ellis 31bd463264 Gracefully handle the case where secrets_provider is uninitalized
A customer reported an issue where operations would fail with the
following error:

```
error: could not deserialize deployment: unknown secrets provider type
```

The problem here was the customer's deployment had a
`secrets_provider` section which looked like the following:

```
"secrets_providers": {
    "type": ""
}
```

And so our code to try to construct a secrets manager from this thing
would fail, as our registry does not contain any information about a
provider with an empty type.

We do two things in this change:

1. When serializing a deployment, if there is no secrets manager,
don't even write the `secrets_provider` block. This helps for cases
where we are roundtripping deployments that did not have a provider
configured (i.e. they were older stacks that did not use secrets)

2. When deserializing, if we see an empty secrets provider like the
above, interpret it to mean "this deployment has no secrets". We set
up a decrypter such that if it ends up haiving secrets, we panic
eagerly (since this is a logical bug in our system somewhere).
2019-05-21 17:11:54 -07:00
CyrusNajmabadi b32892e0c1
Simplify signature of pulumi.all (#2527) 2019-05-21 13:13:23 -04:00
CyrusNajmabadi 2246a97c17
Always normalize paths to forward slashes to properly work with gocloud (#2747) 2019-05-20 14:46:00 -04:00
Matt Ellis 7ca9721d23 Apply colorization to the ---outputs--- line
We were not actually calling our colorization routines, which lead to
printing this very confusing text:

```
<{%reset%}>    --outputs:--<{%reset%}>
```

When running updates with `--diff` or when drilling into details of a
proposed operation, like a refresh.
2019-05-20 11:43:02 -07:00
Matt Ellis 4f693af023 Do not pass arguments as secrets to CheckConfig/Configure
Providers from plugins require that configuration value be
strings. This means if we are passing a secret string to a
provider (for example, trying to configure a kubernetes provider based
on some secret kubeconfig) we need to be careful to remove the
"secretness" before actually making the calls into the provider.

Failure to do this resulted in errors saying that the provider
configuration values had to be strings, and of course, the values
logically where, they were just marked as secret strings

Fixes #2741
2019-05-17 16:42:29 -07:00
Matt Ellis 2cd4409c0d Fix a panic during property diffing
We have to actually return the value we compute instead of just
dropping it on the floor and treating the underlying values as
primitive.

I ran into this during dogfooding, the added test case would
previously panic.
2019-05-15 16:20:25 -07:00
Matt Ellis 137b517c13 Prepare for release 2019-05-15 12:04:43 -07:00
Matt Ellis b4cca4a108 Update CHANGELOG.md 2019-05-15 09:33:02 -07:00
Matt Ellis e453c7db9e Eagerly validate secrets-provider option
Validate the value is well formed much earlier so you don't end up
seeing you've picked a bad value in the middle of trying to create
your new stack. Update the helptext to list currently supported
values.

Fixes #2727
2019-05-15 00:02:29 -07:00
Matt Ellis c91ddf996b Do not prompt for passphrase multiple times
The change does two things:

- Reorders some calls in the CLI to prevent trying to create a secrets
  manager twice (which would end up prompting twice).

- Adds a cache inside the passphrase secrets manager such that when
  decrypting a deployment, we can re-use the one created earlier in
  the update. This is sort of a hack, but is needed because otherwise
  we would fail to decrypt the deployment, meaning that if you had a
  secret value in your deployment *and* you were using local
  passphrase encryption *and* you had not set PULUMI_CONFIG_PASSPHRASE
  you would get an error asking you to do so.

Fixes #2729
2019-05-14 23:35:27 -07:00
Matt Ellis f6c25b7d2d Update Changelog for 0.17.11 2019-05-13 17:38:19 -07:00
Matt Ellis 5a5d320b7d Wordsmith CHNAGELOG.md 2019-05-10 17:12:35 -07:00
Matt Ellis 16932873a4 Update CHANGELOG.md 2019-05-10 17:07:52 -07:00
Cameron Stokes 1927b1c908 ~CHANGELOG: Change date format of recent release (#2716)
Be consistent with previous date formats (and use a format that's less ambiguous).
2019-05-10 16:55:09 -07:00
Erin Krengel b0327b96db
Ekrengel/fix azure urls (#2709)
* Fix GetVSCInfo for various Azure urls
2019-05-08 09:25:59 -07:00
Praneet Loke f4112a4ea1
Add detection of Azure Pipelines (#2705)
* Add a var for PRNumber. Add an environment metadata key for PR number.

* Move the detection of PULUMI_CI_SYSTEM into vars.DetectVars(). Set the PRNumber CI property based on respective env vars from each CI system.

* Add Azure Pipelines build variables.

* Add tests for DetectVars.

* Added changelog entry for Azure Pipelines.

* Capture the value of env var being modified for the ciutil unit test, and restore their values at the end of them.

* Simplify the DetectVars function by moving the Pulumi CI system code into the switch-case expression.

* Rename the Pulumi CI system to Generic CI. Include the GenericCI system in the test case for DetectVars.
2019-05-07 11:49:13 -07:00
Justin Van Patten fedfc9b6b4
pulumi update => pulumi up (#2702)
We changed the `pulumi update` command to be `pulumi up` a while back
(`update` is an alias of `up`). This change just makes it so we refer to
the actual command, `pulumi up`, instead of the older `pulumi update`.
2019-05-06 14:00:18 -07:00
CyrusNajmabadi b146733a26
Update changelog. (#2699) 2019-05-04 21:58:17 -07:00
Matt Ellis 2efde733b2
Merge pull request #2694 from bigkraig/contrib
Minor contributing doc improvement
2019-05-02 16:53:35 -07:00
CyrusNajmabadi daca809d09
Fix local file:// stacks on Windows. (#2696) 2019-05-02 16:52:00 -07:00
Matt Ellis 769cd7ce07
Merge pull request #2615 from pulumi/ellismg/scout-node-12
Support Node 12
2019-05-02 10:25:00 -07:00
Kraig Amador 7dac095d98
Updated CHANGELOG 2019-05-02 10:20:48 -07:00
Luke Hoban 3062ba7c4f
Move CHANGELOG entry for pulumi preview --json (#2690)
This was first released in `0.17.9` not `0.17.8`.
2019-05-01 12:39:18 -07:00
Matt Ellis de78ddb4b6 Update CHANGELOG.md 2019-05-01 10:05:33 -07:00
Justin Van Patten cde23669e2
pulumi new: Suppress npm warnings (#2685)
Right now, when we run `npm install` as part of `pulumi new`, the
following warnings are emitted:

```
node-pre-gyp WARN Using needle for node-pre-gyp https download

...

npm WARN aws-typescript@ No description
npm WARN aws-typescript@ No repository field.
npm WARN aws-typescript@ No license field.
```

We can suppress these warnings by specifying `--loglevel=error` to the
`npm install` command.
2019-05-01 09:17:53 -07:00
Justin Van Patten 55b233fbdc
Update CHANGELOG for 0.17.9 (#2687) 2019-04-30 11:01:58 -07:00
Justin Van Patten 95d51efe6a
pulumi new: Ensure the stack is selected (#2683)
Ensure the stack is selected when using `pulumi new` with an existing
stack (e.g. a stack created on app.pulumi.com).
2019-04-29 13:32:15 -07:00
Fraser Waters 6a2c9ae4f8 Update CHANGELOG.md 2019-04-27 21:47:49 +01:00
joeduffy 250bcb9751 Add a --json flag to the preview command
This change adds a --json flag to the preview command, enabling
basic JSON serialization of preview plans. This effectively flattens
the engine event stream into a preview structure that contains a list
of steps, diagnostics, and summary information. Each step contains
the deep serialization of resource state, in addition to metadata about
the step, such as what kind of operation it entails.

This is a partial implementation of pulumi/pulumi#2390. In particular,
we only support --json on the `preview` command itself, and not `up`,
meaning that it isn't possible to serialize the result of an actual
deployment yet (thereby limiting what you can do with outputs, etc).
2019-04-25 17:36:31 -07:00
PLACE 70bc0436ed Add support for state in cloud object storage (S3, GCS, Azure) (#2455) 2019-04-24 20:55:39 -07:00
Mike Metral 24f08ddb0f Update CHANGELOG for 0.17.8 2019-04-23 13:21:56 -07:00
Luke Hoban 0550f71a35
Add an ignoreChanges resource option (#2657)
Fixes #2277.

Adds a new ignoreChanges resource option that allows specifying a list of property names whose values will be ignored during updates. The property values will be used for Create, but will be ignored for purposes of updates, and as a result also cannot trigger replacements.

This is a feature of the Pulumi engine, not of the resource providers, so no new logic is needed in providers to support this feature. Instead, the engine simply replaces the values of input properties in the goal state with old inputs for properties marked as ignoreChanges.

Currently, only top level properties may be specified in ignoreChanges. In the future, this could be extended to support paths to nested properties (including into array elements) with a JSONPath/JMESPath syntax.
2019-04-22 13:54:48 -07:00
Joe Duffy 3b93199f7a Use Outputs instead of merged Inputs+Outputs (#2659)
Fixes #2650.

We have historically relied on merging inputs and outputs in several places in the engine. This used to be necessary, as discussed in #2650 (comment), but our core engine model has moved away from depending on this. However, we still have a couple places we do this merge, and those places have triggered several severe issues recently in subtle cases.

We believe that this merging should no longer be needed for a correct interpretation of the current engine model, and indeed that doing the merge actively violates the contract with providers. In this PR we remove the remaining places where this input + output merge was being done. In all three cases, we use just the Outputs, which for most providers will already include the same values as the inputs - but correctly as determined by the provider itself.
2019-04-22 13:52:36 -07:00
Matt Ellis f78c2f58f6 Update CHANGELOG.md for release 2019-04-17 08:19:52 -07:00
Joe Duffy 644d5dc916
Enable unit testing for Pulumi programs (#2638)
* Enable unit testing for Pulumi programs

This change enables rudimentary unit testing of your Pulumi programs, by introducing a `PULUMI_TEST_MODE` envvar that, when set, allows programs to run without a CLI. That includes

* Just being able to import your Pulumi modules, and test ordinary functions -- which otherwise would have often accidentally triggered the "Not Running in a CLI" error message
* Being able to verify a subset of resource properties and shapes, with the caveat that outputs are not included, due to the fact that this is a perpetual "dry run" without any engine operations occurring

In principle, this also means you can attach a debugger and step through your code.

* Finish the unit testing features

This change

1) Incorporates CR feedback, namely requiring that test mode be
   explicitly enabled for any of this to work.

2) Implements Python support for the same capabilities.

3) Includes tests for both JavaScript and Python SDKs.

* Add a note on unit testing to the CHANGELOG

* Use Node 8 friendly assert API

* Embellish the CHANGELOG entry a bit
2019-04-16 22:20:01 -07:00
Levi Blackstone 2532ce0527
Update changelog for 0.17.6 release (#2639) 2019-04-11 11:53:17 -06:00
Alex Clemmer fac6944781 Warn instead of error when refresh'd resource is unhealthy
Fixes #2633.

Currently when a user runs `refresh` and a resource is in a state of
error, the `refresh` will fail and the resource state will not be
persisted. This can make it vastly harder to incrementally fix
infrastructure. The issue mentioned above explains more of the
historical context, as well as some specific failure modes.

This commit resolves this issue by causing refresh to *not* report an
error in this case, and instead to simply log a warning that the
`refresh` has recognized that the resource is in an unhealthy state
during state sync.
2019-04-10 16:43:33 -07:00
Matt Ellis 44292747d4 Collect logs from Google Cloud Functions
This change adds an operations provider for GCP. Right now, it can
just collect logs from google cloud functions, similar to `gcloud
functions logs read`
2019-04-08 09:44:05 -07:00
Joe Duffy cc7a657628
Make the Python SDK's Config.name argument optional (#2624)
This makes the Python SDK's Config constructor name argument
optional, similar to what we do in the Node.js SDK. If not supplied,
the current project name is used as the default.
2019-04-04 16:55:01 -07:00
CyrusNajmabadi 1f51ec00fc
Revert 'Simplify API for passing providers to a ComponentResource (#2602)' (#2606) 2019-03-28 18:31:03 -07:00
CyrusNajmabadi 7193622183
Simplify API for passing providers to a ComponentResource (#2602) 2019-03-28 15:04:07 -07:00
Matt Ellis 2ace3e7b0c Correctly handle FileArchives when the filename contains a dot
Our logic for how we handled `.tar.gz` archives meant that any other
type of file that had a dot in the filename would not be detected
correctly.

Fixes #2589
2019-03-28 13:26:07 -07:00
CyrusNajmabadi b1c9386926
Update changelog (#2594) 2019-03-26 16:53:37 -07:00
CyrusNajmabadi 992952b54f
Revert "Better present interpolated strings during preview. (#2564)" (#2593) 2019-03-26 16:36:43 -07:00
Matt Ellis ccd958777c Don't print error prefix when a confirmation prompt is declined
Use `result.Result` in more places, so when a confirmation prompt is
declined, we just return `result.Bail()` after printing a message
without the `error: ` prefix.

Fixes #2070
2019-03-26 15:17:18 -07:00
Sean Gillespie f34aef2f4d
Prepare CHANGELOG.md for release (#2591) 2019-03-26 14:45:09 -07:00
Sean Gillespie 4d227f7ed2
Load default providers deterministically (#2590)
* Load default providers deterministically

This commit adds a new algorithm for deriving a list of default
providers from the set of plugins reported from the language host and
from the snapshot. If the language host reports a set of plugins,
default providers are sourced directly from that set, otherwise default
providers are sourced from the full set of plugins, including ones from
the snapshot.

When multiple versions of the same provider are requested, the newest
version of that provider is always select as the default provider.

* Add CHANGELOG.md entry

* Skip the language host's plugins if it reports no resource plugins

* CR feedback

* CR: Log when skipping non resource plugin
2019-03-26 13:29:34 -07:00
Matt Ellis 3621c01f4b Fix spurious warnings when using dynamic provider
When using a dynamic provider, the following messages are printed,
because we did not update the dynamic provider when we added these new
RPCs:

```
Method handler checkConfig for /pulumirpc.ResourceProvider/CheckConfig expected but not provided
Method handler diffConfig for /pulumirpc.ResourceProvider/DiffConfig expected but not provided
```

Given that we don't do anything for the `configure` RPC today, we can
also just no-op these RPCs as well.
2019-03-26 12:04:15 -04:00
CyrusNajmabadi 906488c7d0
Fix issue where we could not serialize an arrow-function with a deconstructed parameter. (#2582) 2019-03-22 16:48:38 -07:00
CyrusNajmabadi be1c3eb05b
Add support for serializing bigints (#2581) 2019-03-22 15:33:37 -07:00
Matt Ellis a1bb16407d Add pulumi stack rename
`pulumi stack rename` allows you to change the name of an existing
stack. This operation is non-distructive, however it is possible that
the next update will show additional changes to resources, if the
pulumi program uses the value of `getStack()` as part of a resource
name.
2019-03-19 11:04:33 -07:00
Matt Ellis b774917e57 Prepare CHANGELOG.md for release 2019-03-15 15:21:34 -07:00
Sean Gillespie 26cc1085b1
Install missing plugins on startup (#2560)
* Install missing plugins on startup

This commit addresses the problem of missing plugins by scanning the
snapshot and language host on startup for the list of required plugins
and, if there are any plugins that are required but not installed,
installs them. The mechanism by which plugins are installed is exactly
the same as 'pulumi plugin install'.

The installation of missing plugins is best-effort and, if it fails,
will not fail the update.

This commit addresses pulumi/pulumi-azure#200, where users using Pulumi
in CI often found themselves missing plugins.

* Add CHANGELOG

* Skip downloading plugins if no client provided

* Reduce excessive test output

* Update Gopkg.lock

* Update pkg/engine/destroy.go

Co-Authored-By: swgillespie <sean@pulumi.com>

* CR: make pluginSet a newtype

* CR: Assign loop induction var to local var
2019-03-15 15:01:37 -07:00
Pat Gavlin d14f47b162
Elide diffs in internal properties (#2543)
Various providers use properties that begin with "__" to represent
internal metadata that should not be presented to the user. These
changes look for such properties and elide them when displaying diffs.
2019-03-11 18:01:48 -07:00
Pat Gavlin 7ebd70a3e6
Refresh inputs (#2531)
These changes take advantage of the newly-added support for returning
inputs from Read to update a resource's inputs as part of a refresh.
As a consequence, the Pulumi engine will now properly detect drift
between the actual state of a resource and the desired state described
by the program and generate appropriate update or replace steps.

As part of these changes, a resource's old inputs are now passed to the
provider when performing a refresh. The provider can take advantage of
this to maintain the accuracy of any additional data or metadata in the
resource's inputs that may need to be updated during the refresh.

This is required for the complete implementation of
https://github.com/pulumi/pulumi-terraform/pull/349. Without access to
the old inputs for a resource, TF-based providers would lose all
information about default population during a refresh.
2019-03-11 13:50:00 -07:00
Justin Van Patten 7d7e104ee3
Stop running up as part of pulumi new (#2539)
Originally, `pulumi new` did not run `up` after generating a project. To
help users get a deployed stack as quickly as possible, we changed
`pulumi new` to run an initial deployment at the end of its operation.
Users would first see a preview and get to decide whether to proceed
with an initial deployment, and then continue to iterate from there.

Note that this would only happen for nodejs projects
(TypeScript/JavaScript). We would not run `up` for Python projects as we
require the user to run `pip install` in a virtualenv, so we'd print
instructions with the necessary commands the user must run instead.

Running `up` as part of `pulumi new` for nodejs projects has ended up
being more confusing than helpful for new users, and annoying for
experienced users. New users aren't expecting `pulumi new` to run an
initial deployment after generating the project (they haven't even
looked at the project source yet). Experienced users find it frustrating
as you typically want to just generate the project, and don't want to
have to wait for the preview just to decline running the update.

This change reverts `pulumi new` back to not running `up` automatically
for nodejs projects. Instead, like with Python projects, at the end of
the operation, we print instructions to the user to run `pulumi up` to
deploy the project.
2019-03-11 12:32:40 -07:00
CyrusNajmabadi 680f7bf84e
Update changelog (#2532) 2019-03-07 12:47:23 -08:00
Pat Gavlin 4b33a45561
Filter diff keys based on provider info (#2526)
If a provider returns information about the top-level properties that
differ, use those keys to filter the diffs that are rendered to the
user.

Fixes #2453.
2019-03-06 16:41:19 -08:00
Justin Van Patten 7784c94c88
Show brew upgrade when installed with Homebrew (#2519)
Show `brew upgrade pulumi` as the upgrade message when the currently
running pulumi executable is on macOS and running from the brew install
directory.
2019-03-06 10:56:44 -08:00
CyrusNajmabadi 62b6f1c3b2
Spelling (#2521) 2019-03-06 02:58:08 -08:00
CyrusNajmabadi d6d839608b
Tweak signature of .apply to help TS infer things better. (#2520) 2019-03-06 01:53:58 -08:00
CyrusNajmabadi d06c0af32f
Update changelog (#2516) 2019-03-05 17:29:53 -08:00
CyrusNajmabadi 7f5e089f04
Update @pulumi/pulumi to version 0.17.0 (#2510)
This update includes several changes to core `@pulumi/pulumi` constructs that will not play nicely
in side-by-side applications that pull in prior versions of this package.  As such, we are rev'ing
the minor version of the package from 0.16 to 0.17.  Recent version of `pulumi` will now detect,
and warn, if different versions of `@pulumi/pulumi` are loaded into the same application.  If you
encounter this warning, it is recommended you move to versions of the `@pulumi/...` packages that
are compatible.  i.e. keep everything on 0.16.x until you are ready to move everything to 0.17.x.

### Improvements

- `Output<T>` now 'lifts' property members from the value it wraps, simplifying common coding patterns.  Note: this wrapping only happens for POJO values, not `Output<Resource>`s. 

- Depending on a **Component** Resource will now depend on all other Resources parented by that
  Resource. This will help out the programming model for Component Resources as your consumers can
  just depend on a Component and have that automatically depend on all the child Resources created
  by that Component.  Note: this does not apply to a **Custom** resource.  Depending on a
  CustomResource will still only wait on that single resource being created, not any other Resources
  that consider that CustomResource to be a parent.
2019-03-05 17:06:57 -08:00
CyrusNajmabadi 5a08bf5daa
Update changelog. (#2504) 2019-03-01 18:56:12 -08:00
CyrusNajmabadi 66ada50ccf
Do a version check and emit a warning if major/minor versions of @pulumi/pulumi do not match. (#2503) 2019-03-01 17:43:26 -08:00
Sean Gillespie 1b6fe6271f
Look for exact match when loading plugins (#2483)
* Look for exact match when loading plugins

Pulumi's current behavior when loading plugins is surprising in that it
will attempt to load the "latest" provider binary instead of exactly the
version that was requested. Since provider binaries and provider
packages are tied together and versioned together, this is going to be
problematic if a provider makes a breaking change.

Although there are other issues in this area, this commit fixes the
arguably bug-like behavior of loading the latest plugin and instead opts
to load the plugin that exactly the requested semver range. Today, the
engine will never ask for anything other than an exact version match.

Since this is a breaking change, this commit also includes an
environment variable that allows users to return back to the "old"
plugin loading behavior if they are broken. The intention is that this
escape hatch can be removed in a future release once we are confident
that this change does not break people.

* CR feedback

* Use SelectCompatiblePlugin for HasPluginGTE check
2019-03-01 15:42:38 -08:00
CyrusNajmabadi 3d1df982de
Incorrect closure serialization when object referenced through different functions. (#2497) 2019-02-28 11:11:43 -08:00
CyrusNajmabadi aa3c6d0ba6
Converting an Output to a string or JSON now produces a warning . (#2496) 2019-02-27 16:00:54 -08:00
Cyrus Najmabadi 34f83de210 Rollback waiting on children of a component when waiting on the component.
(cherry picked from commit d1ecc5a250)
2019-02-27 12:31:57 -08:00
CyrusNajmabadi c53f697a6f
Fix deadlock when waiting for transitive dependencies (#2471) 2019-02-24 12:14:16 -08:00
CyrusNajmabadi 967c6407a0
Revert "Simplify how we export the .all operator (#2467)" (#2469)
This reverts commit 93c9464125.
2019-02-23 19:54:28 -08:00
CyrusNajmabadi 93c9464125
Simplify how we export the .all operator (#2467) 2019-02-22 12:02:52 -08:00
CyrusNajmabadi ee5b13cb10
Update changelog (#2466) 2019-02-22 01:00:00 -08:00
CyrusNajmabadi 27b04c4c62
Have child resources update their parent urn to include themselves in its dependencies. (#2299) 2019-02-21 20:18:29 -08:00
Justin Van Patten b064a03054
Return error from stack tag commands in local mode (#2457)
Instead of operating as no-ops, return an error to make it more clear
that these commands are not currently implemented when using --local
mode.
2019-02-19 16:07:57 -08:00
Sean Gillespie e0b516d0cc
Fix an issue with empty ID for CustomResource (#2449)
* Fix an issue with empty ID for CustomResource

The Python runtime was checking the ID field it receives from the engine
against None, assuming that the engine would not set the ID field if one
was not present. However, it does set the ID field; it is set to the
empty string when an ID is not known.

This commit fixes an issue that can cause certain IDs to be erroneously
considered to be known during previews, which can cause problems during
the Check phase of resources that directly reference IDs of other
resources.

* Add CHANGELOG
2019-02-15 09:55:19 -08:00
Sean Gillespie c720d1329f
Enable delete parallelism for Python (#2443)
* Enable delete parallelism for Python

* Add CHANGELOG.md entry

* Expand changelog message - upgrade to Python 3

* Rework stack rm test

The service now allows removing a stack if it just contains the top
level `pulumi:pulumi:Stack` resource, so we need to actually create
another resource before `stack rm` fails telling you to pass
`--force`.

Fixes #2444
2019-02-12 14:49:43 -08:00
Luke Hoban 06d3c7811f
Fix date text 2019-02-11 15:28:17 -08:00
Matt Ellis 687a780b20 Show a better error when --force needs to be passed to stack rm
When `pulumi stack rm` is run against a stack with resources, the
service will respond with an error if `--force` is not
passed. Previously we would just dump the contents of this error and
it looked something like:

`error: [400] Bad Request: Stack still has resources.`

We now handle this case more gracefully, showing our usual "this stack
still has resources" error like we would for the local backend.

Fixes #2431
2019-02-07 15:25:02 -08:00
Pat Gavlin 6e90ab0341
Add support for explicit delete-before-replace (#2415)
These changes add a new flag to the various `ResourceOptions` types that
indicates that a resource should be deleted before it is replaced, even
if the provider does not require this behavior. The usual
delete-before-replace cascade semantics apply.

Fixes #1620.
2019-01-31 14:27:53 -08:00
Matt Ellis a627cf817a Ensure InvokeRequest is defined
InvokeRequest is defined in provider_pb.js not resource_pb.js. Require
that module instead.
2019-01-31 12:00:32 -08:00
Matt Ellis 07130913df Prepare for v0.16.13 2019-01-30 21:17:34 -08:00
Matt Ellis 50c2ebbdd5 Improve StackReference error message
Because of the change to include a stack's project as part of its
identity in the service, the names passed to StackReference now
require the project name as well.

Improve the error message when they do not include them.
2019-01-30 15:57:44 -08:00
Matt Ellis e950ab1e51 Update CHANGELOG.md for 0.16.12 2019-01-25 15:26:01 -08:00
Matt Ellis f94e2e7bcc Update CHANGELOG.md 2019-01-25 12:52:33 -08:00
Matt Ellis 902be2b0b0 Use project name as part of stack identity with cloud backend
This change starts to use a stack's project name as part of it's
identity when talking to the cloud backend, which the Pulumi Service
now supports.

When displaying or parsing stack names for the cloud backend, we now
support the following schemes:

`<stack-name>`
`<owner-name>/<stack-name>`
`<owner-name>/<project-name>/<stack-name>`

When the owner is not specificed, we assume the currently logged in
user (as we did before). When the project name is not specificed, we
use the current project (and fail if we can't find a `Pulumi.yaml`)

Fixes #2039
2019-01-24 16:56:54 -08:00
Justin Van Patten dee2c37d9d
pulumi new improvements (#2379)
Some changes to `pulumi new` to improve the experience:

 - Color the default values for config differently to make them stand
   out better
 - Mention that `new` will also perform an initial deployment
 - Add more vertical whitespace between steps in the process
 - Print message indicating the "Installing dependencies" step is
   complete
 - After "project is ready to go", add a note about doing an initial
   deployment
 - Output follow-up command to run when an update fails
 - Go back to showing the `npm install` output as `npm` doesn't always
   return an error code when it runs into problems
2019-01-23 08:57:48 -08:00
Matt Ellis 9384102a93 Add --json to pulumi history 2019-01-22 15:42:29 -08:00
Matt Ellis 24e6158378 Add --json to pulumi plugin ls 2019-01-22 15:42:29 -08:00
Matt Ellis 5cfd44c73a Add --json to pulumi config get and pulumi config
This supports using `--json` to get configuration information in a
structured way.

The objects we return have the following schema:

```
{
    name: string;
    value: string?;
    secret: bool;
}
```

In the case of `pulumi config` when --show-secrets is not passed, and
there are secret values, the `value` property of the object for that
configuration value will not be set. This differs from the normal
rendering where we show `[secret]`.

Contributes To #496
2019-01-22 10:39:37 -08:00
Matt Ellis 378bae27d8 Update CHANGELOG.md for 0.16.11 2019-01-16 16:54:30 -08:00
Matt Ellis 96b464a4b9 Update CHANGELOG.md
The previous commit added a note in the wrong section. Simply move the
note and add some context that these new features only work in nodejs.
2019-01-16 11:59:41 -08:00
CyrusNajmabadi bfcb07a164
Add functions to help make strings from values that may include Outputs (#2359) 2019-01-16 11:03:25 -08:00
Luke Hoban 5ec78df73d Update CHANGELOG for 0.16.10 release 2019-01-11 15:18:34 -08:00
Justin Van Patten 5d3d8c01dd
Add commands for managing stack tags (#2333)
Adds `pulumi stack tag` commands for managing stack tags.
2019-01-04 13:23:47 -08:00
CyrusNajmabadi 87e5a441f5
Convert resource to pojo objects when used as stack outputs. (#2311) 2019-01-03 10:03:11 -08:00
Justin Van Patten ea3b681a54
Link directly to /account/tokens (#2328)
We're changing /account to redirect to /account/profile instead of
/account/tokens as the user profile settings are a more natural place
to land when going into account settings.

This commit changes the CLI to link
directly to /account/tokens, avoiding having to click on
"Access Tokens" to go to the tokens page to get an access token when
coming from the URL outputted by the CLI.
2018-12-28 18:06:03 -05:00
Matt Ellis fc14d50359 Update CHANGELOG.md for 0.16.9 release 2018-12-24 20:41:44 -08:00
Matt Ellis 3ef40c6ba6 Update CHANGELOG.md
Add in some fixes and features that were missing from `CHANGELOG.md`
2018-12-24 09:56:31 -08:00
Matt Ellis b03c48e852 Merge v0.16.8 into master 2018-12-14 15:32:48 -08:00
Matt Ellis d2bd696d15 Fix synchronization with the event renderer (#2290)
The event rendering goroutine in the remote backend was not properly
synchronizing with the goroutine that created it, and could continue
executing after its creator finished. I believe that this is the root
cause of #1850.

(cherry picked from commit ded3882afd)
2018-12-14 14:19:01 -08:00
Pat Gavlin ded3882afd
Fix synchronization with the event renderer (#2290)
The event rendering goroutine in the remote backend was not properly
synchronizing with the goroutine that created it, and could continue
executing after its creator finished. I believe that this is the root
cause of #1850.
2018-12-13 19:58:26 -08:00
Matt Ellis 59a54f1802
Add --stack argument to a few missing commands (#2278)
As of this change, all of the stack specific commands for `pulumi` now
allow passing `--stack` to operate on a different stack from the
default one.

Fixes #1648
2018-12-10 10:10:43 -08:00
Matt Ellis ad78f3ef59 Improve error message when Pulumi.yaml can't be found
Fixes #2234
2018-12-06 14:04:01 -08:00
Matt Ellis 7b74f3b1be Update CHANGELOG.md for v0.16.7 2018-12-05 14:32:32 -08:00
Matt Ellis d7575072f2 Do not use relative path when launching dynamic provider
Previously, we assumed that the dynamic provider was located in
`./node_modules/@pulumi/pulumi/../` which is correct in the majority
of cases. However, tools like lerna or yarn workspaces (or custom
workflows) allow the node_modules folder to be located elsewhere on
disk, and node will still find it because of its algorithm for module
resolution.

So, do what we do in the language host itself, first launch node and
ask it to tell us where it resolves a require statement to on disk and
then launch node against that script.

Fixes #2261
2018-12-05 13:45:06 -08:00
Matt Ellis bb1fa36a47
Enable ANSI colorization in Windows terminal (#2269)
Before the windows console will understand ANSI colorization codes the
terminal must be put in a special mode by passing
ENABLE_VIRTUAL_TERMINAL_PROCESSING to SetConsoleMode. This was
happening as a side effect of term.StdStreams() from a docker package,
which we did before displaying the update data. However, any
colorization done before that call would just show the raw ANSI escape
codes.

Call this helper much earlier (i.e. as soon as the CLI starts up) so
any messages that we print will have the correct colorization applied
to them.

Fixes #2214
2018-12-04 16:58:32 -08:00
Matt Ellis f3fbc1d9ee Do not disable echo when stdin is not a terminal
When reading values like access keys or secrets from the terminal, we
would use the `terminal.ReadPassword` function to ensure characters
the user typed were not echo'd back to the console, as a convience.

When standard input was not connected to a tty (which would happen in
some cases like in docker when -t was not passed or in CI), this would
fail with an error about an bad ioctl. Update our logic such that
when standard in is not connected to a terminal, we just read input
normally.

While I was in the area, I unified the code for Windows and *NIX for
these functions.

Fixes #2017
2018-12-03 16:40:51 -08:00
Pat Gavlin 9c5526e7dd
Add a --config-file option for stack ops (#2258)
This option allows the user to override the file used to fetch and store
configuration information for a stack. It is available for the config,
destroy, logs, preview, refresh, and up commands.

Note that this option is not persistent: if it is not specified, the
stack's default configuration will be used. If an alternate config file
is used exclusively for a stack, it must be specified to all commands
that interact with that stack.

This option can be used to share plaintext configuration across multiple
stacks. It cannot be used to share secret configuration, as secrets are
associated with a particular stack and cannot be decryptex by other
stacks.
2018-11-30 15:11:05 -08:00
Pat Gavlin 3e913d2577
Update changelog (#2250)
Stamp in release info for 0.16.6.
2018-11-28 10:02:13 -08:00
Justin Van Patten 55534e9dad
Fix typo in CHANGELOG.md (#2249) 2018-11-28 08:27:28 -08:00
Matt Ellis 466f92dfb1 Minor wordsmithing in CHANGELOG.md 2018-11-26 13:34:24 -08:00
Matt Ellis 4865c1fc68 Update CHANGELOG.md
We are still building the muscle to do this per commit, so some things
had fallen through the cracks. I walked the output of `git log
v0.16.5...master` and added some small notes for improvements that we
had not documented.
2018-11-26 09:21:44 -08:00
Matt Ellis 72d52c6e1f Don't fail on configuration keys like a:config:b:c
Configuration keys are simple namespace/name pairs, delimited by
":". For compatability, we also allow
"<namespace>:config:<name>", but we always record the "nice" name in
`Pulumi.<stack-name>.yaml`.

While `pulumi config` and friends would block setting a key like
`a🅱️c` (where the "name" has a colon in it), it would allow
`a:config:b:c`. However, this would be recorded as `a🅱️c` in
`Pulumi.<stack-name>.yaml`, which meant we'd error when parsing the
configuration file later.

To work around this, disallow ":" in the "name" part of a
configuration key.  With this change the following all work:

```
keyName
my-project:keyName
my-project:config:keyName
```

However, both

`my-project:keyName:subKey`
`my-project:config:keyName:subKey`

are now disallowed.

I considered allowing colons in subkeys, but I think it adds more
confusion (due to the interaction with how we allow you elide the
project name in the default case) than is worthwhile at this point.

Fixes #2171
2018-11-20 14:14:37 -08:00
Matt Ellis c878916901 Look for language plugins next to pulumi when probing
When launching plugins today, `pulumi` looks in two places:

1. It looks to see if the plugin in on the $PATH and if so, uses
   it. This makes it easy to force a specific version of a resource
   provider to be used and is what happens at development time (since
   resource providers make their way onto $PATH via GOBIN).

2. If the above fails, it looks in the "plugin cache" in
   `~/.pulumi/plugins`. This is the location that `pulumi plugin
   install` places plugins.

Unlike resource provider plugins, we don't yet deliver language
plugins via `pulumi plugin install` so the language provider plugins
must be on the `$PATH` to be found. This is okay, because when we ship
the SDK, we include the executables next to `pulumi` itself.

However, if a user chooses to not put `pulumi` on their $PATH, or they
do but it is a symlink to the real `pulumi` binary installed
somewhere, we'd fail to find the language plugins, since they would
not be on the `$PATH`

To address this, when probing for language plugins, also consider
binaries next to the currently running `pulumi` process.

Fixes #1956
2018-11-20 12:02:36 -08:00
Matt Ellis 6e95bdda9c Merge branch 'release/0.16' into ellismg/merge-release 2018-11-16 20:22:13 -08:00
Matt Ellis faff805f1e Fix an issue where plugin install would fail on windows
The issue is related to this code:

https://github.com/pulumi/pulumi/blob/v0.16.4/pkg/workspace/plugins.go#L155-L195

Note that we use `defer` to ensure we close our handle to the file we
are unpacking when we encounter a file in the tarball.  However, the
defers don't run until the containing function ends, so when we go to
do the rename, or process still has a bunch of open file handles, which
prevents the directory from being renamed because it is "in use".

By doing all of the work in an anonymous function, we ensure that the
defer statements run before we go to rename the directory

Fixes #2217
2018-11-16 20:07:24 -08:00
Matt Ellis 76e20281f4 Fix a race when pulumi plugin install ran concurrently 2018-11-15 15:50:08 -08:00
Matt Ellis eca0ec4036 Add CHANGELOG.md 2018-11-13 09:43:20 -08:00
Luke Hoban 3b561392b1
Remove out-of-date files (#1401) 2018-06-05 08:39:19 -07:00
Matt Ellis cc04cd6581 Use per stack key for local stacks instead of per project
In the Pulumi Cloud, there is no guarantee that two stacks will share
the same encryption key. This means that encrypted config can not be
shared across stacks (in the Pulumi.yaml) file. To mimic this behavior
in the local experience, we now use a unique key per stack.

When upgrading an existing project, for any stack with existing
secrets, we copy the existing key into this stack. Future stacks will
get thier own encryption key. This strikes a balance between
expediency of implementation, the end user UX and not having to make a
breaking change.

As part of this change, I have introduced a CHANGELOG.md file in the
root of the repository and added a small note about the change to it.

Fixes #769
2018-01-19 00:50:59 -08:00