Skip to content

Conversation

@norrietaylor
Copy link
Member

The Read() function in ec_security_project was not populating the
admin_features_package and product_types fields from the API response,
causing them to remain in an 'unknown' state after resource creation.
This resulted in Terraform errors: 'Provider returned invalid result
object after apply'.

This fix adds the missing field population logic in the Read() function:

  • admin_features_package uses NewStringPointerValue() pattern (matching observability_project pattern for optional pointer fields)
  • product_types is converted from API response format to Terraform list

Updated tests to verify the fields are correctly populated.

Fixes #938

Assisted by Cursor AI.

…_project Read()

   The Read() function in ec_security_project was not populating the
   admin_features_package and product_types fields from the API response,
   causing them to remain in an 'unknown' state after resource creation.
   This resulted in Terraform errors: 'Provider returned invalid result
   object after apply'.

   This fix adds the missing field population logic in the Read() function:
   - admin_features_package uses NewStringPointerValue() pattern (matching
     observability_project pattern for optional pointer fields)
   - product_types is converted from API response format to Terraform list

   Updated tests to verify the fields are correctly populated.

   Fixes elastic#938

   Assisted by Cursor AI.
@norrietaylor norrietaylor requested a review from a team as a code owner November 6, 2025 05:55
@norrietaylor norrietaylor force-pushed the fix/security-project-read-unknown-fields branch 2 times, most recently from 37300d1 to 9644ee7 Compare November 7, 2025 07:15
@norrietaylor norrietaylor force-pushed the fix/security-project-read-unknown-fields branch from 9644ee7 to a957266 Compare November 7, 2025 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] ec_security_project - provider returns an error indicating that admin_features_package and product_types are unknown values

1 participant