UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

125 lines (124 loc) 5.3 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Provides EC2 allowed images settings for an AWS account. This feature allows you to control which AMIs can be used to launch EC2 instances in your account based on specified criteria. * * For more information about the image criteria that can be set, see the [AWS documentation on Allowed AMIs JSON configuration](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-allowed-amis.html#allowed-amis-json-configuration). * * > **NOTE:** The AWS API does not delete this resource. When you run `destroy`, the provider will attempt to disable the setting. * * > **NOTE:** There is only one allowed images settings configuration per AWS account and region. Creating this resource will configure the account-level settings. * * ## Example Usage * * ### Enable with Amazon AMIs only * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.ec2.AllowedImagesSettings("example", { * state: "enabled", * imageCriterions: [{ * imageProviders: ["amazon"], * }], * }); * ``` * * ### Enable audit mode with specific account IDs * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.ec2.AllowedImagesSettings("example", { * state: "audit-mode", * imageCriterions: [{ * imageProviders: [ * "amazon", * "123456789012", * ], * }], * }); * ``` * * ## Import * * Using `pulumi import`, import EC2 allowed images settings. For example: * * ```sh * $ pulumi import aws:ec2/allowedImagesSettings:AllowedImagesSettings example us-east-1 * ``` */ export declare class AllowedImagesSettings extends pulumi.CustomResource { /** * Get an existing AllowedImagesSettings resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: AllowedImagesSettingsState, opts?: pulumi.CustomResourceOptions): AllowedImagesSettings; /** * Returns true if the given object is an instance of AllowedImagesSettings. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is AllowedImagesSettings; /** * List of image criteria. Maximum of 10 criterion blocks allowed. See `imageCriterion` below. */ readonly imageCriterions: pulumi.Output<outputs.ec2.AllowedImagesSettingsImageCriterion[] | undefined>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ readonly region: pulumi.Output<string>; /** * State of the allowed images settings. Valid values are `enabled` or `audit-mode`. */ readonly state: pulumi.Output<string>; /** * Create a AllowedImagesSettings resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: AllowedImagesSettingsArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering AllowedImagesSettings resources. */ export interface AllowedImagesSettingsState { /** * List of image criteria. Maximum of 10 criterion blocks allowed. See `imageCriterion` below. */ imageCriterions?: pulumi.Input<pulumi.Input<inputs.ec2.AllowedImagesSettingsImageCriterion>[]>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<string>; /** * State of the allowed images settings. Valid values are `enabled` or `audit-mode`. */ state?: pulumi.Input<string>; } /** * The set of arguments for constructing a AllowedImagesSettings resource. */ export interface AllowedImagesSettingsArgs { /** * List of image criteria. Maximum of 10 criterion blocks allowed. See `imageCriterion` below. */ imageCriterions?: pulumi.Input<pulumi.Input<inputs.ec2.AllowedImagesSettingsImageCriterion>[]>; /** * Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration. */ region?: pulumi.Input<string>; /** * State of the allowed images settings. Valid values are `enabled` or `audit-mode`. */ state: pulumi.Input<string>; }