문제 설명
Boto3: 조직 단위의 AMI에 시작 권한을 추가하려고 하면 ParamValidationError가 발생합니다. (Boto3: trying to add launch permission to AMI for an organizational unit raises ParamValidationError)
문서 준수 boto3 ec2의 에서 조직 단위를 허용하도록 사용자 지정 빌드 AMI의 시작 권한을 확장하려고 합니다.
arns = [string list of arns]
for arn in arns:
r = ec2.modify_image_attribute(
ImageId=image['ImageId'],
LaunchPermission={
'Add': [
{
'OrganizationalUnitArn': arn
},
],
}
)
위의 코드를 실행하면 다음 오류가 발생합니다.
botocore.exceptions.ParamValidationError: Parameter validation failed:
Unknown parameter in LaunchPermission.Add[0]: "OrganizationalUnitArn", must be one of: Group, UserId
ARN은 문자열로 제공되며 코드 자체는 설명서에서 직접 복사했습니다. 오류의 원인은 무엇입니까?
참조 솔루션
방법 1:
My local boto3 package was simply outdated, upgrading it fixed the problem.