This file contains hidden or 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
| package main | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "io/ioutil" | |
| "net/http" | |
| "os" | |
| ) |
This file contains hidden or 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
| var child_process = require('child_process'); | |
| exports.handler = function(event, context) { | |
| // print out output of the received event | |
| console.log("\nREQUEST RECEIVED:\n", JSON.stringify(event)); | |
| // since this is a vpc lambda function we need to export proxy variable | |
| var command = event.command; | |
| if (!command) { |
This file contains hidden or 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
| diff --git a/modules/vpc/inputs.tf b/modules/vpc/inputs.tf | |
| index 31a8acd..d6c144b 100644 | |
| --- a/modules/vpc/inputs.tf | |
| +++ b/modules/vpc/inputs.tf | |
| @@ -82,6 +82,10 @@ variable enable_vpn { | |
| variable enable_nat { | |
| } | |
| +variable enable_user_management { | |
| + default = 1 |
This file contains hidden or 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
| # Generated by confd {{ datetime }} | |
| --- | |
| nubis_users::user: | |
| # global-admins{{ range $dir := lsdir "/global-admins" }}{{ if exists (print "/global-admins/" $dir "/sshPublicKey") }} | |
| {{ getv (print "/global-admins/" $dir "/uid") }}: | |
| groups: | |
| - wheel | |
| - users | |
| ssh_keys: | {{ $pubkey := getv (print "/global-admins/" $dir "/sshPublicKey") }} | |
| {{ replace $pubkey "\n" "\n\t\t" -1 }} |
This file contains hidden or 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
| package main | |
| import ( | |
| "bytes" | |
| "flag" | |
| "fmt" | |
| "log" | |
| "os/exec" | |
| ) |
This file contains hidden or 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
| package main | |
| import ( | |
| "fmt" | |
| "github.com/aws/aws-sdk-go/aws" | |
| "github.com/aws/aws-sdk-go/aws/session" | |
| "github.com/aws/aws-sdk-go/service/iam" | |
| "log" | |
| ) |
This file contains hidden or 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
| { | |
| "variables": { | |
| "aws_vault_profile": "nubis-training-2016-admin", | |
| "aws_region": "us-west-2", | |
| "ami_regions": "us-west-2" | |
| } | |
| } |
This file contains hidden or 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
| function aws-vault() { | |
| local aws_vault_cmd=$(which aws-vault) | |
| if [ -z "${aws_vault_cmd}" ]; then | |
| echo "aws-vault is not on your path you do not have it installed" | |
| exit 1 | |
| fi | |
| case "$1" in | |
| exec) |
This file contains hidden or 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))}" |
This file contains hidden or 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
| environments/stage/global/nubis-users/global-admins/elim/sshPublicKey | |
| environments/stage/global/nubis-users/global-admins/elim/uid | |
| environments/stage/global/nubis-users/global-admins/jcrowe/sshPublicKey | |
| environments/stage/global/nubis-users/global-admins/jcrowe/uid | |
| environments/stage/global/nubis-users/global-admins/pchiasson/sshPublicKey | |
| environments/stage/global/nubis-users/global-admins/pchiasson/uid | |
| environments/stage/global/nubis-users/sudo-users/riweiss/sshPublicKey | |
| environments/stage/global/nubis-users/sudo-users/riweiss/uid | |
| environments/stage/global/nubis-users/sudo-users/rtucker/sshPublicKey | |
| environments/stage/global/nubis-users/sudo-users/rtucker/uid |