-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add permissions to installer for private links (#62)
Co-authored-by: Adam Smith <[email protected]>
- Loading branch information
1 parent
2b702ff
commit 3cc4e92
Showing
10 changed files
with
115 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
manifests/wayfinder-azure-privatelinkmanager-cloudaccessconfig.yml.tpl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
apiVersion: cloudaccess.appvia.io/v2beta2 | ||
kind: CloudAccessConfig | ||
metadata: | ||
name: azure-privatelinks | ||
namespace: ws-admin | ||
spec: | ||
cloud: azure | ||
azure: | ||
subscription: ${subscription_id} | ||
tenantID: ${tenant_id} | ||
description: Platform Private Link Management, created by Wayfinder install | ||
type: NetworkPrivateLinks | ||
cloudIdentityRef: | ||
cloud: azure | ||
name: ${identity} | ||
permissions: | ||
- permission: PrivateLinkManager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
locals { | ||
privatelinkmanager_definition = jsondecode(file("${path.module}/wf_privatelink_manager_definition.json")) | ||
} | ||
|
||
resource "azurerm_role_definition" "privatelinkmanager" { | ||
count = var.enable_private_link_manager ? 1 : 0 | ||
|
||
name = "${local.resource_prefix}privatelinkmanager${local.resource_suffix}" | ||
scope = data.azurerm_subscription.primary.id | ||
|
||
permissions { | ||
actions = local.privatelinkmanager_definition.actions | ||
} | ||
} | ||
|
||
resource "time_sleep" "after_azurerm_role_definition_privatelinkmanager" { | ||
count = var.enable_private_link_manager ? 1 : 0 | ||
depends_on = [ | ||
azurerm_role_definition.privatelinkmanager[0], | ||
] | ||
|
||
triggers = { | ||
"azurerm_role_definition_privatelinkmanager" = jsonencode(keys(azurerm_role_definition.privatelinkmanager[0])) | ||
} | ||
|
||
create_duration = var.create_duration_delay["azurerm_role_definition"] | ||
destroy_duration = var.destroy_duration_delay["azurerm_role_definition"] | ||
} | ||
|
||
resource "azurerm_role_assignment" "privatelinkmanager" { | ||
count = var.enable_private_link_manager && var.from_azure ? 1 : 0 | ||
|
||
scope = data.azurerm_subscription.primary.id | ||
role_definition_name = azurerm_role_definition.privatelinkmanager[0].name | ||
principal_id = var.wayfinder_identity_azure_principal_id | ||
|
||
depends_on = [ | ||
time_sleep.after_azurerm_role_definition_privatelinkmanager[0], | ||
azurerm_role_definition.privatelinkmanager[0], | ||
] | ||
} |
21 changes: 21 additions & 0 deletions
21
modules/cloudaccess/wf_privatelink_manager_definition.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
{ | ||
"actions": [ | ||
"Microsoft.Authorization/roleAssignments/read", | ||
"Microsoft.Authorization/roleDefinitions/read", | ||
"Microsoft.Network/privateEndpoints/read", | ||
"Microsoft.Network/privateEndpoints/write", | ||
"Microsoft.Network/privateEndpoints/delete", | ||
"Microsoft.Network/privateDnsZones/read", | ||
"Microsoft.Network/privateDnsZones/write", | ||
"Microsoft.Network/privateDnsZones/A/read", | ||
"Microsoft.Network/privateDnsZones/A/write", | ||
"Microsoft.Network/privateDnsZones/A/delete", | ||
"Microsoft.Network/privateDnsZones/virtualNetworkLinks/read", | ||
"Microsoft.Network/privateDnsZones/virtualNetworkLinks/write", | ||
"Microsoft.Network/privateDnsZones/virtualNetworkLinks/delete", | ||
"Microsoft.Network/virtualNetworks/join/action", | ||
"Microsoft.Network/virtualNetworks/subnets/join/action", | ||
"Microsoft.Network/networkInterfaces/read", | ||
"Microsoft.ContainerService/managedClusters/PrivateEndpointConnectionsApproval/action" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters