Class NotificationRule
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.aws.codestarnotifications.NotificationRule
-
public class NotificationRule extends com.pulumi.resources.CustomResource
Provides a CodeStar Notifications Rule. ## Example Usage ```java package generated_program; import java.util.*; import java.io.*; import java.nio.*; import com.pulumi.*; 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.apply(getPolicyDocumentResult -> getPolicyDocumentResult).apply(notifAccess -> notifAccess.apply(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., ```sh $ pulumi import aws:codestarnotifications/notificationRule:NotificationRule foo arn:aws:codestar-notifications:us-west-1:0123456789:notificationrule/2cdc68a3-8f7c-4893-b6a5-45b362bd4f2b ```
-
-
Constructor Summary
Constructors Constructor Description NotificationRule(java.lang.String name)
NotificationRule(java.lang.String name, NotificationRuleArgs args)
NotificationRule(java.lang.String name, NotificationRuleArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description com.pulumi.core.Output<java.lang.String>
arn()
com.pulumi.core.Output<java.lang.String>
detailType()
com.pulumi.core.Output<java.util.List<java.lang.String>>
eventTypeIds()
static NotificationRule
get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, NotificationRuleState state, com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.lang.String>
name()
com.pulumi.core.Output<java.lang.String>
resource()
com.pulumi.core.Output<java.util.Optional<java.lang.String>>
status()
com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>>
tags()
com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>>
tagsAll()
com.pulumi.core.Output<java.util.Optional<java.util.List<NotificationRuleTarget>>>
targets()
-
-
-
Constructor Detail
-
NotificationRule
public NotificationRule(java.lang.String name)
- Parameters:
name
- The _unique_ name of the resulting resource.
-
NotificationRule
public NotificationRule(java.lang.String name, NotificationRuleArgs args)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.
-
NotificationRule
public NotificationRule(java.lang.String name, NotificationRuleArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)
- Parameters:
name
- The _unique_ name of the resulting resource.args
- The arguments to use to populate this resource's properties.options
- A bag of options that control this resource's behavior.
-
-
Method Detail
-
arn
public com.pulumi.core.Output<java.lang.String> arn()
- Returns:
- The codestar notification rule ARN.
-
detailType
public com.pulumi.core.Output<java.lang.String> detailType()
- Returns:
- The level of detail to include in the notifications for this resource. Possible values are `BASIC` and `FULL`.
-
eventTypeIds
public com.pulumi.core.Output<java.util.List<java.lang.String>> eventTypeIds()
- Returns:
- 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).
-
name
public com.pulumi.core.Output<java.lang.String> name()
- Returns:
- The name of notification rule.
-
resource
public com.pulumi.core.Output<java.lang.String> resource()
- Returns:
- The ARN of the resource to associate with the notification rule.
-
status
public com.pulumi.core.Output<java.util.Optional<java.lang.String>> status()
- Returns:
- The status of the notification rule. Possible values are `ENABLED` and `DISABLED`, default is `ENABLED`.
-
tags
public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.String>>> tags()
- Returns:
- 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.
-
tagsAll
public com.pulumi.core.Output<java.util.Map<java.lang.String,java.lang.String>> tagsAll()
- Returns:
- A map of tags assigned to the resource, including those inherited from the provider .
-
targets
public com.pulumi.core.Output<java.util.Optional<java.util.List<NotificationRuleTarget>>> targets()
- Returns:
- Configuration blocks containing notification target information. Can be specified multiple times. At least one target must be specified on creation.
-
get
public static NotificationRule get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable NotificationRuleState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name
- The _unique_ name of the resulting resource.id
- The _unique_ provider ID of the resource to lookup.state
-options
- Optional settings to control the behavior of the CustomResource.
-
-