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

Bug: copilot CLI fails if no default region found in profile #1115

Closed
shrasool opened this issue Jul 10, 2020 · 4 comments · Fixed by #1261
Closed

Bug: copilot CLI fails if no default region found in profile #1115

shrasool opened this issue Jul 10, 2020 · 4 comments · Fixed by #1261
Labels
area/creds Issues about credentials. type/bug Issues that are bugs. type/request Issues that are created by customers.

Comments

@shrasool
Copy link

I am trying to set up copilot init demo app using the interactive CLI but I am unable as the default AWS profile does not have region specified (an optional field) so the init command fails.

hamidrasool@LAPTOP:~/copilot-demo-app$ copilot init
Note: It's best to run this command in the root of your Git repository.
Welcome to the Copilot CLI! We're going to walk you through some questions
to help you get set up with an application on ECS. An application is a collection of
containerized services that operate together.

Application name: copilot-demo
✘ get application copilot-demo: get application copilot-demo: MissingRegion: could not find region configuration

The missing feature in this case is a setting for --region parameter and optionally adding a prompt to the interactive init setup if it is not specified. Currently there is no such flag available, and surprised there isn't any planned in the roadmap.

hamidrasool@LAPTOP:~/copilot-demo-app$ copilot init --region eu-west-1
✘ unknown flag: --region

Current workaround is to add the region manually into ~/.aws/config if needed to deploy for any particular region which should not be needed as it forces user to change their default settings for profile. Alternately setting a new profile for this purpose for each required region is equally not a pleasant user experience.

System tested on: Ubuntu 18.04 on WSL2

@efekarakus efekarakus added area/creds Issues about credentials. type/bug Issues that are bugs. type/request Issues that are created by customers. labels Jul 10, 2020
@efekarakus
Copy link
Contributor

Thanks @shrasool ! Glad you found the workarounds to get it working for now, we have a story (#36) to track permission related issues and we'll updated that issue as we improve the UX for our environment and application initialization!

@mergify mergify bot closed this as completed in #1261 Aug 12, 2020
mergify bot pushed a commit that referenced this issue Aug 12, 2020
Resolves #1228 and resolves #1115 

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
@efekarakus
Copy link
Contributor

efekarakus commented Aug 13, 2020

Heya @shrasool we released v0.3.0 which now prompts for a region if we don't detect one while running copilot env init!

@serverlesspolska
Copy link

serverlesspolska commented Mar 17, 2021

Hi Guys,

I'm new to that tool however it fails for me due to MissingRegion.

I checked out the repo https://github.com/aws-samples/aws-copilot-sample-service.git and run copilot init which asked me for app name, and then it failed

copilot init
Welcome to the Copilot CLI! We're going to walk you through some questions
to help you get set up with an application on ECS. An application is a collection of
containerized services that operate together.

Application name: demo
✘ get application demo: get application demo: MissingRegion: could not find region configuration

I deliberately don't use the default region in my AWS config file and don't plan to start (as it is easy to execute to commend against the default region instead of intended one).

@efekarakus how can I specify the region?

Also this fails as well

copilot env init
✘ ask for application: list applications: list applications: MissingRegion: could not find region configuration

UPDATE:
I figured that exporting $AWS_REGION does the trick.

@efekarakus
Copy link
Contributor

Awesome glad you got it working @serverlesspolska !

mergify bot pushed a commit that referenced this issue Sep 15, 2021
…mation is missing (#2819)

This PR is addressing the experience described in #2731 and #1115. 

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License..
thrau pushed a commit to localstack/copilot-cli-local that referenced this issue Dec 9, 2022
Resolves aws#1228 and resolves aws#1115 

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
thrau pushed a commit to localstack/copilot-cli-local that referenced this issue Dec 9, 2022
…mation is missing (aws#2819)

This PR is addressing the experience described in aws#2731 and aws#1115. 

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License..
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/creds Issues about credentials. type/bug Issues that are bugs. type/request Issues that are created by customers.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants