@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
93 lines • 3.82 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.Protection = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Enables AWS Shield Advanced for a specific AWS resource.
* The resource can be an Amazon CloudFront distribution, Elastic Load Balancing load balancer, AWS Global Accelerator accelerator, Elastic IP Address, or an Amazon Route 53 hosted zone.
*
* ## Example Usage
*
* ### Create protection
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const available = aws.getAvailabilityZones({});
* const current = aws.getRegion({});
* const currentGetCallerIdentity = aws.getCallerIdentity({});
* const example = new aws.ec2.Eip("example", {domain: "vpc"});
* const exampleProtection = new aws.shield.Protection("example", {
* name: "example",
* resourceArn: pulumi.all([current, currentGetCallerIdentity, example.id]).apply(([current, currentGetCallerIdentity, id]) => `arn:aws:ec2:${current.region}:${currentGetCallerIdentity.accountId}:eip-allocation/${id}`),
* tags: {
* Environment: "Dev",
* },
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Shield protection resources using specifying their ID. For example:
*
* ```sh
* $ pulumi import aws:shield/protection:Protection example ff9592dc-22f3-4e88-afa1-7b29fde9669a
* ```
*/
class Protection extends pulumi.CustomResource {
/**
* Get an existing Protection 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 Protection(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Protection. 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'] === Protection.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["name"] = state?.name;
resourceInputs["resourceArn"] = state?.resourceArn;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
}
else {
const args = argsOrState;
if (args?.resourceArn === undefined && !opts.urn) {
throw new Error("Missing required property 'resourceArn'");
}
resourceInputs["name"] = args?.name;
resourceInputs["resourceArn"] = args?.resourceArn;
resourceInputs["tags"] = args?.tags;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Protection.__pulumiType, name, resourceInputs, opts);
}
}
exports.Protection = Protection;
/** @internal */
Protection.__pulumiType = 'aws:shield/protection:Protection';
//# sourceMappingURL=protection.js.map
;