@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
103 lines • 3.97 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.ArchiveRule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for managing an AWS AccessAnalyzer Archive Rule.
*
* ## Example Usage
*
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.accessanalyzer.ArchiveRule("example", {
* analyzerName: "example-analyzer",
* ruleName: "example-rule",
* filters: [
* {
* criteria: "condition.aws:UserId",
* eqs: ["userid"],
* },
* {
* criteria: "error",
* exists: "true",
* },
* {
* criteria: "isPublic",
* eqs: ["false"],
* },
* ],
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import AccessAnalyzer ArchiveRule using the `analyzer_name/rule_name`. For example:
*
* ```sh
* $ pulumi import aws:accessanalyzer/archiveRule:ArchiveRule example example-analyzer/example-rule
* ```
*/
class ArchiveRule extends pulumi.CustomResource {
/**
* Get an existing ArchiveRule 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 ArchiveRule(name, state, Object.assign(Object.assign({}, opts), { id: id }));
}
/**
* Returns true if the given object is an instance of ArchiveRule. 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'] === ArchiveRule.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["analyzerName"] = state ? state.analyzerName : undefined;
resourceInputs["filters"] = state ? state.filters : undefined;
resourceInputs["region"] = state ? state.region : undefined;
resourceInputs["ruleName"] = state ? state.ruleName : undefined;
}
else {
const args = argsOrState;
if ((!args || args.analyzerName === undefined) && !opts.urn) {
throw new Error("Missing required property 'analyzerName'");
}
if ((!args || args.filters === undefined) && !opts.urn) {
throw new Error("Missing required property 'filters'");
}
if ((!args || args.ruleName === undefined) && !opts.urn) {
throw new Error("Missing required property 'ruleName'");
}
resourceInputs["analyzerName"] = args ? args.analyzerName : undefined;
resourceInputs["filters"] = args ? args.filters : undefined;
resourceInputs["region"] = args ? args.region : undefined;
resourceInputs["ruleName"] = args ? args.ruleName : undefined;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ArchiveRule.__pulumiType, name, resourceInputs, opts);
}
}
exports.ArchiveRule = ArchiveRule;
/** @internal */
ArchiveRule.__pulumiType = 'aws:accessanalyzer/archiveRule:ArchiveRule';
//# sourceMappingURL=archiveRule.js.map