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

Fix CrowdStrike posture rules not saving last_seen to tf state #4855

Conversation

TylerStanish
Copy link
Contributor

@TylerStanish TylerStanish commented Jan 9, 2025

The cloudflare_zero_trust_device_posture_rule code creates the resource using the correct values, but does not populate the values correctly when subsequently reading the resource back from the API after creation. Therefore, the last_seen value stored to the state file is not populated. Subsequently, plan/apply operations will show last_seen in the diff.

resource "cloudflare_zero_trust_device_posture_rule" "my_crowdstrike_rule" {  
  account_id  = var.account_id
  description = "Requires the device to be seen at most 1 day ago"
  name        = "Check for last seen"
  schedule    = "5m"
  type        = "crowdstrike_s2s"
  input {
    connection_id = "$SOME_UUID"
    operator      = "<"
    last_seen     = "24h"
  }
}

Additionally, some of the fields specified in the function convertInputToSchema don't have a consistent ordering with the same fields specified in setDevicePostureRuleInput. I add a separate commit for this.

Copy link
Contributor

github-actions bot commented Jan 9, 2025

changelog detected ✅

@TylerStanish TylerStanish force-pushed the tstanish/crowdstrike_last_seen_bugfix branch from 13a7297 to 08502a2 Compare January 9, 2025 00:52
@jacobbednarz jacobbednarz merged commit 7f7ed5e into cloudflare:master Jan 9, 2025
7 checks passed
@github-actions github-actions bot added this to the v4.51.0 milestone Jan 9, 2025
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.

2 participants