# Can you access node attributes from within a Chef custom resource definition?

**URL:** https://discourse.chef.io/t/can-you-access-node-attributes-from-within-a-chef-custom-resource-definition/10247
**Category:** Chef Infra (archive)
**Created:** [January 18, 2017, 6:01pm UTC](https://discourse.chef.io/t/can-you-access-node-attributes-from-within-a-chef-custom-resource-definition/10247 "2017-01-18T18:01:25Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![coderanger](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.chef.io/coderanger/32/5_2.png) [@coderanger](https://discourse.chef.io/u/coderanger)
#### Post date: [January 19, 2017, 5:12pm UTC](https://discourse.chef.io/t/can-you-access-node-attributes-from-within-a-chef-custom-resource-definition/10247/4 "2017-01-19T17:12:42Z")

</div>

You can do it, it just isn’t recommended. It mostly comes up for using the value of an attribute as the default value for a property, which isn’t the worst thing in the world sometimes. For that just use a lazy definition: `property(:foo, default: lazy { node["whatever"] })`

Original Quoted context has been removed as per policy

---

_[View the full topic](https://discourse.chef.io/t/can-you-access-node-attributes-from-within-a-chef-custom-resource-definition/10247)._
