@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
208 lines (207 loc) • 8.78 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* Provides a CodeStar Notifications Rule.
*
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const code = new aws.codecommit.Repository("code", {repositoryName: "example-code-repo"});
* const notif = new aws.sns.Topic("notif", {name: "notification"});
* const notifAccess = aws.iam.getPolicyDocumentOutput({
* statements: [{
* actions: ["sns:Publish"],
* principals: [{
* type: "Service",
* identifiers: ["codestar-notifications.amazonaws.com"],
* }],
* resources: [notif.arn],
* }],
* });
* const _default = new aws.sns.TopicPolicy("default", {
* arn: notif.arn,
* policy: notifAccess.apply(notifAccess => notifAccess.json),
* });
* const commits = new aws.codestarnotifications.NotificationRule("commits", {
* detailType: "BASIC",
* eventTypeIds: ["codecommit-repository-comments-on-commits"],
* name: "example-code-repo-commits",
* resource: code.arn,
* targets: [{
* address: notif.arn,
* }],
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import CodeStar notification rule using the ARN. For example:
*
* ```sh
* $ pulumi import aws:codestarnotifications/notificationRule:NotificationRule foo arn:aws:codestar-notifications:us-west-1:0123456789:notificationrule/2cdc68a3-8f7c-4893-b6a5-45b362bd4f2b
* ```
*/
export declare class NotificationRule extends pulumi.CustomResource {
/**
* Get an existing NotificationRule 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: string, id: pulumi.Input<pulumi.ID>, state?: NotificationRuleState, opts?: pulumi.CustomResourceOptions): NotificationRule;
/**
* Returns true if the given object is an instance of NotificationRule. This is designed to work even
* when multiple copies of the Pulumi SDK have been loaded into the same process.
*/
static isInstance(obj: any): obj is NotificationRule;
/**
* The codestar notification rule ARN.
*/
readonly arn: pulumi.Output<string>;
/**
* The level of detail to include in the notifications for this resource. Possible values are `BASIC` and `FULL`.
*/
readonly detailType: pulumi.Output<string>;
/**
* A list of event types associated with this notification rule.
* For list of allowed events see [here](https://docs.aws.amazon.com/codestar-notifications/latest/userguide/concepts.html#concepts-api).
*/
readonly eventTypeIds: pulumi.Output<string[]>;
/**
* The name of notification rule.
*/
readonly name: pulumi.Output<string>;
/**
* Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
*/
readonly region: pulumi.Output<string>;
/**
* The ARN of the resource to associate with the notification rule.
*/
readonly resource: pulumi.Output<string>;
/**
* The status of the notification rule. Possible values are `ENABLED` and `DISABLED`, default is `ENABLED`.
*/
readonly status: pulumi.Output<string | undefined>;
/**
* A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*/
readonly tags: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
*/
readonly tagsAll: pulumi.Output<{
[key: string]: string;
}>;
/**
* Configuration blocks containing notification target information. Can be specified multiple times. At least one target must be specified on creation.
*/
readonly targets: pulumi.Output<outputs.codestarnotifications.NotificationRuleTarget[] | undefined>;
/**
* Create a NotificationRule 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: string, args: NotificationRuleArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering NotificationRule resources.
*/
export interface NotificationRuleState {
/**
* The codestar notification rule ARN.
*/
arn?: pulumi.Input<string>;
/**
* The level of detail to include in the notifications for this resource. Possible values are `BASIC` and `FULL`.
*/
detailType?: pulumi.Input<string>;
/**
* A list of event types associated with this notification rule.
* For list of allowed events see [here](https://docs.aws.amazon.com/codestar-notifications/latest/userguide/concepts.html#concepts-api).
*/
eventTypeIds?: pulumi.Input<pulumi.Input<string>[]>;
/**
* The name of notification rule.
*/
name?: pulumi.Input<string>;
/**
* Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
*/
region?: pulumi.Input<string>;
/**
* The ARN of the resource to associate with the notification rule.
*/
resource?: pulumi.Input<string>;
/**
* The status of the notification rule. Possible values are `ENABLED` and `DISABLED`, default is `ENABLED`.
*/
status?: pulumi.Input<string>;
/**
* A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* A map of tags assigned to the resource, including those inherited from the provider `defaultTags` configuration block.
*/
tagsAll?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Configuration blocks containing notification target information. Can be specified multiple times. At least one target must be specified on creation.
*/
targets?: pulumi.Input<pulumi.Input<inputs.codestarnotifications.NotificationRuleTarget>[]>;
}
/**
* The set of arguments for constructing a NotificationRule resource.
*/
export interface NotificationRuleArgs {
/**
* The level of detail to include in the notifications for this resource. Possible values are `BASIC` and `FULL`.
*/
detailType: pulumi.Input<string>;
/**
* A list of event types associated with this notification rule.
* For list of allowed events see [here](https://docs.aws.amazon.com/codestar-notifications/latest/userguide/concepts.html#concepts-api).
*/
eventTypeIds: pulumi.Input<pulumi.Input<string>[]>;
/**
* The name of notification rule.
*/
name?: pulumi.Input<string>;
/**
* Region where this resource will be [managed](https://docs.aws.amazon.com/general/latest/gr/rande.html#regional-endpoints). Defaults to the Region set in the provider configuration.
*/
region?: pulumi.Input<string>;
/**
* The ARN of the resource to associate with the notification rule.
*/
resource: pulumi.Input<string>;
/**
* The status of the notification rule. Possible values are `ENABLED` and `DISABLED`, default is `ENABLED`.
*/
status?: pulumi.Input<string>;
/**
* A map of tags to assign to the resource. If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
*/
tags?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* Configuration blocks containing notification target information. Can be specified multiple times. At least one target must be specified on creation.
*/
targets?: pulumi.Input<pulumi.Input<inputs.codestarnotifications.NotificationRuleTarget>[]>;
}