When trying to create a "hello world" Cloud Function, I get the error message:
"The request has violated one or more Org Policies. Please refer to the respective violations for more information."
Now, which org policies have been violated? In the Log Explorer I find the error message like this:
{
insertId: "XXX"
logName: "projects/XXX/logs/cloudaudit.googleapis.com%2Factivity"
protoPayload: {10}
receiveTimestamp: "2021-11-26T11:42:16.735011108Z"
resource: {2}
severity: "ERROR"
timestamp: "2021-11-26T11:42:16.490247Z"
}
I found the solution to my own issue: After clicking "Create Function", I had to choose "Run time, build, connections and security settings" -> "Connections" and select an option.
No option had been selected there, I guess this was due to my project's network settings.
Now I can deploy :)
Logging will have the detail error.details[x].violations[x].type. The log entry states the constraint in violation.
The following log entry shows a violation for location:
Example log entry:
Org Policy Constraints