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

Allow filtering of data.powerplatform_environments data source #479

Open
mattdot opened this issue Oct 2, 2024 · 2 comments
Open

Allow filtering of data.powerplatform_environments data source #479

mattdot opened this issue Oct 2, 2024 · 2 comments
Assignees
Labels
blocked enhancement New feature or request
Milestone

Comments

@mattdot
Copy link
Member

mattdot commented Oct 2, 2024

Enhance the powerplatform_environments data source to accept a filter to return a more targeted list of environments

data "powerplatform_environments" "get_by_id" {
  filter = "name eq <guid>"
}

data "powerplatform_environments" "get_default" {
  filter = "properties.isDefault eq true"
}

data "powerplatform_environments" "get_coe_envs" {
  filter = "contains(properties.displayName,  'CoE')"
}
@mattdot mattdot added the enhancement New feature or request label Oct 2, 2024
@mattdot mattdot added this to the P0 milestone Oct 2, 2024
@webstean
Copy link
Contributor

webstean commented Oct 2, 2024

This would be great!!! And terribly useful.

@mattdot mattdot self-assigned this Oct 3, 2024
@mattdot
Copy link
Member Author

mattdot commented Oct 3, 2024

After looking at the limitations of the API I'm considering an alternative syntax

data "powerplatform_environments" "get_by_id" {
  filter = {
    environment_id = "<guid>"
  }
}

data "powerplatform_environments" "get_default" {
  filter = {
     sku = "Default" # Default | Production | Sandbox | Developer
  }
}

data "powerplatform_environments" "get_unprotected" {
  filter = {
     security_group_id = "00000000-0000-0000-0000-000000000000"
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants