In CodeBuild how to resolve error Could not connect to the endpoint URL: "https://sts.amazonaws.com/"

0

Hi,

In my Codebuild that that is triggered after I submit my changes through the PR(Pull Request), as per the commands listed in the buildspec.yml , it runs one of the command(mentioned below) in the Code Build run.

Command in CodeBuild : OUT=$(aws sts assume-role --role-arn ${ROLE} --role-session-name carbon-${env}-sts) **

This codebuild run on AWS fails with error msg - "Could not connect to the endpoint URL: "https://sts.amazonaws.com/"

So i hard coded the region with the same command as mentioned above and it still fails with the same error.

Modified Command(hard coding the region) : OUT=$(aws sts assume-role --region="<our specific region name>" --role-arn ${ROLE} --role-session-name carbon-${env}-sts)

Result : It still fails with the same error as above i.e. unable to connect the endpoint , URL="https://sts.amazonaws.com"/

Any assistance to resolve the error will be greatly appreciated.

已提問 1 年前檢視次數 1349 次
2 個答案
0

Hi. Didn't you create codebuild in VPC? If so, NATGateway or nat instance is needed. https://docs.aws.amazon.com/codebuild/latest/userguide/vpc-support.html

profile picture
專家
已回答 1 年前
profile picture
專家
已審閱 1 年前
0

Another option is installing a VPC Endpoint for STS in your VPC.

profile pictureAWS
專家
kentrad
已回答 1 年前
profile picture
專家
已審閱 1 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南