UNPKG

@pulumi/aws

Version:

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

138 lines 5.19 kB
"use strict"; // *** 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.Rule = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource for managing an AWS RBin Rule. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.rbin.Rule("example", { * description: "Example tag-level retention rule", * resourceType: "EBS_SNAPSHOT", * resourceTags: [{ * resourceTagKey: "tag_key", * resourceTagValue: "tag_value", * }], * retentionPeriod: { * retentionPeriodValue: 10, * retentionPeriodUnit: "DAYS", * }, * tags: { * test_tag_key: "test_tag_value", * }, * }); * ``` * * ### Region-Level Retention Rule * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.rbin.Rule("example", { * description: "Example region-level retention rule with exclusion tags", * resourceType: "EC2_IMAGE", * excludeResourceTags: [{ * resourceTagKey: "tag_key", * resourceTagValue: "tag_value", * }], * retentionPeriod: { * retentionPeriodValue: 10, * retentionPeriodUnit: "DAYS", * }, * tags: { * test_tag_key: "test_tag_value", * }, * }); * ``` * * ## Import * * Using `pulumi import`, import RBin Rule using the `id`. For example: * * ```sh * $ pulumi import aws:rbin/rule:Rule example examplerule * ``` */ class Rule extends pulumi.CustomResource { /** * Get an existing Rule 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 Rule(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Rule. 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'] === Rule.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["arn"] = state?.arn; resourceInputs["description"] = state?.description; resourceInputs["excludeResourceTags"] = state?.excludeResourceTags; resourceInputs["lockConfiguration"] = state?.lockConfiguration; resourceInputs["lockEndTime"] = state?.lockEndTime; resourceInputs["lockState"] = state?.lockState; resourceInputs["region"] = state?.region; resourceInputs["resourceTags"] = state?.resourceTags; resourceInputs["resourceType"] = state?.resourceType; resourceInputs["retentionPeriod"] = state?.retentionPeriod; resourceInputs["status"] = state?.status; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; } else { const args = argsOrState; if (args?.resourceType === undefined && !opts.urn) { throw new Error("Missing required property 'resourceType'"); } if (args?.retentionPeriod === undefined && !opts.urn) { throw new Error("Missing required property 'retentionPeriod'"); } resourceInputs["description"] = args?.description; resourceInputs["excludeResourceTags"] = args?.excludeResourceTags; resourceInputs["lockConfiguration"] = args?.lockConfiguration; resourceInputs["region"] = args?.region; resourceInputs["resourceTags"] = args?.resourceTags; resourceInputs["resourceType"] = args?.resourceType; resourceInputs["retentionPeriod"] = args?.retentionPeriod; resourceInputs["tags"] = args?.tags; resourceInputs["arn"] = undefined /*out*/; resourceInputs["lockEndTime"] = undefined /*out*/; resourceInputs["lockState"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Rule.__pulumiType, name, resourceInputs, opts); } } exports.Rule = Rule; /** @internal */ Rule.__pulumiType = 'aws:rbin/rule:Rule'; //# sourceMappingURL=rule.js.map