You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Pipelines deployment is failing when trying to connect to AWS through OIDC.
I assume it's not a permission issue, as even adding AdministratorAccess Policy to the OIDC Role, the authentication does not work.
WARNING: Refreshing temporary credentials failed during mandatory refresh period.
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/botocore/credentials.py", line 529, in _protected_refresh
metadata = self._refresh_using()
File "/usr/local/lib/python3.9/site-packages/botocore/credentials.py", line 670, in fetch_credentials
File "/usr/local/lib/python3.9/site-packages/botocore/credentials.py", line 680, in _get_cached_credentials
response = self._get_credentials()
File "/usr/local/lib/python3.9/site-packages/botocore/credentials.py", line 890, in _get_credentials
File "/usr/local/lib/python3.9/site-packages/botocore/client.py", line 386, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/usr/local/lib/python3.9/site-packages/botocore/client.py", line 705, in _make_api_call
raise error_class(parsed_response, operation_name)
botocore.exceptions.ClientError: An error occurred (AccessDenied) when calling the AssumeRoleWithWebIdentity operation: Not authorized to perform sts:AssumeRoleWithWebIdentity
The problem was that I had a conditional policy in my OIDC Role Trus Relationship that allowed a specific range of IPs from Bitbucket.
I took those IPs from this documentation: https://support.atlassian.com/bitbucket-cloud/docs/what-are-the-bitbucket-cloud-ip-addresses-i-should-use-to-configure-my-corporate-firewall/
I don't know why Bitbucket Pipelines was using another IP to connect to my AWS OIDC.
So now, I merged another IP list from this documentation: https://support.atlassian.com/organization-administration/docs/ip-addresses-and-domains-for-atlassian-cloud-products/#Outgoing-Connections
And now it's working again.
Thank you for your question!
Make sure that you setup properly OIDC access on AWS according to the Deploy on AWS using Bitbucket Pipelines OpenID Connect guide.