@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
106 lines • 4.21 kB
JavaScript
;
// *** WARNING: this file was generated by pulumi-language-nodejs. ***
// *** Do not edit by hand unless you're certain you know what you are doing! ***
Object.defineProperty(exports, "__esModule", { value: true });
exports.AllowedImagesSettings = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* 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
* ```
*/
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, id, state, opts) {
return new AllowedImagesSettings(name, state, { ...opts, id: id });
}
/**
* 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) {
if (obj === undefined || obj === null) {
return false;
}
return obj['__pulumiType'] === AllowedImagesSettings.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["imageCriterions"] = state?.imageCriterions;
resourceInputs["region"] = state?.region;
resourceInputs["state"] = state?.state;
}
else {
const args = argsOrState;
if (args?.state === undefined && !opts.urn) {
throw new Error("Missing required property 'state'");
}
resourceInputs["imageCriterions"] = args?.imageCriterions;
resourceInputs["region"] = args?.region;
resourceInputs["state"] = args?.state;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(AllowedImagesSettings.__pulumiType, name, resourceInputs, opts);
}
}
exports.AllowedImagesSettings = AllowedImagesSettings;
/** @internal */
AllowedImagesSettings.__pulumiType = 'aws:ec2/allowedImagesSettings:AllowedImagesSettings';
//# sourceMappingURL=allowedImagesSettings.js.map