UNPKG

@pulumi/aws

Version:

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

82 lines 3.82 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.ApplicationLayerAutomaticResponse = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Resource for managing an AWS Shield Application Layer Automatic Response for automatic DDoS mitigation. * * ## Example Usage * * ### Basic Usage * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const current = aws.getRegion({}); * const currentGetCallerIdentity = aws.getCallerIdentity({}); * const currentGetPartition = aws.getPartition({}); * const config = new pulumi.Config(); * // The Cloudfront Distribution on which to enable the Application Layer Automatic Response. * const distributionId = config.require("distributionId"); * const example = new aws.shield.ApplicationLayerAutomaticResponse("example", { * resourceArn: Promise.all([currentGetPartition, currentGetCallerIdentity]).then(([currentGetPartition, currentGetCallerIdentity]) => `arn:${currentGetPartition.partition}:cloudfront:${currentGetCallerIdentity.accountId}:distribution/${distributionId}`), * action: "COUNT", * }); * ``` */ class ApplicationLayerAutomaticResponse extends pulumi.CustomResource { /** * Get an existing ApplicationLayerAutomaticResponse 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 ApplicationLayerAutomaticResponse(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of ApplicationLayerAutomaticResponse. 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'] === ApplicationLayerAutomaticResponse.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["action"] = state?.action; resourceInputs["resourceArn"] = state?.resourceArn; resourceInputs["timeouts"] = state?.timeouts; } else { const args = argsOrState; if (args?.action === undefined && !opts.urn) { throw new Error("Missing required property 'action'"); } if (args?.resourceArn === undefined && !opts.urn) { throw new Error("Missing required property 'resourceArn'"); } resourceInputs["action"] = args?.action; resourceInputs["resourceArn"] = args?.resourceArn; resourceInputs["timeouts"] = args?.timeouts; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(ApplicationLayerAutomaticResponse.__pulumiType, name, resourceInputs, opts); } } exports.ApplicationLayerAutomaticResponse = ApplicationLayerAutomaticResponse; /** @internal */ ApplicationLayerAutomaticResponse.__pulumiType = 'aws:shield/applicationLayerAutomaticResponse:ApplicationLayerAutomaticResponse'; //# sourceMappingURL=applicationLayerAutomaticResponse.js.map