Skip to content

Instantly share code, notes, and snippets.

@mafonso
Created January 26, 2017 15:18
Show Gist options
  • Save mafonso/43a9ebdd78c2975c05790f4d9f249c23 to your computer and use it in GitHub Desktop.
Save mafonso/43a9ebdd78c2975c05790f4d9f249c23 to your computer and use it in GitHub Desktop.
On Vault:
$ vault auth-enable aws-ec2
Successfully enabled 'aws-ec2' at 'aws-ec2'!
vault write auth/aws-ec2/role/instance-worker bound_iam_role_arn=arn:aws:iam::000000000000:role/instance-nomad max_ttl=500h
bound_iam_role_arn
#Login
#vault auth
curl -X POST -d '{"role":"nomad-role","pkcs7":"'$(curl -s http://169.254.169.254/latest/dynamic/instance-identity/pkcs7 | tr -d '\n')'"}'
#Token Create
#vault token-create -role nomad-server
curl -X POST -H "X-Vault-Token:$VAULT_TOKEN" "https://vault.internal.domain:8200/v1/auth/token/create/nomad-server"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment