Why doesn't ec2-instance-connect work on AWS-Parallel-Cluster

0

I know Parallel Cluster3 doesn't officially support ec2-instance-connect and SSM but I'm trying to figure out why. It seems to be failing in /usr/share/ec2-instance-connect/eic_curl_authorized_keys more accurately, it fails when it tries to fetch instance metadata. In that script calling /usr/bin/curl 169.254.169.254/latest/meta-data/ returns nothing When logged in the instance using pcluster ssh, it returns the expected data.

How does this happen?

Thanks.

질문됨 2년 전325회 조회
1개 답변
0

Finally figured it out. There are iptables rules on parallel-cluster

$ sudo iptables -S
-P INPUT ACCEPT
-P FORWARD ACCEPT
-P OUTPUT ACCEPT
-N PARALLELCLUSTER_IMDS
-A OUTPUT -d 169.254.169.254/32 -j PARALLELCLUSTER_IMDS
-A OUTPUT -d 169.254.169.254/32 -m owner --uid-owner 129 -j ACCEPT
-A PARALLELCLUSTER_IMDS -d 169.254.169.254/32 -m owner --uid-owner 0 -j ACCEPT
-A PARALLELCLUSTER_IMDS -d 169.254.169.254/32 -m owner --uid-owner 400 -j ACCEPT
-A PARALLELCLUSTER_IMDS -d 169.254.169.254/32 -m owner --uid-owner 1000 -j ACCEPT
-A PARALLELCLUSTER_IMDS -d 169.254.169.254/32 -j REJECT --reject-with icmp-port-unreachable

This blocks the ec2-instance-connect user from accessing the meta-data

답변함 2년 전

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

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

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

관련 콘텐츠