Forked from limed/gist:505f3d4bca12d1ca74a7773a3ff700e2
Created
October 6, 2016 14:00
-
-
Save eugenestarchenko/8cbe26fcb5996343021be50c7829128a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
+resource "null_resource" "user_management_credstash" { | |
+ count = "${var.enabled * var.enable_user_management * length(split(",", var.environments))}" | |
+ | |
+ lifecycle { | |
+ create_before_destroy = true | |
+ } | |
+ | |
+ triggers { | |
+ region = "${var.aws_region}" | |
+ environment = "${element(split(",", var.environments))}" | |
+ context = "region=${var.aws_region} environment=${element(split(",", var.environments), count.index)} service=nubis" | |
+ smtp_from_address = "${var.user_management_smtp_from_address}" | |
+ smtp_user = "${var.user_management_smtp_username}" | |
+ smtp_host = "${var.user_management_smtp_host}" | |
+ ldap_server = "${var.user_management_ldap_server}" | |
+ ldap_port = "${var.user_management_ldap_port}" | |
+ ldap_bind_user = "${var.user_management_ldap_bind_user}" | |
+ ldap_bind_password = "${var.user_management_ldap_bind_password}" | |
+ tls_cert = "${file("${path.cwd}/${var.user_management_tls_cert}")}" | |
+ tls_key = "${file("${path.cwd}/${var.user_management_tls_cert}")}" | |
+ global_admin_ldap_group = "${var.user_management_global_admins}" | |
+ sudo_user_ldap_group = "${var.user_management_sudo_users}" | |
+ users_ldap_group = "${var.user_management_users}" | |
+ credstash = "credstash -r ${var.aws_region} put -a -k nubis/${element(split(",", var.environments), count.index)}" | |
+ } | |
+ | |
+ provisioner "local-exec" { | |
+ command = "${self.triggers.credstash}/user-sync/config `echo \"${template_file.user_management_config.rendered}\"` ${self.triggers.context}" | |
+ } | |
+} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment