Skip to content

Commit

Permalink
deprecation mark
Browse files Browse the repository at this point in the history
  • Loading branch information
dbanck committed Jan 23, 2025
1 parent f64dd2d commit e3feb25
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions internal/lang/marks/marks.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ func (m valueMark) GoString() string {
return "marks." + string(m)
}

type DeprecationMark struct {
AttrPath cty.Path
Message string
}

// Has returns true if and only if the cty.Value has the given mark.
func Has(val cty.Value, mark valueMark) bool {
return val.HasMark(mark)
Expand Down
6 changes: 6 additions & 0 deletions internal/terraform/evaluate.go
Original file line number Diff line number Diff line change
Expand Up @@ -958,6 +958,12 @@ func (d *evaluationStateData) GetOutput(addr addrs.OutputValue, rng tfdiags.Sour
if output.Sensitive {
val = val.Mark(marks.Sensitive)
}
if config.DeprecatedSet {
val = val.Mark(marks.DeprecationMark{
Message: config.Deprecated,
// AttrPath: ,
})
}

return val, diags
}
Expand Down

0 comments on commit e3feb25

Please sign in to comment.