pulumi/pkg
bors[bot] bd87211ec6
Merge #11165
11165: [cli] Experimental support for remote operations r=justinvp a=justinvp

This change adds experimental CLI support for remote operations. For the new CLI flags to show up `PULUMI_EXPERIMENTAL` envvar must best to a truthy value. Automation API (separate PRs for each language forthcoming), leverage these commands and flags under the covers.

Here's an example:

```
PULUMI_EXPERIMENTAL=true pulumi up --remote https://github.com/pulumi/examples.git \
    --stack="justinvp/aws-ts-s3-folder/dev" \
    --remote-git-branch="refs/heads/master" \
    --remote-git-repo-dir="aws-ts-s3-folder" \
    --remote-env="AWS_REGION=us-west-2" \
    --remote-env="AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID" \
    --remote-env-secret="AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY" \
    --remote-env-secret="AWS_SESSION_TOKEN=$AWS_SESSION_TOKEN"
```

And similar for `preview`, `refresh`, and `destroy` commands.

Note: While this will initially be behind `PULUMI_EXPERIMENTAL`, I expect we will make these flags available by default for regular CLI use at some point.

In addition to the code review, I'm looking for feedback on the following:

1. This leverages `pulumi up`'s existing `pulumi up [url]` URL argument (and adds a similar URL argument to the other commands). When `--remote` is specified, the URL arg means the git repo URL to pass to the deployment API. I was debating whether `--remote-git-branch` and `--remote-git-commit` (one of those must be set; mutually exclusive) should be a second arg like `pulumi up [url] [ref]`, and additionally if `--remote-git-repo-dir` should be a third arg like `pulumi up [url] [ref] [dir]`. I decided to go with flags because it's possible we'll make branch/commit optional in the future, which would make it awkward if you have to pass a repo-dir as a third arg (requiring specifying a branch/commit second arg). Also, having branch/commit as a single arg would mean we'd have to try to determine whether it looks like a commit hash vs. a branch. Open to feedback here.

2. ~~The deployment API supports secrets for envvar values. I may have gone too cute with how these are specified via the CLI. Regular values are specified with `NAME=value` (`=` separator). Secret values are specified like `NAME#=secretvalue` (`#=` separator). Alternatively, I could have separate flags like `--remote-env` and `--remote-env-secret` which is probably more straightforward. Feedback appreciated.~~

    **Update:** Added a separate `--remote-env-secret` flag for envvar secrets.

Note: I do plan to include some sanity tests, but need to make sure whatever account we use when `PULUMI_ACCESS_TOKEN` is set has the feature enabled in the service. Will do that as a follow-up.

Co-authored-by: Justin Van Patten <jvp@justinvp.com>
2022-10-28 01:05:54 +00:00
..
authhelpers Add support for authentication via GOOGLE_CREDENTIALS (#6379) 2022-06-07 16:02:08 +01:00
backend [cli] Experimental support for remote operations 2022-10-27 16:15:59 -07:00
cmd/pulumi Merge #11165 2022-10-28 01:05:54 +00:00
codegen Merge #11137 2022-10-25 01:06:14 +00:00
engine test # This is a combination of 3 commits. 2022-10-25 16:54:58 -07:00
graph Update error handling (#8406) 2021-11-12 18:37:17 -08:00
operations ci: gofmt 1.18+ clean 2022-09-21 09:48:39 -07:00
resource Add `pulumi state delete --target-dependents` 2022-10-27 11:23:56 -07:00
secrets Merge #11094 2022-10-24 11:33:21 +00:00
testing/integration Merge #10832 2022-10-18 16:42:18 +00:00
util [cli] Enable single-file Pulumi YAML templates (#10437) 2022-08-18 23:13:56 +01:00
version duplicate version to ensure linking is properly handled 2020-03-19 12:49:34 -07:00
README.md export codegen tests for internal use (#8928) 2022-02-07 12:10:04 +01:00
go.mod Update dependencies 2022-10-26 14:31:50 +00:00
go.sum Upgrade yaml to v0.5.10 2022-10-13 14:39:25 -07:00

README.md

pulumi/pkg

While pulumi/sdk maintains strict backwards compatibility guarantees, code under pkg/ is handled more informally: while breaking changes are still discouraged they may happen when they make sense.