When running copilot env init, Copilot will:
- Read the AWS profiles from the machine (usually, this is a file in the ~/.aws/credentials path);
- Prompt the user to select a profile with which the environment should be created with.
Today, if Copilot fails to read the profiles in step 1, it simply errorr out. This requires users to: 1. Either configure a profile, OR 2. use temporary credentials
For a user that is not familiar with AWS, this is confusing; for a toned AWS user that doesn't use shared profiles, this is not convenient.
My proposal is that Copilot should read the AWS profiles from the machine (usually, this is a file in the ~/.aws/credentials path), then:
- If the profile is not configured (i.e. the profile file - usually ~/.aws/credentials - is absent), then Copilot defaults to whatever
aws sts get-caller-identity returns. In this case, the env session would use
|
func (p *Provider) Default() (*session.Session, error) { |
- If it fails to read the profiles for other reasons, error out
- If it is able to read the profile, prompt.
When running
copilot env init, Copilot will:Today, if Copilot fails to read the profiles in step 1, it simply errorr out. This requires users to: 1. Either configure a profile, OR 2. use temporary credentials
For a user that is not familiar with AWS, this is confusing; for a toned AWS user that doesn't use shared profiles, this is not convenient.
My proposal is that Copilot should read the AWS profiles from the machine (usually, this is a file in the ~/.aws/credentials path), then:
aws sts get-caller-identityreturns. In this case, the env session would usecopilot-cli/internal/pkg/aws/sessions/sessions.go
Line 83 in 3adda09