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.

질문됨 일 년 전1350회 조회
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
전문가
답변함 일 년 전
profile picture
전문가
검토됨 일 년 전
0

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

profile pictureAWS
전문가
kentrad
답변함 일 년 전
profile picture
전문가
검토됨 일 년 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠