kubernetes_secret_docker_config

    0

    0

    lucycodes42

    Terraform snippets

    Whereas normal files and directories use a . to separate the filename from the directory name, ".dockercfg" refers to a file in the path module. Kubernetes secrets use the same naming convention, with the .dockercfg file name replaced with an underscore (_).

    Shortcut: tf_kubernetes_secret_docker_config

    resource "kubernetes_secret" "kubernetes_secret_id" {
       metadata {
           name = "my-metadata-name"
       }
    
       data {
           # FIXME: remove extra "\" after $
           ".dockercfg" = "\$\\{file("\$\\{path.module\}/.docker/config.json")\}"
       }
    
       type = "kubernetes.io/dockercfg"
    }
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Explore
    • Cookbooks
    • Playground
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.