Giter Club home page Giter Club logo

terraform-azurerm-caf-keyvault's Introduction

Deploys an Azure Key Vault

Creates an Azure Key Vault.

Supported features:

  1. AKV name is generated randomly based on (prefix+name)+randomly generated string to ensure WW uniqueness (created on 24 chars, which is max name length of AKV name)
  2. AKV main settings: enabled for deployment, disk encryption, template deployment
  3. AKV SKU: Premium or Standard
  4. AKV networks ACL

Non-supported features:

  1. Support for AKV policies is kept outside of this module in order to preserve consistency of policies. Ie: for each AKV creation, you should set your access policy tailored to the specific purpose (see AKV sample policy file - access_policy_sample.tf)

Reference the module to a specific version (recommended):

module "azurekevault" {
    source  = "aztfmod/caf-keyvault/azurerm"
    version = "0.x.y"

    prefix                            = var.prefix
    location                          = var.location
    rg                                = var.rg
    akv_config                        = var.akv_config
    tags                              = var.tags
    diagnostics_settings              = var.ipdiags
    diagnostics_map                   = var.diagsmap
    log_analytics_workspace           = var.laworkspace
}

Parameters

akv_config

(Required) Key Vault Configuration Object"

variable "akv_config" {
  description = "(Required) Key Vault Configuration Object"
}

Sample:

akv_config = {
    name       = "myakv"

    akv_features = {
        enabled_for_disk_encryption = true
        enabled_for_deployment      = false
        enabled_for_template_deployment = true
    }
    #akv_features is optional

    sku_name = "premium"
    network_acls = {
         bypass = "AzureServices"
         default_action = "Deny"
    }
    #network_acls is optional
}

location

(Required) Location of the resource to be created.

variable "location" {
  description = "(Required) Location of the AKV to be created"
}

Sample:

location = "southeastasia"

rg

(Required) Resource group of the resource to be created.

variable "rg" {
  description = "(Required) Resource group of the public IP to be created"
}

Sample:

rg = "myrg"

tags

(Required) Map of tags for the deployment.

variable "tags" {
  description = "(Required) map of tags for the deployment"
}

Example

tags = {
    environment     = "DEV"
    owner           = "Arnaud"
    deploymentType  = "Terraform"
  }

log_analytics_workspace

(Required) Log Analytics workspace for AKV

variable "log_analytics_workspace" {
  description = "(Required) Log Analytics workspace for AKV"
}

Example

log_analytics_workspace = module.loganalytics.object

diagnostics_map

(Required) Map with the diagnostics repository information"

variable "diagnostics_map" {
 description = "(Required) Map with the diagnostics repository information"
}

Example

  diagnostics_map = {
      diags_sa      = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/arnaud-hub-operations/providers/Microsoft.Storage/storageAccounts/opslogskumowxv"
      eh_id         = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/arnaud-hub-operations/providers/Microsoft.EventHub/namespaces/opslogskumowxv"
      eh_name       = "opslogskumowxv"
  }

diagnostics_settings

(Required) Map with the diagnostics settings for AKV deployment. See the required structure in the following example or in the diagnostics module documentation.

variable "diagnostics_settings" {
 description = "(Required) Map with the diagnostics settings for AKV deployment"
}

Example

diagnostics_settings = {
    log = [
                # ["Category name",  "Diagnostics Enabled(true/false)", "Retention Enabled(true/false)", Retention_period]
                ["AuditEvent", true, true, 60],
        ]
    metric = [
                #["Category name",  "Diagnostics Enabled(true/false)", "Retention Enabled(true/false)", Retention_period]
                  ["AllMetrics", true, true, 60],
    ]
}

convention

(Required) Naming convention to be used.

variable "convention" {
  description = "(Required) Naming convention used"
}

Example

convention = "cafclassic"

Output

Name Type Description
object object Returns the full object of the created AKV.
name string Returns the name of the created AKV.
id string Returns the ID of the created AKV.
vault_uri string Returns the FQDN of the created AKV.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.