# Attribute RequiresReplace ... Maybe. Depending on API version

**URL:** <https://discuss.hashicorp.com/t/attribute-requiresreplace-maybe-depending-on-api-version/75341>\
**Category:** Plugin Development\
**Created:** [June 6, 2025, 11:50am UTC](https://discuss.hashicorp.com/t/attribute-requiresreplace-maybe-depending-on-api-version/75341 "2025-06-06T11:50:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![hQnVyLRx](https://avatars.discourse-cdn.com/v4/letter/h/ad7895/32.png) [@hQnVyLRx](https://discuss.hashicorp.com/u/hQnVyLRx)\
**Post date:** [June 6, 2025, 11:50am UTC](https://discuss.hashicorp.com/t/attribute-requiresreplace-maybe-depending-on-api-version/75341/1 "2025-06-06T11:50:05Z")

</div>

One of my resources has an attribute which can only be modified with some API versions: Early API releases treat it as immutable, but that constraint has been relaxed in later API releases.

The resource schema currently has this attribute marked with the `RequiresReplace()` attribute plan modifier, but I’d like to relax that constraint to match the API behavior.

I think I’d need to use a resource (rather than attribute) plan modifier because only the resource struct has access to the API version, but that’s only true after the provider’s `Configure()` has been invoked.

_edit:_ I guess the important distinction in the paragraph above really comes down to specifying the plan modification behavior in `ModifyPlan()` rather than in `Schema()`. It’s not about the distinction between resource and attribute plan modification. Both functions (`ModifyPlan()` and `Schema()`) have the resource struct pointer as the function receiver but between the two, only `ModifyPlan()` is guaranteed to run after `Configure()` according @jbardin’s comment below.

Can I rely on the provider’s `Configure()` being called before the resource’s `ModifyPlan()`? This _feels like_ it should be safe… After all, how can we have a plan if we’ve not checked in with the API?

---

<div class="post-metadata">

**Author:** ![jbardin](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jbardin/32/3325_2.png) [@jbardin](https://discuss.hashicorp.com/u/jbardin)\
**Post date:** [June 6, 2025, 12:53pm UTC](https://discuss.hashicorp.com/t/attribute-requiresreplace-maybe-depending-on-api-version/75341/2 "2025-06-06T12:53:48Z")

</div>

Yes, a provider will always be configured before Terraform starts planning changes. It’s assumed that any planning process may require API access by the provider.

---

<div class="post-metadata">

**Author:** ![hQnVyLRx](https://avatars.discourse-cdn.com/v4/letter/h/ad7895/32.png) [@hQnVyLRx](https://discuss.hashicorp.com/u/hQnVyLRx)\
**Post date:** [June 6, 2025, 1:06pm UTC](https://discuss.hashicorp.com/t/attribute-requiresreplace-maybe-depending-on-api-version/75341/3 "2025-06-06T13:06:19Z")

</div>

Excellent.

Thank you @jbardin.
