Open Andrew13648 opened 3 years ago
Hi folks 👋 Any issues with parsing AWS configuration files, such as incorrect handling with certain options or hard to understand INIParseError
errors, will need bug reports filed upstream in the AWS Go SDK. The Terraform AWS Provider is wholly dependent on the AWS Go SDK to properly work with INI files that are also supported by other AWS SDKs and the AWS CLI (boto/Python).
Change the Provider Version Configuration
For example, given this previous configuration: provider "aws" { version = "~> 2.70" }
it worked for me.
Hi! I have the same issue with AWS config file, but I found a solution (and I don't know if it applies with your casuistry).
In my case, the config file looks like this:
# Amazon Web Services Config File used by AWS CLI, SDKs, and tools
# More comments...
[default]
# The access key and secret key pair identify your account and grant access to AWS.
aws_access_key_id = [accessKey]
aws_secret_access_key = [secretKey]
# More config...
I think that the problem is the values [accessKey]
and [secretKey]
!
I cleaned the config file (removing all comments and these fields) and it works. Try it!
Ran into this issue using init with the 0.13.5 and 0.14.11 versions. Ran init again with 0.12.18 and no error.
Error: error configuring S3 Backend: Error creating AWS session: SharedConfigLoadError: failed to load config file, C:\Users\myuseraccounthere.aws\config caused by: INIParseError: invalid state with ASTKind {section_stmt {1 STRING 0 [112 114 111 102 105 108 101 32]} true []} and TokenType comment
However, I did hit issue again running the plan with 0.12.18...
Many Thanks @amoncusir The issue is with .credentials file. Removed rest all after [default] profile and it worked
Marking this issue as stale due to inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 30 days it will automatically be closed. Maintainers can also remove the stale label.
If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!
Community Note
Terraform CLI and Terraform AWS Provider Version
Terraform v0.12.29
Affected Resource(s)
Expected Behavior
Expecting
terraform apply
to work with the3.0.0
provider.Actual Behavior
When I do
terraform apply
with the3.0.0
provider, I am getting this error:I tried deleting my
.terraform
folder and rerunningterraform init
to get around this, but no luck with that. However, I was able to get this to work successfully when I downgraded my provider back to2.70.0
, so it appears it is related to the3.0.0
provider.I did check the ASCII numbers from the error string and see that it is representing
azure_session_duration_minutes
. I do have this line in myconfig
file:I found that if I deleted this line from my
config
, it does work as expected. However, it seems like this should not be required since this was present and working in the previous provider version.Steps to Reproduce
terraform apply
Important Factoids
N/A
References