Skip to content

Instantly share code, notes, and snippets.

@carlessanagustin
carlessanagustin / nested_loop.tf.md
Last active March 13, 2024 12:26
Terraform nested loop
  • In <filename>.tf:
variable "users" {
  default = [
    {
      name       = "user1"
      databases  =  ["db1","db2"]
      password   = "change_me"
      privileges = ["CONNECT","CREATE","TEMPORARY"]
@miohtama
miohtama / sanitycheck.py
Created June 4, 2015 21:22
Perform database sync sanity check to SQLAlchemy models on application startup
import logging
from sqlalchemy import inspect
from sqlalchemy.ext.declarative.clsregistry import _ModuleMarker
from sqlalchemy.orm import RelationshipProperty
logger = logging.getLogger(__name__)
def is_sane_database(Base, session):