@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
133 lines • 4.58 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.ResourceCollection = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for managing an AWS DevOps Guru Resource Collection.
*
* > Only one type of resource collection (All Account Resources, CloudFormation, or Tags) can be enabled in an account at a time. To avoid persistent differences, this resource should be defined only once.
*
* ## Example Usage
*
* ### All Account Resources
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.devopsguru.ResourceCollection("example", {
* type: "AWS_SERVICE",
* cloudformation: {
* stackNames: ["*"],
* },
* });
* ```
*
* ### CloudFormation Stacks
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.devopsguru.ResourceCollection("example", {
* type: "AWS_CLOUD_FORMATION",
* cloudformation: {
* stackNames: ["ExampleStack"],
* },
* });
* ```
*
* ### Tags
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.devopsguru.ResourceCollection("example", {
* type: "AWS_TAGS",
* tags: {
* appBoundaryKey: "DevOps-Guru-Example",
* tagValues: ["Example-Value"],
* },
* });
* ```
*
* ### Tags All Resources
*
* To analyze all resources with the `appBoundaryKey` regardless of the corresponding tag value, set `tagValues` to `["*"]`.
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.devopsguru.ResourceCollection("example", {
* type: "AWS_TAGS",
* tags: {
* appBoundaryKey: "DevOps-Guru-Example",
* tagValues: ["*"],
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import DevOps Guru Resource Collection using the `id`. For example:
*
* ```sh
* $ pulumi import aws:devopsguru/resourceCollection:ResourceCollection example AWS_CLOUD_FORMATION
* ```
*/
class ResourceCollection extends pulumi.CustomResource {
/**
* Get an existing ResourceCollection 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 ResourceCollection(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ResourceCollection. 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'] === ResourceCollection.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["cloudformation"] = state?.cloudformation;
resourceInputs["region"] = state?.region;
resourceInputs["tags"] = state?.tags;
resourceInputs["type"] = state?.type;
}
else {
const args = argsOrState;
if (args?.type === undefined && !opts.urn) {
throw new Error("Missing required property 'type'");
}
resourceInputs["cloudformation"] = args?.cloudformation;
resourceInputs["region"] = args?.region;
resourceInputs["tags"] = args?.tags;
resourceInputs["type"] = args?.type;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ResourceCollection.__pulumiType, name, resourceInputs, opts);
}
}
exports.ResourceCollection = ResourceCollection;
/** @internal */
ResourceCollection.__pulumiType = 'aws:devopsguru/resourceCollection:ResourceCollection';
//# sourceMappingURL=resourceCollection.js.map
;