@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
102 lines • 3.77 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.Enabler = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for enabling Amazon Inspector resource scans.
*
* This resource must be created in the Organization's Administrator Account.
*
* ## Example Usage
*
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.inspector2.Enabler("example", {
* accountIds: ["123456789012"],
* resourceTypes: ["EC2"],
* });
* ```
*
* ### For the Calling Account
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const current = aws.getCallerIdentity({});
* const test = new aws.inspector2.Enabler("test", {
* accountIds: [current.then(current => current.accountId)],
* resourceTypes: [
* "ECR",
* "EC2",
* ],
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Inspector Enabler using using `account_ids` and `region_types` formatted as `[account_id1]:[account_id2]:...-[resource_type1]:[resource_type2]:...`, where `account_ids` are sorted in ascending order and `resource_types` are sorted in alphabetical order. For example:
*
* ```sh
* $ pulumi import aws:inspector2/enabler:Enabler example 123456789012:234567890123-EC2:ECR
* ```
*/
class Enabler extends pulumi.CustomResource {
/**
* Get an existing Enabler 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 Enabler(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Enabler. 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'] === Enabler.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["accountIds"] = state?.accountIds;
resourceInputs["region"] = state?.region;
resourceInputs["resourceTypes"] = state?.resourceTypes;
}
else {
const args = argsOrState;
if (args?.accountIds === undefined && !opts.urn) {
throw new Error("Missing required property 'accountIds'");
}
if (args?.resourceTypes === undefined && !opts.urn) {
throw new Error("Missing required property 'resourceTypes'");
}
resourceInputs["accountIds"] = args?.accountIds;
resourceInputs["region"] = args?.region;
resourceInputs["resourceTypes"] = args?.resourceTypes;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Enabler.__pulumiType, name, resourceInputs, opts);
}
}
exports.Enabler = Enabler;
/** @internal */
Enabler.__pulumiType = 'aws:inspector2/enabler:Enabler';
//# sourceMappingURL=enabler.js.map
;