Skip to content

Commit

Permalink
remove legacy unused functions
Browse files Browse the repository at this point in the history
  • Loading branch information
wuxu92 committed Oct 31, 2024
1 parent dca9ca9 commit e0965ae
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 101 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,44 +107,3 @@ resource "azurerm_key_vault_managed_hardware_security_module_role_assignment" "t
}
`, KeyVaultMHSMRoleDefinitionResource{}.basic(data))
}

func (r KeyVaultManagedHSMRoleAssignmentResource) legacyBuiltInRole(data acceptance.TestData) string {
return fmt.Sprintf(`
%s
locals {
assignmentOfficerName = "706c03c7-69ad-33e5-2796-b3380d3a6e1a"
}
data "azurerm_key_vault_managed_hardware_security_module_role_definition" "officer" {
vault_base_url = azurerm_key_vault_managed_hardware_security_module.test.hsm_uri
name = "515eb02d-2335-4d2d-92f2-b1cbdf9c3778"
}
resource "azurerm_key_vault_managed_hardware_security_module_role_assignment" "test" {
managed_hsm_id = azurerm_key_vault_managed_hardware_security_module.test.id
name = local.assignmentOfficerName
scope = "/keys"
role_definition_id = data.azurerm_key_vault_managed_hardware_security_module_role_definition.officer.resource_manager_id
principal_id = data.azurerm_client_config.current.object_id
}
`, KeyVaultManagedHardwareSecurityModuleResource{}.download(data, 3))
}

func (r KeyVaultManagedHSMRoleAssignmentResource) legacyCustomRole(data acceptance.TestData) string {
return fmt.Sprintf(`
%s
locals {
assignmentTestName = "1e243909-064c-6ac3-84e9-1c8bf8d6ad52"
}
resource "azurerm_key_vault_managed_hardware_security_module_role_assignment" "test" {
managed_hsm_id = azurerm_key_vault_managed_hardware_security_module.test.id
name = local.assignmentTestName
scope = "/keys"
role_definition_id = azurerm_key_vault_managed_hardware_security_module_role_definition.test.resource_manager_id
principal_id = data.azurerm_client_config.current.object_id
}
`, KeyVaultMHSMRoleDefinitionResource{}.basic(data))
}
Original file line number Diff line number Diff line change
Expand Up @@ -116,66 +116,6 @@ resource "azurerm_key_vault_managed_hardware_security_module_role_definition" "t
`, r.template(data), data.RandomString)
}

func (r KeyVaultMHSMRoleDefinitionResource) legacy(data acceptance.TestData) string {
return fmt.Sprintf(`
%s
locals {
roleTestName = "c9562a52-2bd9-2671-3d89-cea5b4798a6b"
}
resource "azurerm_key_vault_managed_hardware_security_module_role_definition" "test" {
name = local.roleTestName
vault_base_url = azurerm_key_vault_managed_hardware_security_module.test.hsm_uri
description = "desc foo"
permission {
data_actions = [
"Microsoft.KeyVault/managedHsm/keys/read/action",
"Microsoft.KeyVault/managedHsm/keys/write/action",
"Microsoft.KeyVault/managedHsm/keys/encrypt/action",
"Microsoft.KeyVault/managedHsm/keys/create",
"Microsoft.KeyVault/managedHsm/keys/delete",
]
not_data_actions = [
"Microsoft.KeyVault/managedHsm/roleAssignments/read/action",
]
}
}
`, r.template(data))
}

func (r KeyVaultMHSMRoleDefinitionResource) legacyUpdate(data acceptance.TestData) string {
return fmt.Sprintf(`
%s
locals {
roleTestName = "c9562a52-2bd9-2671-3d89-cea5b4798a6b"
}
resource "azurerm_key_vault_managed_hardware_security_module_role_definition" "test" {
name = local.roleTestName
vault_base_url = azurerm_key_vault_managed_hardware_security_module.test.hsm_uri
description = "desc foo2"
permission {
data_actions = [
"Microsoft.KeyVault/managedHsm/keys/read/action",
"Microsoft.KeyVault/managedHsm/keys/write/action",
"Microsoft.KeyVault/managedHsm/keys/encrypt/action",
"Microsoft.KeyVault/managedHsm/keys/create",
]
not_data_actions = [
"Microsoft.KeyVault/managedHsm/roleAssignments/read/action",
"Microsoft.KeyVault/managedHsm/keys/delete",
]
}
}
`, r.template(data))
}

func (r KeyVaultMHSMRoleDefinitionResource) template(data acceptance.TestData) string {
return KeyVaultManagedHardwareSecurityModuleResource{}.download(data, 3)
}

0 comments on commit e0965ae

Please sign in to comment.