Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support davinci flow include variable values false #343

Closed
samir-gandhi opened this issue Aug 14, 2024 · 0 comments · Fixed by #344
Closed

support davinci flow include variable values false #343

samir-gandhi opened this issue Aug 14, 2024 · 0 comments · Fixed by #344
Assignees
Labels
status/triaged The issue/PR has completed initial triage and needs assignment type/bug Something isn't working
Milestone

Comments

@samir-gandhi
Copy link
Contributor

samir-gandhi commented Aug 14, 2024

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

DaVinci Terraform provider Version

0.3.3

Terraform Version

terraform 1.6+

Affected Resource(s)

  • davinci_flow

Terraform Configuration Files

Flows now can have a variables array with or without variable values included.

example with value:

  "variables": [
    {
      "context": "company",
      "createdDate": 1723571420121,
      "customerId": "bb5fef4347dc9293873ae12ee9e73f1c",
      "fields": {
        "type": "string",
        "displayName": "company var for acceptance test",
        "value": "some-value",
        "mutable": true,
        "min": 0,
        "max": 2000
      },
      "id": "9c4def0d-eaea-435b-b0e5-61b6ba09bf2b",
      "type": "property",
      "updatedDate": 1723571713201,
      "visibility": "private",
      "name": "exampleCompanyVar##SK##company",
      "companyId": "094103c4-b880-4e74-83dd-713e7f380146"
    }
  ]

example without value:

  "variables": [
    {
      "context": "company",
      "createdDate": 1723571420121,
      "customerId": "bb5fef4347dc9293873ae12ee9e73f1c"
      ,
      "fields": {
        "type": "string",
        "displayName": "company var for acceptance test",
        "mutable": true,
        "min": 0,
        "max": 2000
      },
      "id": "9c4def0d-eaea-435b-b0e5-61b6ba09bf2b",
      "type": "property",
      "visibility": "private",
      "name": "exampleCompanyVar##SK##company",
      "companyId": "094103c4-b880-4e74-83dd-713e7f380146"
    }
  ]

Debug Output

davinci_flow.redacted_company_var_minimal: Modifying... [id=ba22d969dbebaa5d423a2157dca5650a]
╷
│ Warning: DaVinci Export JSON contains unknown properties
│ 
│   with davinci_flow.redacted_company_var_minimal,
│   on dv.tf line 94, in resource "davinci_flow" "redacted_company_var_minimal":
│   94:   flow_json = file("./davinci_flows/redactedcompanyvar.json")
│ 
│ The DaVinci Flow Export contains properties that cannot be validated.  These parameters will be preserved on import to the DaVinci service, but there may
│ be unpredictable results in difference calculation.
│ 
│ 
│ (and 2 more similar warnings elsewhere)
╵
╷
│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to davinci_flow.redacted_company_var_minimal, provider "provider[\"registry.terraform.io/pingidentity/davinci\"]" produced an
│ unexpected new value: .flow_export_json: inconsistent values for sensitive attribute.
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.
╵
╷
│ Error: Provider produced inconsistent result after apply
│ 
│ When applying changes to davinci_flow.redacted_company_var_minimal, provider "provider[\"registry.terraform.io/pingidentity/davinci\"]" produced an
│ unexpected new value: .flow_variables: planned set element cty.ObjectVal(map[string]cty.Value{"context":cty.StringVal("company"),
│ "description":cty.NullVal(cty.String), "flow_id":cty.NullVal(cty.String), "id":cty.StringVal("exampleCompanyVar##SK##company"),
│ "max":cty.NumberIntVal(2000), "min":cty.NumberIntVal(0), "mutable":cty.True, "name":cty.StringVal("exampleCompanyVar"), "type":cty.StringVal("string"),
│ "value":cty.NullVal(cty.String)}) does not correlate with any element in actual.
│ 
│ This is a bug in the provider, which should be reported in the provider's own issue tracker.

Panic Output

Expected Behavior

stored flow state should match what was included during import

Actual Behavior

Flows that are exported without including variable values end up storing state with values and cause a mismatch.
func (r *FlowResource) Read... does not include the new includeVariableValues query parameter and thus uses the default which does include variable values.

Steps to Reproduce

  1. kick off an initial terraform config with a pingone environment, davinci and a flow that uses company variable
  2. export the flow with include variable values off
  3. apply should show an update is needed. this update should fail with above error

Important Factoids

The main issue is the difference in stored state, however it looks like there is also an additional field updatedDate that was added and is the reason for the Warning: DaVinci Export JSON contains unknown properties

References

@samir-gandhi samir-gandhi added type/bug Something isn't working status/needs-triage The issue/PR needs initial triage status/triaged The issue/PR has completed initial triage and needs assignment status/up-for-grabs The issue/PR is not blocked and can be picked up by a member of the community, or a maintainer and removed status/needs-triage The issue/PR needs initial triage labels Aug 14, 2024
@samir-gandhi samir-gandhi linked a pull request Aug 14, 2024 that will close this issue
@patrickcping patrickcping removed the status/up-for-grabs The issue/PR is not blocked and can be picked up by a member of the community, or a maintainer label Aug 14, 2024
@patrickcping patrickcping added this to the v0.4.0 milestone Aug 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status/triaged The issue/PR has completed initial triage and needs assignment type/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants