what
- Removed
provider "aws"
why
- Not necessary here, should be used in higher-level modules
- Prevents inheriting provider settings from higher-level modules
- Becomes an issue when testing locally if we use the AWS security keys like this (not the best practice, but people use it for testing):
provider "aws" {
region = "${var.region}"
access_key = "XXXXXXXXXXXXX"
secret_key = "XXXXXXXXXXXXX"
}
At the same time, this code in terraform-aws-dynamic-subnets
:
provider "aws" {
region = "${var.region}"
}
throws the error:
module.subnets.provider.aws: No valid credential sources found for AWS Provider
.