Repository navigation
Commit 63ec6f4
onboarding: Terraform creates the Snowflake service user, agent and connection in one apply (YET-3320) (#155)
## Summary
[YET-3320](https://linear.app/montecarloai/issue/YET-3320). On request,
the onboarding skill now creates the Snowflake side in the same
Terraform configuration as the AWS agent and the connection. That covers
the `MONTE_CARLO` service user, `MONTE_CARLO_ROLE`, `MONTE_CARLO_WH` and
the grants from [the Snowflake
docs](https://docs.getmontecarlo.com/docs/snowflake). Until now the
skill handed this setup to the customer.
- **Key handling:** the customer generates the key pair with `openssl`,
and Terraform reads both files by path. The private key reaches the
agent's secret only through `secret_string_wo`. `tls_private_key` is
explicitly ruled out, because it would keep the key in state.
- **One apply:** Snowflake, the agent, the secret, the credential,
warehouse and connection are created together. The connection waits for
every grant (`terraform_data.snowflake_grants_ready`) and is validated
right after the apply.
- **Key safety:** preconditions stop an encrypted or PKCS#1 private key,
or a non-PEM public key, at plan. The secret's version is derived from
the public key, so a rotation always re-sends the private key.
- **Names:** user, role and warehouse names are variables, with the
docs' names proposed.
- **Grants:** `IMPORTED PRIVILEGES` on `SNOWFLAKE`, plus grants on
existing and future schemas and objects for each database the customer
names. The skill asks the customer to run the docs' check for existing
schema-level future grants.
- **Names:** the skill proposes the docs' object names for the customer
to confirm.
- **Eval:** new case `terraform-snowflake-service-user-end-to-end`.
- **Release:** 1.29.0.
## Verification
- `terraform fmt` and `terraform validate` pass on the HCL extracted
from `output-modes.md` and assembled with the AWS agent section.
Snowflake provider v2.22; every resource used is stable, no preview
features.
- The PEM-body stripping gives identical output for LF and CRLF key
files.
- Clean-room scenario S15 ran headless on dev with Opus 5.5 against a
Snowflake trial account:
- **Run 1:** the single-apply version. 45 resources,
`validate_connection` 15/15. It showed that the connection was created
before any validation, which led to the two-apply change.
- **Run 2:** a two-apply variant with the credential check first. It
passed, but the product decision is a single apply, which run 1 already
proves.
- **Run 3:** this branch (1.29.0, single apply with the review fixes). A
plan pointed at an encrypted key stopped at the new precondition. One
apply created 46 resources, `validate_connection` passed 15/15, no key
in state, and destroy removed all 46.
- Apply 1 created 42 resources and no Monte Carlo credential, warehouse
or connection.
- The credential check passed 15/15.
- Apply 2 added exactly 3 resources.
- `validate_connection` passed 15/15.
- No private key in the plan or state, and no tool call read a key file.
- `MONTE_CARLO_ROLE`'s grants match the docs.
- Everything was destroyed afterwards.
- The `validate.yml` steps pass locally, except
`skill-symlinks-in-sync`, which needs GNU `find`. This change adds no
skill.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent 9442841 commit 63ec6f4
16 files changed
Lines changed: 381 additions & 7 deletions
File tree
- plugins
- claude-code
- .claude-plugin
- evals/onboarding
- codex
- .codex-plugin
- copilot
- cortex-code
- .cortex-plugin
- cursor
- .cursor-plugin
- opencode
- skills/onboarding
- reference
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
8 | 16 | | |
9 | 17 | | |
10 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
228 | 250 | | |
229 | 251 | | |
230 | 252 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
8 | 16 | | |
9 | 17 | | |
10 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
8 | 16 | | |
9 | 17 | | |
10 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
8 | 16 | | |
9 | 17 | | |
10 | 18 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| |||
0 commit comments