Advertisement
Guest User

Untitled

a guest
Jul 18th, 2019
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. resource "azurerm_user_assigned_identity" "w2-validator" {
  2. resource_group_name = "${data.azurerm_resource_group.wherefor-vpc.name}"
  3. location = "${data.azurerm_resource_group.wherefor-vpc.location}"
  4.  
  5. name = "w2-validator"
  6. }
  7.  
  8. resource "azurerm_role_definition" "read-validator" {
  9. name = "read-validator"
  10. scope = "${data.azurerm_subscription.primary.id}"
  11. description = "This is a custom role created via Terraform"
  12.  
  13. permissions {
  14. data_actions = [
  15. "Microsoft.Storage/storageAccounts/blobServices/containers/blobs/read"
  16. ]
  17. actions = [
  18. "Microsoft.Storage/storageAccounts/blobServices/containers/read",
  19. "Microsoft.Storage/storageAccounts/read",
  20. "Microsoft.Storage/storageAccounts/listKeys/action"
  21. ]
  22. not_actions = []
  23. }
  24.  
  25. assignable_scopes = [
  26. "${azurerm_storage_account.w2-validator.id}"
  27. ]
  28. }
  29.  
  30. resource "azurerm_role_assignment" "w2-validator" {
  31. scope = "${azurerm_storage_account.w2-validator.id}"
  32. role_definition_id = "${azurerm_role_definition.read-validator.id}"
  33. principal_id = "${azurerm_user_assigned_identity.w2-validator.principal_id}"
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement