- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
GetAllowedImagesSettingsCommand
Gets the current state of the Allowed AMIs setting and the list of Allowed AMIs criteria at the account level in the specified Region.
The Allowed AMIs feature does not restrict the AMIs owned by your account. Regardless of the criteria you set, the AMIs created by your account will always be discoverable and usable by users in your account.
For more information, see Control the discovery and use of AMIs in Amazon EC2 with Allowed AMIs in Amazon EC2 User Guide.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { EC2Client, GetAllowedImagesSettingsCommand } from "@aws-sdk/client-ec2"; // ES Modules import
// const { EC2Client, GetAllowedImagesSettingsCommand } = require("@aws-sdk/client-ec2"); // CommonJS import
const client = new EC2Client(config);
const input = { // GetAllowedImagesSettingsRequest
DryRun: true || false,
};
const command = new GetAllowedImagesSettingsCommand(input);
const response = await client.send(command);
// { // GetAllowedImagesSettingsResult
// State: "STRING_VALUE",
// ImageCriteria: [ // ImageCriterionList
// { // ImageCriterion
// ImageProviders: [ // ImageProviderList
// "STRING_VALUE",
// ],
// },
// ],
// ManagedBy: "account" || "declarative-policy",
// };
GetAllowedImagesSettingsCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
DryRun | boolean | undefined | Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is |
GetAllowedImagesSettingsCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
ImageCriteria | ImageCriterion[] | undefined | The list of criteria for images that are discoverable and usable in the account in the specified Amazon Web Services Region. |
ManagedBy | ManagedBy | undefined | The entity that manages the Allowed AMIs settings. Possible values include:
|
State | string | undefined | The current state of the Allowed AMIs setting at the account level in the specified Amazon Web Services Region. Possible values:
|
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
EC2ServiceException | Base exception class for all service exceptions from EC2 service. |