(core): SdkProvider.forEnvironment uses wrong credentials in Bitbucket with OIDC #29100
Labels
@aws-cdk/aws-iam
Related to AWS Identity and Access Management
bug
This issue is a bug.
effort/medium
Medium work item – several days of effort
p2
Describe the bug
I am using Bitbucket pipelines and my authorization is configured via OIDC. I can, without any issue deploy the stacks and other artifacts using configured role.
Stack deployments happen via CDK's exec role that CICD role is able to assume.
For sake of the bug let's assume:
If I do not make an attempt to use
--hotswap-fallback
I can deploy from CICD without a problem.The moment I try to use it I get:
It seems the problem lies in how SdkProvider.forEnvironment works.
What is quite important to mention is the this error happens at the end of the pipeline. Before that error I have bunch of activity related to publishing assets into deployment account 1111111 and those calls work perfectly:
Below you can find logs from execution without
--hotswap-fallback
:Expected Behavior
I can use
--hotswap-fallback
in CICD environment of Bitbucket that is using OIDC authorization.Current Behavior
Stack cannot be deployed with
--hotswap-fallback
Reproduction Steps
N/A
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.121.1
Framework Version
No response
Node.js Version
20.8
OS
Debian (BB Pipeline)
Language
TypeScript
Language Version
No response
Other information
No response
The text was updated successfully, but these errors were encountered: