Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to load config file error? #383

Closed
justindra opened this issue Sep 24, 2020 · 3 comments
Closed

Failed to load config file error? #383

justindra opened this issue Sep 24, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@justindra
Copy link

justindra commented Sep 24, 2020

I am just trying to run the following example:
https://github.com/hashicorp/terraform-cdk/blob/master/examples/typescript/aws-cloudfront-proxy/main.ts

But running into an error when doing a deploy

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

cdktf & Language Versions

  • cdktf - 0.0.17
  • typescript 4.0.3

Affected Resource(s)

Debug Output

Error: error creating EC2 Metadata session: SharedConfigLoadError: failed to load config file, /home/justin/.aws/credentials
caused by: INIParseError: invalid state with ASTKind { {4 NONE 0 [61]} true [{expr {1 STRING 0 [97 119 115 95 115 101 99 114 101 116 95 97 99 99 101 115 115 95 107 101 121]} true []}]} and TokenType op

  on cdk.tf.json line 20, in provider.aws[0]:
  20:       },
non-zero exit code 1

the given lines in cdk.tf.json are as follows (expanded to show others):

{
...
  "provider": {
    "aws": [
      {
        "region": "us-west-2"
      }, // line 20
      {
        "region": "us-east-1",
        "alias": "route53"
      }
    ]
  },
}

Expected Behavior

Should deploy properly

Actual Behavior

Produces the error above, and the error doesn't seem to make too much sense.

Steps to Reproduce

  1. Copy the example and replace contents of main.ts
  2. cdktf synth
  3. cdltf deploy

Important Factoids

I have multiple AWS Profiles setup in the credentials file, but this should be using the default profile (I assume).

References

  • #0000
@justindra justindra added the bug Something isn't working label Sep 24, 2020
@skorfmann
Copy link
Contributor

This looks very similar to this hashicorp/terraform-provider-aws#14450 and might be either an actual aws-sdk upstream bug, or a format / config error. Is this issue only occurring when using cdktf or shows using terraform cli directly the same issues?

@skorfmann
Copy link
Contributor

It's likely a configuration error / or an upstream bug. In any case, nothing we can tackle without more context. Please reopen with more information.

@github-actions
Copy link
Contributor

github-actions bot commented Dec 7, 2022

I'm going to lock this issue because it has been closed for 30 days. This helps our maintainers find and focus on the active issues. If you've found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 7, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants