NotificationRule

class NotificationRule : KotlinCustomResource

Provides a CodeStar Notifications Rule.

Example Usage

package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.codecommit.Repository;
import com.pulumi.aws.codecommit.RepositoryArgs;
import com.pulumi.aws.sns.Topic;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
import com.pulumi.aws.sns.TopicPolicy;
import com.pulumi.aws.sns.TopicPolicyArgs;
import com.pulumi.aws.codestarnotifications.NotificationRule;
import com.pulumi.aws.codestarnotifications.NotificationRuleArgs;
import com.pulumi.aws.codestarnotifications.inputs.NotificationRuleTargetArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var code = new Repository("code", RepositoryArgs.builder()
.repositoryName("example-code-repo")
.build());
var notif = new Topic("notif");
final var notifAccess = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
.statements(GetPolicyDocumentStatementArgs.builder()
.actions("sns:Publish")
.principals(GetPolicyDocumentStatementPrincipalArgs.builder()
.type("Service")
.identifiers("codestar-notifications.amazonaws.com")
.build())
.resources(notif.arn())
.build())
.build());
var default_ = new TopicPolicy("default", TopicPolicyArgs.builder()
.arn(notif.arn())
.policy(notifAccess.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult).applyValue(notifAccess -> notifAccess.applyValue(getPolicyDocumentResult -> getPolicyDocumentResult.json())))
.build());
var commits = new NotificationRule("commits", NotificationRuleArgs.builder()
.detailType("BASIC")
.eventTypeIds("codecommit-repository-comments-on-commits")
.resource(code.arn())
.targets(NotificationRuleTargetArgs.builder()
.address(notif.arn())
.build())
.build());
}
}

Import

CodeStar notification rule can be imported using the ARN, e.g.,

$ pulumi import aws:codestarnotifications/notificationRule:NotificationRule foo arn:aws:codestar-notifications:us-west-1:0123456789:notificationrule/2cdc68a3-8f7c-4893-b6a5-45b362bd4f2b

Properties

Link copied to clipboard
val arn: Output<String>

The codestar notification rule ARN.

Link copied to clipboard
val detailType: Output<String>

The level of detail to include in the notifications for this resource. Possible values are BASIC and FULL.

Link copied to clipboard
val eventTypeIds: Output<List<String>>

A list of event types associated with this notification rule. For list of allowed events see here.

Link copied to clipboard
val id: Output<String>
Link copied to clipboard
val name: Output<String>

The name of notification rule.

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
val resource: Output<String>

The ARN of the resource to associate with the notification rule.

Link copied to clipboard
val status: Output<String>?

The status of the notification rule. Possible values are ENABLED and DISABLED, default is ENABLED.

Link copied to clipboard
val tags: Output<Map<String, String>>?

A map of tags to assign to the resource. .If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.

Link copied to clipboard
val tagsAll: Output<Map<String, String>>

A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Link copied to clipboard

Configuration blocks containing notification target information. Can be specified multiple times. At least one target must be specified on creation.

Link copied to clipboard
val urn: Output<String>