@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
94 lines • 3.54 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.Webhook = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides an Amplify Webhook resource.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.amplify.App("example", {name: "app"});
* const master = new aws.amplify.Branch("master", {
* appId: example.id,
* branchName: "master",
* });
* const masterWebhook = new aws.amplify.Webhook("master", {
* appId: example.id,
* branchName: master.branchName,
* description: "triggermaster",
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import Amplify webhook using a webhook ID. For example:
*
* ```sh
* $ pulumi import aws:amplify/webhook:Webhook master a26b22a0-748b-4b57-b9a0-ae7e601fe4b1
* ```
*/
class Webhook extends pulumi.CustomResource {
/**
* Get an existing Webhook 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 Webhook(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Webhook. 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'] === Webhook.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["appId"] = state?.appId;
resourceInputs["arn"] = state?.arn;
resourceInputs["branchName"] = state?.branchName;
resourceInputs["description"] = state?.description;
resourceInputs["region"] = state?.region;
resourceInputs["url"] = state?.url;
}
else {
const args = argsOrState;
if (args?.appId === undefined && !opts.urn) {
throw new Error("Missing required property 'appId'");
}
if (args?.branchName === undefined && !opts.urn) {
throw new Error("Missing required property 'branchName'");
}
resourceInputs["appId"] = args?.appId;
resourceInputs["branchName"] = args?.branchName;
resourceInputs["description"] = args?.description;
resourceInputs["region"] = args?.region;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["url"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Webhook.__pulumiType, name, resourceInputs, opts);
}
}
exports.Webhook = Webhook;
/** @internal */
Webhook.__pulumiType = 'aws:amplify/webhook:Webhook';
//# sourceMappingURL=webhook.js.map
;