cerbo / aws-waf-security-automation

Amazon WAF Security Automation deployment (modular with Terraform)
Apache License 2.0
73 stars 28 forks source link

Document env var option for creds in README #9

Open mikerj1 opened 5 years ago

ventz commented 5 years ago

@mikerj1 I believe something will break if Terraform is not aware of the "provider".

That is, I believe you need to link the credentials file. Which having the ENV variables will allow the 3rd-party tools/modules/cli to work, it is not guaranteed to work going forward with terraform.

###############################################################################
# CUSTOM CONFIGURATION    #
# see: 'Change this line' #
###########################
provider "aws" {
    # *** Change ONLY THIS LINE: ***
    shared_credentials_file  = "/Users/user/.aws/credentials"
    region = "${var.aws_region}"
}
mikerj1 commented 5 years ago

Is there way to point to an aws cred profile? I have many profiles and haven't figured out how to point to a specific profile in the way aws cli provides, which is --profile . As of right now exporting ENV variables does work with this repo, but if that isn't guaranteed, then I agree that this should not be added.

ventz commented 5 years ago

@mikerj1 Yea - so that file by default will use the "default aws" cred file, but you can change it to any.

So lets say you had: /Users/$yourusername/.aws/project124

You can change:

###############################################################################
# CUSTOM CONFIGURATION    #
# see: 'Change this line' #
###########################
provider "aws" {
    # *** Change ONLY THIS LINE: ***
    shared_credentials_file  = "/Users/user/.aws/credentials"
    region = "${var.aws_region}"
}

To point to it with the shared_credentials_file line.