'Boto3: trying to add launch permission to AMI for an organizational unit raises ParamValidationError
Following the documentation of boto3 ec2, I'm trying to extend the launch permissions of a custom built AMI to allow an organizational unit.
arns = [string list of arns]
for arn in arns:
r = ec2.modify_image_attribute(
ImageId=image['ImageId'],
LaunchPermission={
'Add': [
{
'OrganizationalUnitArn': arn
},
],
}
)
Running the above code I get the following error:
botocore.exceptions.ParamValidationError: Parameter validation failed:
Unknown parameter in LaunchPermission.Add[0]: "OrganizationalUnitArn", must be one of: Group, UserId
The ARN is supplied as a string, and the code itself was directly copied from the documentation. What's causing the error?
Solution 1:[1]
My local boto3 package was simply outdated, upgrading it fixed the problem.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | circo |
