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

AWS - Github Terraform not following install Region #853

Closed
6za opened this issue Dec 12, 2022 · 3 comments · Fixed by #944
Closed

AWS - Github Terraform not following install Region #853

6za opened this issue Dec 12, 2022 · 3 comments · Fixed by #944
Assignees
Labels
bug Something isn't working
Milestone

Comments

@6za
Copy link
Contributor

6za commented Dec 12, 2022

Overview

cat ~/.aws/config

If is missing the region:

[profile starter]
region = us-east-1

Then the install will generate the following error:

LOG: 2022/12/12 16:10:56.219660 /home/developer/app/pkg/shell.go:64: OUT:  If you ever set or change modules or backend configuration for Terraform,
LOG: 2022/12/12 16:10:56.220095 /home/developer/app/pkg/shell.go:64: OUT:  rerun this command to reinitialize your working directory. If you forget, other
LOG: 2022/12/12 16:10:56.220576 /home/developer/app/pkg/shell.go:64: OUT:  commands will detect it and remind you to do so if necessary.�[0m
LOG: 2022/12/12 16:10:56.221772 /home/developer/app/pkg/shell.go:35: INFO: Running /home/developer/.k1/tools/terraform
LOG: 2022/12/12 16:10:56.223084 /home/developer/app/pkg/shell.go:39:  export AWS_SDK_LOAD_CONFIG = *
LOG: 2022/12/12 16:10:56.223655 /home/developer/app/pkg/shell.go:39:  export AWS_PROFILE = *******
LOG: 2022/12/12 16:10:56.224172 /home/developer/app/pkg/shell.go:39:  export GITHUB_TOKEN = ****************************************
LOG: 2022/12/12 16:10:56.224578 /home/developer/app/pkg/shell.go:39:  export GITHUB_OWNER = **************
LOG: 2022/12/12 16:10:56.225158 /home/developer/app/pkg/shell.go:39:  export TF_VAR_atlantis_repo_webhook_secret = ********************
LOG: 2022/12/12 16:10:56.225661 /home/developer/app/pkg/shell.go:39:  export TF_VAR_kubefirst_bot_ssh_public_key = *********************************************************************************
LOG: 2022/12/12 16:11:02.528185 /home/developer/app/pkg/shell.go:70: ERR:  �[31m╷�[0m�[0m
LOG: 2022/12/12 16:11:02.530531 /home/developer/app/pkg/shell.go:70: ERR:  �[31m│�[0m �[0m�[1m�[31mError: �[0m�[0m�[1mInvalid provider configuration�[0m
LOG: 2022/12/12 16:11:02.531286 /home/developer/app/pkg/shell.go:70: ERR:  �[31m│�[0m �[0m
LOG: 2022/12/12 16:11:02.531837 /home/developer/app/pkg/shell.go:70: ERR:  �[31m│�[0m �[0m�[0mProvider "registry.terraform.io/hashicorp/aws" requires explicit
LOG: 2022/12/12 16:11:02.532373 /home/developer/app/pkg/shell.go:70: ERR:  �[31m│�[0m �[0mconfiguration. Add a provider block to the root module and configure the
LOG: 2022/12/12 16:11:02.532893 /home/developer/app/pkg/shell.go:70: ERR:  �[31m│�[0m �[0mprovider's required arguments as described in the provider documentation.
LOG: 2022/12/12 16:11:02.533497 /home/developer/app/pkg/shell.go:70: ERR:  �[31m│�[0m �[0m
LOG: 2022/12/12 16:11:02.533930 /home/developer/app/pkg/shell.go:70: ERR:  �[31m╵�[0m�[0m
LOG: 2022/12/12 16:11:02.534371 /home/developer/app/pkg/shell.go:70: ERR:  �[31m╷�[0m�[0m
LOG: 2022/12/12 16:11:02.534752 /home/developer/app/pkg/shell.go:70: ERR:  �[31m│�[0m �[0m�[1m�[31mError: �[0m�[0m�[1mconfiguring Terraform AWS Provider: error validating provider credentials: error calling sts:GetCallerIdentity: operation error STS: GetCallerIdentity, failed to resolve service endpoint, an AWS region is required, but was not found�[0m
LOG: 2022/12/12 16:11:02.535222 /home/developer/app/pkg/shell.go:70: ERR:  �[31m│�[0m �[0m
LOG: 2022/12/12 16:11:02.535836 /home/developer/app/pkg/shell.go:70: ERR:  �[31m│�[0m �[0m�[0m  with provider["registry.terraform.io/hashicorp/aws"],
LOG: 2022/12/12 16:11:02.536390 /home/developer/app/pkg/shell.go:70: ERR:  �[31m│�[0m �[0m  on <empty> line 0:
LOG: 2022/12/12 16:11:02.536972 /home/developer/app/pkg/shell.go:70: ERR:  �[31m│�[0m �[0m  (source code not available)
LOG: 2022/12/12 16:11:02.537376 /home/developer/app/pkg/shell.go:70: ERR:  �[31m│�[0m �[0m
LOG: 2022/12/12 16:11:02.537895 /home/developer/app/pkg/shell.go:70: ERR:  �[31m╵�[0m�[0m
LOG: 2022/12/12 16:11:02.572220 /home/developer/app/pkg/shell.go:77: error: /home/developer/.k1/tools/terraform failed exit status 1
LOG: 2022/12/12 16:11:02.573068 /home/developer/app/internal/github/github.go:47: error: terraform apply for github failed exit status 1
LOG: 2022/12/12 16:11:02.573834 /home/developer/app/cmd/create.go:41: [000] Create duration is 20.495873799s

Meaning that the region provided by the installer is ignored by this terraform.

@6za 6za added bug Something isn't working github labels Dec 12, 2022
@6za
Copy link
Contributor Author

6za commented Dec 12, 2022

Source:

LOG: 2022/12/12 16:12:46.303003 /home/developer/app/cmd/githubAdd.go:33: Org used: ----
LOG: 2022/12/12 16:12:46.303462 /home/developer/app/cmd/githubAdd.go:34: dry-run: false
LOG: 2022/12/12 16:12:46.304104 /home/developer/app/cmd/createUtils.go:299: Creating gitops repository with terraform in GitHub
LOG: 2022/12/12 16:12:46.304777 /home/developer/app/internal/github/github.go:18: Executing ApplyGithubTerraform
LOG: 2022/12/12 16:12:46.305361 /home/developer/app/pkg/shell.go:35: INFO: Running /home/developer/.k1/tools/terraform
LOG: 2022/12/12 16:12:46.305808 /home/developer/app/pkg/shell.go:39:  export AWS_SDK_LOAD_CONFIG = *
LOG: 2022/12/12 16:12:46.306385 /home/developer/app/pkg/shell.go:39:  export AWS_PROFILE = *******
LOG: 2022/12/12 16:12:46.306845 /home/developer/app/pkg/shell.go:39:  export GITHUB_TOKEN = ****************************************
LOG: 2022/12/12 16:12:46.307299 /home/developer/app/pkg/shell.go:39:  export GITHUB_OWNER = **************
LOG: 2022/12/12 16:12:46.307710 /home/developer/app/pkg/shell.go:39:  export TF_VAR_atlantis_repo_webhook_secret = ********************
LOG: 2022/12/12 16:12:46.308164 /home/developer/app/pkg/shell.go:39:  export TF_VAR_kubefirst_bot_ssh_public_key = *********************************************************************************

@6za
Copy link
Contributor Author

6za commented Dec 12, 2022

@6za 6za added this to the 1.11 Release milestone Dec 15, 2022
@6za
Copy link
Contributor Author

6za commented Dec 15, 2022

We need to double-check if this issue still in play, if yes to fix it.

@marinhojess marinhojess self-assigned this Dec 16, 2022
@marinhojess marinhojess linked a pull request Dec 16, 2022 that will close this issue
@fharper fharper changed the title AWS - Github TF not following install Region AWS - Github Terraform not following install Region Dec 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants