# Have a LWRP property refer to another property in the definition?

**URL:** https://discourse.chef.io/t/have-a-lwrp-property-refer-to-another-property-in-the-definition/9746
**Category:** Chef Infra (archive)
**Created:** [October 21, 2016, 3:57pm UTC](https://discourse.chef.io/t/have-a-lwrp-property-refer-to-another-property-in-the-definition/9746 "2016-10-21T15:57:51Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![red888](https://avatars.discourse-cdn.com/v4/letter/r/ecae2f/32.png) [@red888](https://discourse.chef.io/u/red888)
#### Post date: [October 21, 2016, 3:57pm UTC](https://discourse.chef.io/t/have-a-lwrp-property-refer-to-another-property-in-the-definition/9746/1 "2016-10-21T15:57:51Z")

</div>

Can I do something like this in the resource file of my LWRP:

attribute :default\_prop, kind\_of: String  
attribute :opional\_prop,  
kind\_of: String,  
default: default\_prop

The idea is I want the property to default to the vaule of another property if it isn’t explicity passed to the resource.

Do I have to handle this programatically in the provider file?
