@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
117 lines • 4.48 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.ProactiveEngagement = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource for managing a AWS Shield Proactive Engagement.
* Proactive engagement authorizes the Shield Response Team (SRT) to use email and phone to notify contacts about escalations to the SRT and to initiate proactive customer support.
*
* ## Example Usage
*
* ### Basic Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const exampleRole = new aws.iam.Role("example", {
* name: "example-role",
* assumeRolePolicy: JSON.stringify({
* Version: "2012-10-17",
* Statement: [{
* Sid: "",
* Effect: "Allow",
* Principal: {
* Service: "drt.shield.amazonaws.com",
* },
* Action: "sts:AssumeRole",
* }],
* }),
* });
* const exampleDrtAccessRoleArnAssociation = new aws.shield.DrtAccessRoleArnAssociation("example", {roleArn: exampleRole.arn});
* const example = new aws.shield.ProactiveEngagement("example", {
* enabled: true,
* emergencyContacts: [
* {
* contactNotes: "Notes",
* emailAddress: "contact1@example.com",
* phoneNumber: "+12358132134",
* },
* {
* contactNotes: "Notes 2",
* emailAddress: "contact2@example.com",
* phoneNumber: "+12358132134",
* },
* ],
* }, {
* dependsOn: [exampleDrtAccessRoleArnAssociation],
* });
* const exampleRolePolicyAttachment = new aws.iam.RolePolicyAttachment("example", {
* role: exampleRole.name,
* policyArn: "arn:aws:iam::aws:policy/service-role/AWSShieldDRTAccessPolicy",
* });
* const exampleProtectionGroup = new aws.shield.ProtectionGroup("example", {
* protectionGroupId: "example",
* aggregation: "MAX",
* pattern: "ALL",
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Shield proactive engagement using the AWS account ID. For example:
*
* ```sh
* $ pulumi import aws:shield/proactiveEngagement:ProactiveEngagement example 123456789012
* ```
*/
class ProactiveEngagement extends pulumi.CustomResource {
/**
* Get an existing ProactiveEngagement 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 ProactiveEngagement(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of ProactiveEngagement. 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'] === ProactiveEngagement.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["emergencyContacts"] = state?.emergencyContacts;
resourceInputs["enabled"] = state?.enabled;
}
else {
const args = argsOrState;
if (args?.enabled === undefined && !opts.urn) {
throw new Error("Missing required property 'enabled'");
}
resourceInputs["emergencyContacts"] = args?.emergencyContacts;
resourceInputs["enabled"] = args?.enabled;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(ProactiveEngagement.__pulumiType, name, resourceInputs, opts);
}
}
exports.ProactiveEngagement = ProactiveEngagement;
/** @internal */
ProactiveEngagement.__pulumiType = 'aws:shield/proactiveEngagement:ProactiveEngagement';
//# sourceMappingURL=proactiveEngagement.js.map
;