Skip to content

Commit

Permalink
Deprecate fn::stackReference (#420)
Browse files Browse the repository at this point in the history
  • Loading branch information
aq17 committed Dec 7, 2022
1 parent d3bedd9 commit 0af2103
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG_PENDING.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
### Improvements

- Deprecate `fn::stackReference`.
[#420](https://github.com/pulumi/pulumi-yaml/pull/420)

### Bug Fixes
3 changes: 3 additions & 0 deletions pkg/pulumiyaml/ast/expr.go
Original file line number Diff line number Diff line change
Expand Up @@ -774,6 +774,9 @@ func tryParseFunction(node *syntax.ObjectNode) (Expr, syntax.Diagnostics, bool)
set("fn::split", parseSplit)
case "fn::stackreference":
set("fn::stackReference", parseStackReference)
diags = append(diags, syntax.Warning(kvp.Key.Syntax().Range(),
`'fn::stackReference' is deprecated; please use 'pulumi:pulumi:StackReference' instead`,
`see "https://www.pulumi.com/docs/intro/concepts/stack/#stackreferences for more info.`))
case "fn::assetarchive":
set("fn::assetArchive", parseAssetArchive)
case "fn::secret":
Expand Down
4 changes: 4 additions & 0 deletions pkg/pulumiyaml/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -1376,6 +1376,10 @@ func (e *programEvaluator) evaluateExpr(x ast.Expr) (interface{}, bool) {
case *ast.AssetArchiveExpr:
return e.evaluateBuiltinAssetArchive(x)
case *ast.StackReferenceExpr:
e.addWarnDiag(x.Syntax().Syntax().Range(),
"'fn::stackReference' is deprecated",
"Please use `pulumi:pulumi:StackReference`; see"+
"https://www.pulumi.com/docs/intro/concepts/stack/#stackreferences")
return e.evaluateBuiltinStackReference(x)
case *ast.SecretExpr:
return e.evaluateBuiltinSecret(x)
Expand Down

0 comments on commit 0af2103

Please sign in to comment.