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

Image ID Regex - Include "null" to allow missing or computed values #5

Open
bdavisOSSG opened this issue Jun 14, 2022 · 1 comment
Open

Comments

@bdavisOSSG
Copy link

Hi,

This does not seem to work .. for a nul value

https://github.com/hashicorp/terraform-sentinel-policies/tree/main/azure/restrict-vm-image-id.sentinel

this is the image details form the workspace state

image

and it fails the check on

image

`Print messages:

azurerm_windows_virtual_machine.ansible_wintst has source_image_id with value that does not match the regex ^(/subscription`

@bdavisOSSG
Copy link
Author

HI,

the word "nul" does not work,

but

image_id_regex = "^(/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/(.*)/providers/Microsoft.Compute/images/(.*)|)$"

Does .. effectively making the regex ^$ which is nothing ..

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

No branches or pull requests

1 participant