EC2 인스턴스에서 “연결 iip-assoc-xxxxxxxx는 활성 연결이 아닙니다(The association iip-assoc-xxxxxxxx is not the active association)”라는 오류를 해결하려면 어떻게 해야 합니까?
최종 업데이트 날짜: 2021년 1월 27일
인스턴스 프로파일을 업데이트하는 동안 Amazon Elastic Compute Cloud(Amazon EC2) 인스턴스에서 다음과 같은 오류 메시지가 나타납니다.
"연결 iip-assoc-xxxxxxxx는 활성 연결이 아닙니다(The association iip-assoc-xxxxxxxx is not the active association)"
이 오류를 해결하려면 어떻게 해야 합니까?
간략한 설명
이 오류는 일반적으로 API에 의해 이전 연결 해제가 아직 이행되지 않은 상태에서 인스턴스 프로파일을 업데이트하려고 할 때 발생합니다. AWS 명령줄 인터페이스(AWS CLI)를 사용하여 이행되지 않은 연결 해제로 인해 오류가 발생하는지 확인하고 문제를 해결할 수 있습니다.
참고: AWS CLI 명령을 실행할 때 오류가 발생하는 경우 최신 버전의 AWS CLI를 사용하고 있는지 확인하세요.
해결 방법
1. 다음 명령을 실행하여 인스턴스에 대한 인스턴스 프로파일 연결을 식별합니다.
aws ec2 describe-iam-instance-profile-associations --filters "Name=instance-id,Values=i-xxxxxxxxxxxxxxxxx"
명령 출력에는 각각 고유한 연결 ID(AssociationID) 및 상태(State)가 있는 여러 연결이 있습니다. 다음 예제 출력에 표시된 것처럼 연결 중 일부는 연결 상태에 있고 일부는 연결 해제 상태에 있습니다.
{
"IamInstanceProfileAssociations": [
{
"AssociationId": "iip-assoc-xxxxxxxxxxxxxxxx",
"InstanceId": "i-xxxxxxxxxxxxxxxx",
"IamInstanceProfile": {
"Arn": "arn:aws:iam::xxxxxxxxxx:instance-profile/xxxxxxx",
"Id": "xxxxxxxxxxxxxxxxxx"
},
"State": "disassociating"
},
{
"AssociationId": "iip-assoc-xxxxxxxxxxxxxxxx",
"InstanceId": "i-xxxxxxxxxxxxxxxx",
"IamInstanceProfile": {
"Arn": "arn:aws:iam::xxxxxxxxxxxx:instance-profile/xxxxxxxxx",
"Id": "xxxxxxxxxxxxxxxx"
},
"State": "associating"
}
]
}
2. 연결 및 연결 해제 상태의 연결을 포함하여 모든 연결 ID를 연결 해제하려면 다음 명령을 실행합니다. iip-assoc-xxxxxxxxxxxxxxxxxx를 적절한 association-id로 바꿉니다.
aws ec2 disassociate-iam-instance-profile --association-id iip-assoc-xxxxxxxxxxxxxxxxxx
3. 모든 연결 ID의 연결을 끊은 후 인스턴스 프로파일을 다시 업데이트합니다.