Last active
March 16, 2019 18:09
-
-
Save 100daysofdevops/7e028de60ad2bec7492c0bfc6761f976 to your computer and use it in GitHub Desktop.
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
| # This is going to overwrite our exisiting credentials file, make sure take a backup of that | |
| provider "aws" { | |
| region = "us-west-2" | |
| } | |
| resource "aws_iam_user" "mytestuser" { | |
| name = "mytestuser" | |
| } | |
| resource "aws_iam_access_key" "myaccesskey" { | |
| user = "${aws_iam_user.mytestuser.name}" | |
| } | |
| resource "local_file" "aws_keys" { | |
| content = <<EOF | |
| [mytestuser] | |
| aws_access_key_id = ${aws_iam_access_key.myaccesskey.id} | |
| aws_secret_access_key = ${aws_iam_access_key.myaccesskey.secret} | |
| EOF | |
| filename = "${var.user_home_path}/.aws/credentials" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment