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

feat(ci.jenkins.io) add resources for azure-vm agents in the new sponsorship subscription #519

Merged
merged 1 commit into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 33 additions & 5 deletions ci.jenkins.io.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,15 @@
####################################################################################
data "azurerm_subnet" "ci_jenkins_io_ephemeral_agents" {
name = "${data.azurerm_virtual_network.public.name}-ci_jenkins_io_agents"
virtual_network_name = "${data.azurerm_resource_group.public.name}-vnet"
resource_group_name = data.azurerm_resource_group.public.name
virtual_network_name = data.azurerm_virtual_network.public.name
resource_group_name = data.azurerm_virtual_network.public.resource_group_name
}

data "azurerm_subnet" "ci_jenkins_io_ephemeral_agents_jenkins_sponsorship" {
provider = azurerm.jenkins-sponsorship
name = "${data.azurerm_virtual_network.public_jenkins_sponsorship.name}-ci_jenkins_io_agents"
virtual_network_name = data.azurerm_virtual_network.public_jenkins_sponsorship.name
resource_group_name = data.azurerm_virtual_network.public_jenkins_sponsorship.resource_group_name
}

module "ci_jenkins_io" {
Expand Down Expand Up @@ -48,9 +55,30 @@ module "ci_jenkins_io_azurevm_agents" {

service_fqdn = module.ci_jenkins_io.service_fqdn
service_short_stripped_name = module.ci_jenkins_io.service_short_stripped_name
ephemeral_agents_network_rg_name = data.azurerm_resource_group.public.name
ephemeral_agents_network_name = "${data.azurerm_resource_group.public.name}-vnet"
ephemeral_agents_subnet_name = "${data.azurerm_virtual_network.public.name}-ci_jenkins_io_agents"
ephemeral_agents_network_rg_name = data.azurerm_subnet.ci_jenkins_io_ephemeral_agents.resource_group_name
ephemeral_agents_network_name = data.azurerm_subnet.ci_jenkins_io_ephemeral_agents.virtual_network_name
ephemeral_agents_subnet_name = data.azurerm_subnet.ci_jenkins_io_ephemeral_agents.name
controller_rg_name = module.ci_jenkins_io.controller_resourcegroup_name
controller_ips = compact([module.ci_jenkins_io.controller_private_ipv4, module.ci_jenkins_io.controller_public_ipv4])
controller_service_principal_id = module.ci_jenkins_io.controler_service_principal_id
default_tags = local.default_tags

jenkins_infra_ips = {
privatevpn_subnet = data.azurerm_subnet.private_vnet_data_tier.address_prefixes
}
}

module "ci_jenkins_io_azurevm_agents_jenkins_sponsorship" {
providers = {
azurerm = azurerm.jenkins-sponsorship
}
source = "./.shared-tools/terraform/modules/azure-jenkinsinfra-azurevm-agents"

service_fqdn = module.ci_jenkins_io.service_fqdn
service_short_stripped_name = module.ci_jenkins_io.service_short_stripped_name
ephemeral_agents_network_rg_name = data.azurerm_subnet.ci_jenkins_io_ephemeral_agents_jenkins_sponsorship.resource_group_name
ephemeral_agents_network_name = data.azurerm_subnet.ci_jenkins_io_ephemeral_agents_jenkins_sponsorship.virtual_network_name
ephemeral_agents_subnet_name = data.azurerm_subnet.ci_jenkins_io_ephemeral_agents_jenkins_sponsorship.name
controller_rg_name = module.ci_jenkins_io.controller_resourcegroup_name
controller_ips = compact([module.ci_jenkins_io.controller_private_ipv4, module.ci_jenkins_io.controller_public_ipv4])
controller_service_principal_id = module.ci_jenkins_io.controler_service_principal_id
Expand Down
9 changes: 9 additions & 0 deletions vnets.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@
data "azurerm_resource_group" "public" {
name = "public"
}
data "azurerm_resource_group" "public_jenkins_sponsorship" {
provider = azurerm.jenkins-sponsorship
name = "public-jenkins-sponsorship"
}
data "azurerm_resource_group" "private" {
name = "private"
}
Expand All @@ -16,6 +20,11 @@ data "azurerm_virtual_network" "public" {
name = "${data.azurerm_resource_group.public.name}-vnet"
resource_group_name = data.azurerm_resource_group.public.name
}
data "azurerm_virtual_network" "public_jenkins_sponsorship" {
provider = azurerm.jenkins-sponsorship
name = "${data.azurerm_resource_group.public_jenkins_sponsorship.name}-vnet"
resource_group_name = data.azurerm_resource_group.public_jenkins_sponsorship.name
}
data "azurerm_virtual_network" "private" {
name = "${data.azurerm_resource_group.private.name}-vnet"
resource_group_name = data.azurerm_resource_group.private.name
Expand Down