My CI/CD pipelines are failing please guide how to resolve this issue
The “count” value depends on resource attributes that cannot be determined until apply, so Terraform cannot predict how many instances will be created. To work around this, use the -target argument to first apply only the resources that the count depends on.
var.object_ids is coming from data.azuread_groups.example.object_ids Module
To get help, don’t shout or beg. Instead, make it easy for people to help you by including relevant information in your post.
This…
is not enough information for people to make any clear recommendation.
Something is clearly preventing data.azuread_groups.example.object_ids from being known until apply time, but unless you show more of your configuration, people on this forum cannot suggest why.
Putting aside all questions on how particular tones of voice and attitudes are represented in plain text messaging, and how different people may interpret them differently for a moment, one fact remains:
Given the limited information presented so far, all that can be said is that data.azuread_groups.example.object_ids is apparently not known until apply, and more visibility of how it is configured is needed, to identify the cause of that.
Nothing within the shown code explains why this could not be evaluated at plan time.
Therefore, I wonder if there are module-level depends_on settings in play here, which could lead to evaluation of this block being deferred to the apply phase.
I found the issue… The problem is with one other resource… I by mistake added depend in it which I was using in the module role_assignment_spn… That’s the reason it happened…
I have removed depends from it… and it started working fine…
@maxb so sorry for disturbing. Incorrect usage of depends was the culprit. My bad