Skip to content

Commit

Permalink
feat(archives.jenkins.io) import existing CNAME records for archives …
Browse files Browse the repository at this point in the history
…jenkins.io and archives.jenkins-ci.org (#488)

Related to jenkins-infra/helpdesk#3760

This PR defines the existing `CNAME` DNS records for
`archives.jenkins.io` and `archives.jenkins-ci.org`.

These records have been imported in the terraform state. Merging this PR
will apply the following changes (only add tags to the records):

```
Terraform will perform the following actions:

  # azurerm_dns_cname_record.archives_jenkins_io["jenkins-ci.org"] will be updated in-place
  ~ resource "azurerm_dns_cname_record" "archives_jenkins_io" {
        id                  = "/subscriptions/<redacted>/resourceGroups/proddns_jenkinsci/providers/Microsoft.Network/dnsZones/jenkins-ci.org/CNAME/archives"
        name                = "archives"
      ~ tags                = {
          + "repository" = "jenkins-infra/azure"
          + "scope"      = "terraform-managed"
        }
        # (5 unchanged attributes hidden)
    }

  # azurerm_dns_cname_record.archives_jenkins_io["jenkins.io"] will be updated in-place
  ~ resource "azurerm_dns_cname_record" "archives_jenkins_io" {
        id                  = "/subscriptions/<redacted>/resourceGroups/proddns_jenkinsio/providers/Microsoft.Network/dnsZones/jenkins.io/CNAME/archives"
        name                = "archives"
      ~ tags                = {
          + "repository" = "jenkins-infra/azure"
          + "scope"      = "terraform-managed"
        }
        # (5 unchanged attributes hidden)
    }

Plan: 0 to add, 2 to change, 0 to destroy.
```

Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
  • Loading branch information
dduportal committed Sep 28, 2023
1 parent e7d940a commit 457d415
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .shared-tools
12 changes: 12 additions & 0 deletions archives.jenkins.io.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
resource "azurerm_dns_cname_record" "archives_jenkins_io" {
for_each = {
"${data.azurerm_dns_zone.jenkinsio.name}" = "${data.azurerm_dns_zone.jenkinsio.resource_group_name}",
"${data.azurerm_dns_zone.jenkinsciorg.name}" = "${data.azurerm_dns_zone.jenkinsciorg.resource_group_name}",
}
name = "archives"
zone_name = each.key
resource_group_name = each.value
ttl = 60
record = "archives.do.jenkins.io" # Digital Ocean VM
tags = local.default_tags
}
11 changes: 10 additions & 1 deletion dns.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
# Jenkins.io DNS zone
data "azurerm_resource_group" "proddns_jenkinsio" {
name = "proddns_jenkinsio"
}

data "azurerm_dns_zone" "jenkinsio" {
name = "jenkins.io"
resource_group_name = data.azurerm_resource_group.proddns_jenkinsio.name
}

# Jenkins-ci.org DNS zone
data "azurerm_resource_group" "proddns_jenkinsci" {
name = "proddns_jenkinsci"
}
data "azurerm_dns_zone" "jenkinsciorg" {
name = "jenkins-ci.org"
resource_group_name = data.azurerm_resource_group.proddns_jenkinsci.name
}

0 comments on commit 457d415

Please sign in to comment.