@pulumi/aws-native
Version:
The Pulumi AWS Cloud Control Provider enables you to build, deploy, and manage [any AWS resource that's supported by the AWS Cloud Control API](https://github.com/pulumi/pulumi-aws-native/blob/master/provider/cmd/pulumi-gen-aws-native/supported-types.txt)
122 lines • 4.91 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.Rule = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Resource Type definition for AWS::Events::Rule
*
* ## Example Usage
* ### Example
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws_native from "@pulumi/aws-native";
*
* const eventBridgeIAMrole = new aws_native.iam.Role("eventBridgeIAMrole", {
* assumeRolePolicyDocument: {
* version: "2012-10-17",
* statement: [{
* effect: "Allow",
* principal: {
* service: "events.amazonaws.com",
* },
* action: "sts:AssumeRole",
* }],
* },
* path: "/",
* policies: [{
* policyName: "PutEventsDestinationBus",
* policyDocument: {
* version: "2012-10-17",
* statement: [{
* effect: "Allow",
* action: ["events:PutEvents"],
* resource: ["arn:aws:events:us-east-1:123456789012:event-bus/CrossRegionDestinationBus"],
* }],
* },
* }],
* });
* const eventRuleRegion1 = new aws_native.events.Rule("eventRuleRegion1", {
* description: "Routes to us-east-1 event bus",
* eventBusName: "MyBusName",
* state: aws_native.events.RuleState.Enabled,
* eventPattern: {
* source: ["MyTestApp"],
* detail: ["MyTestAppDetail"],
* },
* targets: [{
* arn: "arn:aws:events:us-east-1:123456789012:event-bus/CrossRegionDestinationBus",
* id: " CrossRegionDestinationBus",
* roleArn: eventBridgeIAMrole.arn,
* }],
* });
*
* ```
*/
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 opts Optional settings to control the behavior of the CustomResource.
*/
static get(name, id, opts) {
return new Rule(name, undefined, Object.assign(Object.assign({}, 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;
}
/**
* Create a Rule resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name, args, opts) {
let resourceInputs = {};
opts = opts || {};
if (!opts.id) {
resourceInputs["description"] = args ? args.description : undefined;
resourceInputs["eventBusName"] = args ? args.eventBusName : undefined;
resourceInputs["eventPattern"] = args ? args.eventPattern : undefined;
resourceInputs["name"] = args ? args.name : undefined;
resourceInputs["roleArn"] = args ? args.roleArn : undefined;
resourceInputs["scheduleExpression"] = args ? args.scheduleExpression : undefined;
resourceInputs["state"] = args ? args.state : undefined;
resourceInputs["targets"] = args ? args.targets : undefined;
resourceInputs["arn"] = undefined /*out*/;
}
else {
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["description"] = undefined /*out*/;
resourceInputs["eventBusName"] = undefined /*out*/;
resourceInputs["eventPattern"] = undefined /*out*/;
resourceInputs["name"] = undefined /*out*/;
resourceInputs["roleArn"] = undefined /*out*/;
resourceInputs["scheduleExpression"] = undefined /*out*/;
resourceInputs["state"] = undefined /*out*/;
resourceInputs["targets"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
const replaceOnChanges = { replaceOnChanges: ["name"] };
opts = pulumi.mergeOptions(opts, replaceOnChanges);
super(Rule.__pulumiType, name, resourceInputs, opts);
}
}
exports.Rule = Rule;
/** @internal */
Rule.__pulumiType = 'aws-native:events:Rule';
//# sourceMappingURL=rule.js.map