<commit_before>resource "azurerm_resource_group" "release-core" {
  name     = "${var.prefix}releasecore"
  location = "${var.location}"
}

### Release Certificate stored on key vault

resource "azurerm_key_vault" "release-core" {
  name                            = "${var.prefix}releasecore"
  location                        = "${azurerm_resource_group.release-core.location}"
  resource_group_name             = "${azurerm_resource_group.release-core.name}"
  tenant_id                       = "${var.tenant_id}"
  enabled_for_deployment          = false
  enabled_for_disk_encryption     = false
  enabled_for_template_deployment = false

  sku {
    name = "standard"
  }

  network_acls {
    default_action              = "Deny"
    bypass                      = "None"
    virtual_network_subnet_ids  = [
        "${azurerm_subnet.public_data.id}"
    ]
  }
}

# https://docs.microsoft.com/en-us/rest/api/keyvault/certificates-and-policies
resource "azurerm_key_vault_certificate" "release-core" {
  name     = "${var.prefix}releasecore"
  key_vault_id = "${azurerm_key_vault.release-core.id}"

  certificate_policy {
    issuer_parameters {
      name = "Self"
    }

    key_properties {
      exportable = true
      key_size   = 2048
      key_type   = "RSA"
      reuse_key  = true
    }

    lifetime_action {
      action {
        action_type = "AutoRenew"
      }

      trigger {
        days_before_expiry = 30
      }
    }

    secret_properties {
      content_type = "application/x-pkcs12"
    }

    x509_certificate_properties {
      extended_key_usage = ["1.3.6.1.5.5.7.3.1"]

      key_usage = [
        "digitalSignature",
        "cRLSign",
        "keyEncipherment",
        "dataEncipherment",
        "keyAgreement",
        "keyCertSign",
      ]

      subject            = "CN=jenkins.io"
      validity_in_months = 36
    }
  }
}


### GPG key stored on a storage account 

resource "azurerm_storage_account" "release-core" {
    name                     = "${var.prefix}releasecore"
    resource_group_name      = "${azurerm_resource_group.release-core.name}"
    location                 = "${var.location}"
    account_tier             = "Standard"
    account_replication_type = "GRS"
    network_rules {
      bypass                      = ["None"]
      virtual_network_subnet_ids  = [
          "${azurerm_subnet.public_data.id}"
      ]
  }
}

resource "azurerm_storage_container" "release-core-gpg" {
    name                  = "gpg"
    resource_group_name   = "${azurerm_resource_group.release-core.name}"<commit_msg>Delete release-core network rules<commit_after>resource "azurerm_resource_group" "release-core" {
  name     = "${var.prefix}releasecore"
  location = "${var.location}"
}

### Release Certificate stored on key vault

resource "azurerm_key_vault" "release-core" {
  name                            = "${var.prefix}releasecore"
  location                        = "${azurerm_resource_group.release-core.location}"
  resource_group_name             = "${azurerm_resource_group.release-core.name}"
  tenant_id                       = "${var.tenant_id}"
  enabled_for_deployment          = false
  enabled_for_disk_encryption     = false
  enabled_for_template_deployment = false

  sku {
    name = "standard"
  }
  }
}

# https://docs.microsoft.com/en-us/rest/api/keyvault/certificates-and-policies
resource "azurerm_key_vault_certificate" "release-core" {
  name     = "${var.prefix}releasecore"
  key_vault_id = "${azurerm_key_vault.release-core.id}"

  certificate_policy {
    issuer_parameters {
      name = "Self"
    }

    key_properties {
      exportable = true
      key_size   = 2048
      key_type   = "RSA"
      reuse_key  = true
    }

    lifetime_action {
      action {
        action_type = "AutoRenew"
      }

      trigger {
        days_before_expiry = 30
      }
    }

    secret_properties {
      content_type = "application/x-pkcs12"
    }

    x509_certificate_properties {
      extended_key_usage = ["1.3.6.1.5.5.7.3.1"]

      key_usage = [
        "digitalSignature",
        "cRLSign",
        "keyEncipherment",
        "dataEncipherment",
        "keyAgreement",
        "keyCertSign",
      ]

      subject            = "CN=jenkins.io"
      validity_in_months = 36
    }
  }
}


### GPG key stored on a storage account 

resource "azurerm_storage_account" "release-core" {
    name                     = "${var.prefix}releasecore"
    resource_group_name      = "${azurerm_resource_group.release-core.name}"
    location                 = "${var.location}"
    account_tier             = "Standard"
    account_replication_type = "GRS"
  }
}

resource "azurerm_storage_container" "release-core-gpg" {
    name                  = "gpg"
    resource_group_name   = "${azurerm_resource_group.release-core.name}"
{'fraction_non_alphanumeric': 0.10887180552669852, 'fraction_numerical': 0.00914190733430293, 'mean_word_length': 2.150523560209424, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 4, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6775929', 'n_tokens_mistral': 1595, 'n_tokens_neox': 1513, 'n_words': 224}