You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
powerplatform environment billing policy id and environment group id should accept empty guid as an empty values instead of "" (#604)
* Feat: Add Bing search configuration to environment schema and DTO
* Feat: Enhance environment API to support cross-region data movement and update schema
* Feat: Update environment API to support copilot policies and add new schema attributes for Bing search and cross-region data movement
* Feat: Add support for Bing Chat and update environment AI features in the API
* Feat: Update environment API to include copilot policies and enhance billing policy handling in tests
* Feat: Add tests for generative AI features in non-US and US regions in environment resource
* Feat: Refactor environment update logic to improve readability and maintainability
* Feat: Add allow_bing_search and allow_moving_data_across_regions attributes to powerplatform_environment
* Feat: Update documentation to include allow_bing_search and allow_moving_data_across_regions attributes for powerplatform_environment
* Fix formatting and update API request to include copilotPolicies in managed environment tests
* Validate location constraints for AI generative features in powerplatform_environment resource
* Add release cycle field to SourceModel and improve error messages for location validation
* Refactor AI generative features validation logic and improve error handling for location constraints
* enhance validation: add length requirement for environment group ID
* fixing environemnt_group_id
* refactor: update billing policy ID handling to use constants for empty values
* docs: update descriptions for billing_policy_id and environment_group_id to specify empty GUID usage
* fixing TestAccEnvironmentsResource_Create_Environment_And_Add_Env_Group
* fix TestAccTestEnvironmentSettingsResource_Validate_Read
* fix TestAccManagedEnvironmentsResource_Validate_No_Dataverse
* trigger acc tests
* run_tests pipeline: clean environment that starts with "Test" and not only with "TestAcc"
* fix: update retry duration and handle environment deletion errors
---------
Co-authored-by: github-actions[bot] <tfmod442916@users.noreply.github.com>
body: 'powerplatform_environment: attributes `environment_group_id` and `billing_policy_id` uses empty guid `00000000-0000-0000-0000-000000000000` as no value, instead of ""'
-`allow_bing_search` (Boolean) Allow Bing search in the environment
63
63
-`allow_moving_data_across_regions` (Boolean) Allow moving data across regions
64
64
-`azure_region` (String) Azure region of the environment (westeurope, eastus etc.). Can be queried using the `powerplatform_locations` data source. This property should only be set if absolutely necessary like when trying to create an environment in the same Azure region as Azure resources or Fabric capacity. Changing this property after environment creation will result in a destroy and recreation of the environment (you can use the [`prevent_destroy` lifecycle metatdata](https://developer.hashicorp.com/terraform/language/meta-arguments/lifecycle#prevent_destroy) as an added safeguard to prevent accidental deletion of environments).
65
-
-`billing_policy_id` (String) Billing policy id (guid) for pay-as-you-go environments using Azure subscription billing
65
+
-`billing_policy_id` (String) Billing policy id (guid) for pay-as-you-go environments using Azure subscription billing. To remove the environment from the billing policy, set this attribute to `00000000-0000-0000-0000-000000000000`
66
66
-`cadence` (String) Cadence of updates for the environment (Frequent, Moderate). For more information check [here](https://learn.microsoft.com/en-us/power-platform/admin/create-environment#setting-an-environment-refresh-cadence).
67
67
-`dataverse` (Attributes) Dataverse environment details (see [below for nested schema](#nestedatt--dataverse))
68
68
-`description` (String) Description of the environment
69
-
-`environment_group_id` (String) Environment group id (guid) that the environment belongs to. See [Environment groups](https://learn.microsoft.com/en-us/power-platform/admin/environment-groups) for more information.
69
+
-`environment_group_id` (String) Environment group id (guid) that the environment belongs to. See [Environment groups](https://learn.microsoft.com/en-us/power-platform/admin/environment-groups) for more information. To remove the environment from the environment group, set this attribute to `00000000-0000-0000-0000-000000000000`
70
70
-`owner_id` (String) Entra ID user id (guid) of the environment owner when creating developer environment
71
71
-`release_cycle` (String) Gives you the ability to create environments that are updated first. This allows you to experience and validate scenarios that are important to you before any updates reach your business-critical applications. See [more](https://learn.microsoft.com/en-us/power-platform/admin/early-release).
72
72
-`timeouts` (Attributes) (see [below for nested schema](#nestedatt--timeouts))
MarkdownDescription: "Environment group id (guid) that the environment belongs to. See [Environment groups](https://learn.microsoft.com/en-us/power-platform/admin/environment-groups) for more information.",
105
+
MarkdownDescription: "Environment group id (guid) that the environment belongs to. See [Environment groups](https://learn.microsoft.com/en-us/power-platform/admin/environment-groups) for more information. To remove the environment from the environment group, set this attribute to `00000000-0000-0000-0000-000000000000`",
106
106
Computed: true,
107
107
Optional: true,
108
108
PlanModifiers: []planmodifier.String{
109
109
stringplanmodifier.UseStateForUnknown(),
110
110
},
111
111
Validators: []validator.String{
112
-
stringvalidator.RegexMatches(regexp.MustCompile(helpers.GuidOrEmptyValueRegex), "environment_group_id must be a valid environment group id guid"),
112
+
stringvalidator.LengthAtLeast(1),
113
+
stringvalidator.RegexMatches(regexp.MustCompile(helpers.GuidRegex), "environment_group_id must be a valid environment group id guid"),
MarkdownDescription: "Billing policy id (guid) for pay-as-you-go environments using Azure subscription billing",
204
+
MarkdownDescription: "Billing policy id (guid) for pay-as-you-go environments using Azure subscription billing. To remove the environment from the billing policy, set this attribute to `00000000-0000-0000-0000-000000000000`",
204
205
Optional: true,
205
206
Computed: true,
206
207
PlanModifiers: []planmodifier.String{
207
208
stringplanmodifier.UseStateForUnknown(),
208
209
},
210
+
Validators: []validator.String{
211
+
stringvalidator.LengthAtLeast(1),
212
+
stringvalidator.RegexMatches(regexp.MustCompile(helpers.GuidRegex), "billing_policy_id must be a valid billing policy id guid"),
213
+
},
209
214
},
210
215
"enterprise_policies": schema.SetNestedAttribute{
211
216
MarkdownDescription: "Enterprise policies for the environment. See [Enterprise policies](https://learn.microsoft.com/en-us/power-platform/admin/enterprise-policies) for more details.",
MarkdownDescription: "Security group id (guid). For an empty security group, set this property to `0000000-0000-0000-0000-000000000000`",
286
291
Optional: true,
287
292
Validators: []validator.String{
293
+
stringvalidator.RegexMatches(regexp.MustCompile(helpers.GuidRegex), "security_group_id must be a valid security group guid id"),
288
294
validators.MakeFieldRequiredWhenOtherFieldDoesNotHaveValue(path.Root("environment_type").Expression(), regexp.MustCompile(EnvironmentTypesExceptDeveloperRegex), "dataverse.security_group_id is required for all environment_type values except `Developer`"),
0 commit comments