Giter Club home page Giter Club logo

terraform-azurerm-keyvault-advanced's Introduction

terraform-azurerm-keyvault-advanced

Build Status

Create Key Vault in Azure and (optionally) add policies and secrets

This Terraform module deploys a Key Vautl to Azure with a access policies and secrets passed as inputs This module also has the option to create a Resource Group for the Key Vault, althought I recommend creating it manually since destruction of the Resource Group with terraform destroy can potientially cause destruction of other resources in the Resource Group beside the Key Vault

Usage

module "keyvault" {
  source              = "jungopro/keyvault-advanced/azurerm"
  resource_group_name = "myKeyVaultResourceGroup"
  location            = "westeurope"

  tags = {
    environment = "dev"
  }
}

Example with multiple policies and secrets

module "keyvault" {
  source              = "jungopro/keyvault-advanced/azurerm"
  resource_group_name = "myKeyVaultResourceGroup"
  location            = "westeurope"

  tags = {
    environment = "dev"
  }

  policies = {
    full = {
      tenant_id = "<ADD-TENANT-ID"
      object_id = "<ADD-OBJECT-ID>"
      key_permissions = [
        "backup",
        "create",
        "decrypt",
        "delete",
        "encrypt",
        "get",
        "import",
        "list",
        "purge",
        "recover",
        "restore",
        "sign",
        "unwrapKey",
        "update",
        "verify",
        "wrapKey",
      ]
      secret_permissions = [
        "backup",
        "delete",
        "get",
        "list",
        "purge",
        "recover",
        "restore",
        "set",
      ]
      certificate_permissions = [
        "create",
        "delete",
        "deleteissuers",
        "get",
        "getissuers",
        "import",
        "list",
        "listissuers",
        "managecontacts",
        "manageissuers",
        "purge",
        "recover",
        "setissuers",
        "update",
        "backup",
        "restore",
      ]
    }
    read = {
      tenant_id = "<ADD-TENANT-ID"
      object_id = "<ADD-OBJECT-ID>"
      key_permissions = [
        "get",
        "list",
      ]
      secret_permissions = [
        "get",
        "list",
      ]
      certificate_permissions = [
        "get",
        "getissuers",
        "list",
        "listissuers",
      ]
    }
  }

  secrets = {
    foo = {
      value = "" # setting to "" will auto generate a random value
    }
    bar = {
      value = "mysecretvalue" #
    }
  }
}

Authors

Originally created by Omer Barel

License

MIT

terraform-azurerm-keyvault-advanced's People

Contributors

jungopro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

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.