feat: Allow AWS Profile selection
For the import
command, terra-transformer needs AWS access. It does this by
creating a default session.
This works fine when not using IRSA because the first credentials that are found
are in the .aws_credentials.ini
. This file also selects the correct profile.
IRSA however, takes precedence over everything (it's basically equivalent to
having credentials in the environment variables). The drawback is
.aws_credentials.ini
is never evaluated, so the correct profile is never picked.
This MR introduces a --aws-profile
parameter for the import
command. When
running under IRSA, this parameter should inform the AWS Configuration that it
needs to switch profiles before execution. Any profile from the .aws_credentials.ini
can be selected. By default, if not specified, this
new parameter uses the AWS_PROFILE
environment variable.
Fixes https://gitlab.com/gitlab-com/gl-infra/gitlab-dedicated/team/-/issues/2834