Commit graph

314 commits

Author SHA1 Message Date
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
Lee Briggs 09c73c1c9b
add build tags to all integration tests (#5271)
* add build tags to all integration tests

* fix go sdk imports

* make transformation Dirs global
2020-09-02 09:11:15 -07:00
Evan Boyle 09964d2031
Merge branch 'master' into evan/auto 2020-08-28 19:11:14 -07:00
Justin Van Patten 493136d2f0
GHA: Use same commands the CLI does to create venv (#5206)
Use the same commands the CLI does to create venv for Python projects, and add a test.
2020-08-28 16:08:32 -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
evanboyle 463c7b6588 Merge branch 'master' of https://github.com/pulumi/pulumi into evan/auto 2020-08-24 17:51:40 -07:00
evanboyle 27db14791a auto error tests 2020-08-23 19:43:51 -07:00
Justin Van Patten cd9fae599d
Python SDK changes to support input/output classes (#5033)
Python SDK changes to support strongly-typed input/output "dataclasses".
2020-08-19 01:15:56 -07:00
Luke Hoban 2470d59efb
Revert "Added --suppress-permalink option (#5177)" (#5185)
This reverts commit f8d929d197.
2020-08-18 08:50:44 -07:00
Scott Murray f8d929d197
Added --suppress-permalink option (#5177) 2020-08-17 22:11:44 -07:00
Paul Stack 44a806180b
Bump version of go-cloud to v0.20.0 (#5156) 2020-08-11 17:48:56 +01:00
evanboyle 12d7216769 serve engine address via pulumi host command 2020-07-30 15:20:57 -07:00
Lee Briggs bad67d3242
switch os/user with luser
We make several calls to `os/user`, which uses CGO and means
cross-compilation is not possible. This replaces `os/user` with the
`luser` package, which is a drop-in replacement which does not use `CGO`
2020-07-27 14:44:08 -07:00
Paul Stack 6d09fe32df
Add the ability to copy configs between stacks (#4971) 2020-07-17 11:14:10 +01:00
Komal 8d1b39434c
Skip python tests during investigation (#4896) 2020-06-25 11:51:25 -07:00
Pat Gavlin 3d4c6523d2
[schema/docs] Use a Markdown parser. (#4838)
In particular, use the parser to filter and extract examples. This also
sets up support for entity references in documentation that can be used
in order to render language-specific names for resources, functions,
types, and properties.

Related to #4632 and #4159.
2020-06-17 14:02:45 -07:00
Evan Boyle fa69a31c97
Set default namespace for go config for config-less get/try/require (#4802) 2020-06-12 16:35:06 -07:00
Justin Van Patten 9b0169be35
Fix pylint(no-member) when accessing resource.id (#4813)
Pylint currently reports `E1101: Instance of 'Bucket' has no 'id' member (no-member)` on lines in Pulumi Python programs like:

```python
pulumi.export('bucket_name', bucket.id)
```

Here's a description of this message from http://pylint-messages.wikidot.com/messages:e1101:

> Used when an object (variable, function, …) is accessed for a non-existent member.
>
> False positives: This message may report object members that are created dynamically, but exist at the time they are accessed.

This appears to be a false positive case: `id` isn't set in the constructor (it's set later in `register_resource`) and Pylint isn't able to figure this out statically. `urn` has the same problem. (Oddly, Pylint doesn't complain when accessing other resource output properties).

This change refactors `register_resource` so that `id` and `urn` can be assigned in the resource's constructor, so that Pylint can see it being assigned. The change also does the same with `read_resource`.
2020-06-12 12:41:56 -07:00
Justin Van Patten 78270ae3fc
Fix panic on pulumi up prompt when filtering and hitting arrow key (#4808)
When running `pulumi up`, after the preview, we prompt asking whether to proceed with the update. If you type to filter the options and then hit an arrow key a couple times, the CLI panics. This is a bug in the `survey` library we depend on. The issue has been fixed in the library upstream; this change updates our dependency.
2020-06-11 12:34:15 -07:00
Justin Van Patten b77ec919d4
Install and use dependencies automatically for new Python projects (#4775)
Automatically create a virtual environment and install dependencies in it with `pulumi new` and `pulumi policy new` for Python templates.

This will save a new `virtualenv` runtime option in `Pulumi.yaml` (`PulumiPolicy.yaml` for policy packs):

```yaml
runtime:
  name: python
  options:
    virtualenv: venv
```

`virtualenv` is the path to a virtual environment that Pulumi will use when running `python` commands.

Existing projects are unaffected and can opt-in to using this by setting `virtualenv`, otherwise, they'll continue to work as-is.
2020-06-09 16:42:53 -07:00
Luke Hoban 678a5a6d3e
Export the CustomTimeouts class (#4747)
This class was available in the pulumi.resource module, but was not exported from the core `pulumi` module as intended for all public APIs at this level.
2020-06-03 15:36:44 -07:00
Paul Stack 45e1917a30
Upgrade to Go 1.14.x (#4697) 2020-05-28 12:01:33 +01:00
Justin Van Patten 6b0a845cc1
Support publishing Python policy packs (#4644)
Adds support for publishing Python policy packs to the service, and downloading/using such policy packs when applied to stacks in an organization.
2020-05-22 15:01:15 -07:00
Lee Briggs 362fc8d7f2
Merge branch 'master' into feature/go-cloud-azurekeyvault-regions 2020-05-19 08:07:09 -07:00
Pat Gavlin 088751a4a8
[codegen/hcl2] Refactor package schema loading. (#4661)
- Move the implementation of loadPackageSchema into a method on
  PackageCache
- Protect the cache with synchronization primitives to enable
  concurrency in downstream consumers
- Use jsoniter to deserialize schemas
2020-05-18 17:35:11 -07:00
Lee Briggs 72766fd4e6
Use latest upstream of gocloud.dev 2020-05-18 07:43:41 -07:00
Lee Briggs e045c2ac71
# This is a combination of 2 commits.
# This is the 1st commit message:

Use patched azure gocloud library

Fixes #4642

# The commit message #2 will be skipped:

# sync with pulumi-master branch
2020-05-18 07:43:20 -07:00
Lee Briggs cae7743863
Add integration tests for gcp and azure (#4525) 2020-05-14 18:19:10 +01:00
Chris Smith bc02ca6750
Skip cleanup step (#4590) 2020-05-11 14:15:53 -07:00
Paul Stack 48f906e026
Allow pulumi stack export to decrypt secrets (#4046) 2020-05-11 19:16:30 +01:00
Chris Smith 7ed4e42c38
Enable container runtime tests for cron jobs (#4509)
* Enable container runtime tests for cron jobs

* Use VERSION var from Makefile

Co-authored-by: Paul Stack <public@paulstack.co.uk>

Co-authored-by: Paul Stack <public@paulstack.co.uk>
2020-04-30 12:52:05 -07:00
Paul Stack f06e48b414
Enable fish completions for pulumi cli (#4401) 2020-04-30 15:45:57 +01:00
Pat Gavlin 2e9499a000
[codegen/hcl2] Fix the apply rewriter. (#4486)
Some of the apply rewriter's assumptions were broken by the richer
expressions available in HCL2. These changes fix those broken
assumptions, in particular the assumption that only scope traversal
expressions are sources of eventual values.
2020-04-24 22:04:24 -07:00
komal 94ac46c2ad Skip node test on windows 2020-04-24 13:40:09 -07:00
komal caf85f344e remove semicolon 2020-04-23 12:52:47 -07:00
komal 0139b8f512 fix c# test 2020-04-23 11:21:19 -07:00
komal 3766c4f05d fix imports 2020-04-23 11:21:19 -07:00
komal cacb2ab873 remove unneeded requirement 2020-04-23 11:21:19 -07:00
komal 4fd5c4b4d5 shorten unnecessary gitignore 2020-04-23 11:21:19 -07:00
komal 383ab9602d add large resource integration tests for each language 2020-04-23 11:21:19 -07:00
Paul Stack d1a37e2aca
Ensure yes is passed when creating a new template in a container (#4453)
* Ensure yes is passed when creating a new template in a container

I fixed this locally when creating the new docker containers so it's
time to push this back to master

* Update tests/containers/containers_test.go

Co-Authored-By: Justin Van Patten <jvp@justinvp.com>

Co-authored-by: Justin Van Patten <jvp@justinvp.com>
2020-04-20 23:43:42 +01:00
Justin Van Patten a5a6863f57
Update @pulumi/policy dependency (#4439)
The test that uses these are currently disabled -- but still wanted to make sure we didn't forget to update.
2020-04-18 13:07:19 -07:00
stack72 00acc7999a Update scripts/v2 and tests/v2 to use pkg/v2.0.0 & sdk/v2.0.0 release 2020-04-16 17:58:16 +01:00
Mikhail Shilkov 3e7b3667ee
Bump to .NET Core 3.1 (#4400)
Bump to .NET Core 3.1
2020-04-15 16:31:18 +02:00
Justin Van Patten 33119659e0
Treat config values that start with '0' as strings (#4393)
When setting structured config values using `--path`, we automatically
treat values that can be converted into an integer via `strconv.Atoi` as
an integer, rather than as a string.

However, this ends up converting values like "0123456" into the integer
123456, stripping the leading 0, which isn't desirable for values like
commit SHAs, etc., where you want to keep the 0 (and keep it a string).

This change makes it so that values starting with 0 are not implicitly
converted to an integer; instead such values will remain a string.
2020-04-14 12:40:22 -07:00
CyrusNajmabadi 66bd3f4aa8
Breaking changes due to Feature 2.0 work
* Make `async:true` the default for `invoke` calls (#3750)

* Switch away from native grpc impl. (#3728)

* Remove usage of the 'deasync' library from @pulumi/pulumi. (#3752)

* Only retry as long as we get unavailable back.  Anything else continues. (#3769)

* Handle all errors for now. (#3781)


* Do not assume --yes was present when using pulumi in non-interactive mode (#3793)

* Upgrade all paths for sdk and pkg to v2

* Backport C# invoke classes and other recent gen changes (#4288)

Adjust C# generation

* Replace IDeployment with a sealed class (#4318)

Replace IDeployment with a sealed class

* .NET: default to args subtype rather than Args.Empty (#4320)

* Adding system namespace for Dotnet code gen

This is required for using Obsolute attributes for deprecations

```
Iam/InstanceProfile.cs(142,10): error CS0246: The type or namespace name 'ObsoleteAttribute' could not be found (are you missing a using directive or an assembly reference?) [/Users/stack72/code/go/src/github.com/pulumi/pulumi-aws/sdk/dotnet/Pulumi.Aws.csproj]
Iam/InstanceProfile.cs(142,10): error CS0246: The type or namespace name 'Obsolete' could not be found (are you missing a using directive or an assembly reference?) [/Users/stack72/code/go/src/github.com/pulumi/pulumi-aws/sdk/dotnet/Pulumi.Aws.csproj]
```

* Fix the nullability of config type properties in C# codegen (#4379)
2020-04-14 09:30:25 +01:00
Justin Van Patten 938e25164c
Update @pulumi/policy dependency (#4362) 2020-04-10 11:25:58 -07:00
Justin Van Patten 89ce65fcd8
Skip policy tests that cause concurrent Travis jobs to fail (#4278) 2020-04-02 15:45:00 -07:00
Justin Van Patten efa5237598
Fix policy integration test dependencies (#4228)
And remove some other unnecessary cruft while cleaning things up here.
2020-03-29 17:55:08 -07:00
Sean Holung fa3d50faa2
Remove pulumi/aws dependency from policy int tests (#4206) 2020-03-27 14:55:58 -07:00