You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am into a strange issue. We are running a job that contains these steps:
- name: Configure AWS Credentials for Region us-east-1
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::<not shown>:role/GithubActionsFullAccess
aws-region: us-east-1
- name: Set up Terraform
uses: hashicorp/setup-terraform@v2
with:
terraform_version: "1.6.1"
- name: Run Terraform Apply In Empty Environment
working-directory: ./infrastructure/test
run: |
terraform init
terraform destroy -auto-approve
terraform apply -auto-approve
- name: Run end-to-end tests
run: poetry run python -m pytest -m e2e
Terraform correctly creates all resources in the us-east-1 region. We then use pytest to run some end to end tests against the environment. In the past this has worked fine for the two tests that we had. These tests only used s3 and created the client like this:
s3_client = boto3.client("s3")
Today I have added another test case which in addition to s3 also requires ssm and ec2:
For both ssm and ec2 I am seeing unexpected exceptions indicating that the wrong region is being targeted. For instance I can see botocore.errorfactory.ParameterNotFound: An error occurred (ParameterNotFound) when calling the GetParameter operation while the parameter properly exists in us-east-1. I can work around this by setting the region when creating the client:
why does the s3 client work without the second parameter but not the ssm and ec2 client
what environment variables is the configure-aws-credentials@v4 action setting in the job for the steps that follow (I think boto3 needs AWS_DEFAULT_REGION)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi, I am into a strange issue. We are running a job that contains these steps:
Terraform correctly creates all resources in the
us-east-1
region. We then usepytest
to run some end to end tests against the environment. In the past this has worked fine for the two tests that we had. These tests only useds3
and created the client like this:Today I have added another test case which in addition to
s3
also requiresssm
andec2
:For both
ssm
andec2
I am seeing unexpected exceptions indicating that the wrong region is being targeted. For instance I can seebotocore.errorfactory.ParameterNotFound: An error occurred (ParameterNotFound) when calling the GetParameter operation
while the parameter properly exists inus-east-1
. I can work around this by setting the region when creating the client:I just don't understand why I have to do this?
s3
client work without the second parameter but not thessm
andec2
clientconfigure-aws-credentials@v4
action setting in the job for the steps that follow (I think boto3 needs AWS_DEFAULT_REGION)Beta Was this translation helpful? Give feedback.
All reactions