Skip to content

Feature request: Validate policy assignment name length #171

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

Open
JWilkinsonMB opened this issue Jul 29, 2024 · 1 comment · May be fixed by #207
Open

Feature request: Validate policy assignment name length #171

JWilkinsonMB opened this issue Jul 29, 2024 · 1 comment · May be fixed by #207
Assignees

Comments

@JWilkinsonMB
Copy link

When creating a custom policy assignment, the name must be no more than 24 characters long.
It could be helpful if this can be validated within the provider so that the error can be picked up during plan rather than at apply.

│ Error: Failed to create/update resource
│ 
│   with module.alz.module.alz_global.module.policy_assignment["global/Audit-OpenAI-ContentLogging"].azapi_resource.this,
│   on .terraform/modules/alz.alz_global/modules/azapi_helper/main.tf line 1, in resource "azapi_resource" "this":
│    1: resource "azapi_resource" "this" {
│ 
│ creating/updating Resource: (ResourceId
│ "/providers/Microsoft.Management/managementGroups/global/providers/Microsoft.Authorization/policyAssignments/Audit-OpenAI-ContentLogging-MB"
│ / Api Version "2024-04-01"): PUT
│ https://management.azure.com/providers/Microsoft.Management/managementGroups/global/providers/Microsoft.Authorization/policyAssignments/Audit-OpenAI-ContentLogging
│ --------------------------------------------------------------------------------
│ RESPONSE 400: 400 Bad Request
│ ERROR CODE: InvalidPolicyAssignmentName
│ --------------------------------------------------------------------------------
│ {
│   "error": {
│     "code": "InvalidPolicyAssignmentName",
│     "message": "The policy assignment name 'Audit-OpenAI-ContentLogging' is invalid. The policy assignment name length must not exceed '24' characters."
│   }
│ }
│ --------------------------------------------------------------------------------
│ 
@matt-FFFFFF matt-FFFFFF added the enhancement New feature or request label Aug 5, 2024
@matt-FFFFFF matt-FFFFFF transferred this issue from Azure/terraform-provider-alz Sep 29, 2024
@matt-FFFFFF
Copy link
Member

If we choose to do this it would be here in alzlib - transferring

@matt-FFFFFF matt-FFFFFF removed the enhancement New feature or request label Nov 13, 2024
@matt-FFFFFF matt-FFFFFF self-assigned this May 14, 2025
@matt-FFFFFF matt-FFFFFF linked a pull request May 14, 2025 that will close this issue
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 a pull request may close this issue.

2 participants