codestarnotifications

package
v2.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2020 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NotificationRule

type NotificationRule struct {
	pulumi.CustomResourceState

	// The codestar notification rule ARN.
	Arn pulumi.StringOutput `pulumi:"arn"`
	// The level of detail to include in the notifications for this resource. Possible values are `BASIC` and `FULL`.
	DetailType pulumi.StringOutput `pulumi:"detailType"`
	// 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.StringArrayOutput `pulumi:"eventTypeIds"`
	// The name of notification rule.
	Name pulumi.StringOutput `pulumi:"name"`
	// The ARN of the resource to associate with the notification rule.
	Resource pulumi.StringOutput `pulumi:"resource"`
	// The status of the notification rule. Possible values are `ENABLED` and `DISABLED`, default is `ENABLED`.
	Status pulumi.StringPtrOutput `pulumi:"status"`
	// A map of tags to assign to the resource.
	Tags pulumi.StringMapOutput `pulumi:"tags"`
	// Configuration blocks containing notification target information. Can be specified multiple times. At least one target must be specified on creation.
	Targets NotificationRuleTargetArrayOutput `pulumi:"targets"`
}

Provides a CodeStar Notifications Rule.

## Example Usage

```go package main

import (

"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/codecommit"
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/codestarnotifications"
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/iam"
"github.com/pulumi/pulumi-aws/sdk/v2/go/aws/sns"
"github.com/pulumi/pulumi/sdk/v2/go/pulumi"

)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		code, err := codecommit.NewRepository(ctx, "code", &codecommit.RepositoryArgs{
			RepositoryName: pulumi.String("example-code-repo"),
		})
		if err != nil {
			return err
		}
		notif, err := sns.NewTopic(ctx, "notif", nil)
		if err != nil {
			return err
		}
		_, err = sns.NewTopicPolicy(ctx, "_default", &sns.TopicPolicyArgs{
			Arn: notif.Arn,
			Policy: notifAccess.ApplyT(func(notifAccess iam.GetPolicyDocumentResult) (string, error) {
				return notifAccess.Json, nil
			}).(pulumi.StringOutput),
		})
		if err != nil {
			return err
		}
		_, err = codestarnotifications.NewNotificationRule(ctx, "commits", &codestarnotifications.NotificationRuleArgs{
			DetailType: pulumi.String("BASIC"),
			EventTypeIds: pulumi.StringArray{
				pulumi.String("codecommit-repository-comments-on-commits"),
			},
			Resource: code.Arn,
			Targets: codestarnotifications.NotificationRuleTargetArray{
				&codestarnotifications.NotificationRuleTargetArgs{
					Address: notif.Arn,
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}

```

func GetNotificationRule

func GetNotificationRule(ctx *pulumi.Context,
	name string, id pulumi.IDInput, state *NotificationRuleState, opts ...pulumi.ResourceOption) (*NotificationRule, error)

GetNotificationRule gets an existing NotificationRule resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).

func NewNotificationRule

func NewNotificationRule(ctx *pulumi.Context,
	name string, args *NotificationRuleArgs, opts ...pulumi.ResourceOption) (*NotificationRule, error)

NewNotificationRule registers a new resource with the given unique name, arguments, and options.

type NotificationRuleArgs

type NotificationRuleArgs struct {
	// The level of detail to include in the notifications for this resource. Possible values are `BASIC` and `FULL`.
	DetailType pulumi.StringInput
	// 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.StringArrayInput
	// The name of notification rule.
	Name pulumi.StringPtrInput
	// The ARN of the resource to associate with the notification rule.
	Resource pulumi.StringInput
	// The status of the notification rule. Possible values are `ENABLED` and `DISABLED`, default is `ENABLED`.
	Status pulumi.StringPtrInput
	// A map of tags to assign to the resource.
	Tags pulumi.StringMapInput
	// Configuration blocks containing notification target information. Can be specified multiple times. At least one target must be specified on creation.
	Targets NotificationRuleTargetArrayInput
}

The set of arguments for constructing a NotificationRule resource.

func (NotificationRuleArgs) ElementType

func (NotificationRuleArgs) ElementType() reflect.Type

type NotificationRuleState

type NotificationRuleState struct {
	// The codestar notification rule ARN.
	Arn pulumi.StringPtrInput
	// The level of detail to include in the notifications for this resource. Possible values are `BASIC` and `FULL`.
	DetailType pulumi.StringPtrInput
	// 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.StringArrayInput
	// The name of notification rule.
	Name pulumi.StringPtrInput
	// The ARN of the resource to associate with the notification rule.
	Resource pulumi.StringPtrInput
	// The status of the notification rule. Possible values are `ENABLED` and `DISABLED`, default is `ENABLED`.
	Status pulumi.StringPtrInput
	// A map of tags to assign to the resource.
	Tags pulumi.StringMapInput
	// Configuration blocks containing notification target information. Can be specified multiple times. At least one target must be specified on creation.
	Targets NotificationRuleTargetArrayInput
}

func (NotificationRuleState) ElementType

func (NotificationRuleState) ElementType() reflect.Type

type NotificationRuleTarget

type NotificationRuleTarget struct {
	// The ARN of notification rule target. For example, a SNS Topic ARN.
	Address string `pulumi:"address"`
	// The status of the notification rule. Possible values are `ENABLED` and `DISABLED`, default is `ENABLED`.
	Status *string `pulumi:"status"`
	// The type of the notification target. Default value is `SNS`.
	Type *string `pulumi:"type"`
}

type NotificationRuleTargetArgs

type NotificationRuleTargetArgs struct {
	// The ARN of notification rule target. For example, a SNS Topic ARN.
	Address pulumi.StringInput `pulumi:"address"`
	// The status of the notification rule. Possible values are `ENABLED` and `DISABLED`, default is `ENABLED`.
	Status pulumi.StringPtrInput `pulumi:"status"`
	// The type of the notification target. Default value is `SNS`.
	Type pulumi.StringPtrInput `pulumi:"type"`
}

func (NotificationRuleTargetArgs) ElementType

func (NotificationRuleTargetArgs) ElementType() reflect.Type

func (NotificationRuleTargetArgs) ToNotificationRuleTargetOutput

func (i NotificationRuleTargetArgs) ToNotificationRuleTargetOutput() NotificationRuleTargetOutput

func (NotificationRuleTargetArgs) ToNotificationRuleTargetOutputWithContext

func (i NotificationRuleTargetArgs) ToNotificationRuleTargetOutputWithContext(ctx context.Context) NotificationRuleTargetOutput

type NotificationRuleTargetArray

type NotificationRuleTargetArray []NotificationRuleTargetInput

func (NotificationRuleTargetArray) ElementType

func (NotificationRuleTargetArray) ToNotificationRuleTargetArrayOutput

func (i NotificationRuleTargetArray) ToNotificationRuleTargetArrayOutput() NotificationRuleTargetArrayOutput

func (NotificationRuleTargetArray) ToNotificationRuleTargetArrayOutputWithContext

func (i NotificationRuleTargetArray) ToNotificationRuleTargetArrayOutputWithContext(ctx context.Context) NotificationRuleTargetArrayOutput

type NotificationRuleTargetArrayInput

type NotificationRuleTargetArrayInput interface {
	pulumi.Input

	ToNotificationRuleTargetArrayOutput() NotificationRuleTargetArrayOutput
	ToNotificationRuleTargetArrayOutputWithContext(context.Context) NotificationRuleTargetArrayOutput
}

NotificationRuleTargetArrayInput is an input type that accepts NotificationRuleTargetArray and NotificationRuleTargetArrayOutput values. You can construct a concrete instance of `NotificationRuleTargetArrayInput` via:

NotificationRuleTargetArray{ NotificationRuleTargetArgs{...} }

type NotificationRuleTargetArrayOutput

type NotificationRuleTargetArrayOutput struct{ *pulumi.OutputState }

func (NotificationRuleTargetArrayOutput) ElementType

func (NotificationRuleTargetArrayOutput) Index

func (NotificationRuleTargetArrayOutput) ToNotificationRuleTargetArrayOutput

func (o NotificationRuleTargetArrayOutput) ToNotificationRuleTargetArrayOutput() NotificationRuleTargetArrayOutput

func (NotificationRuleTargetArrayOutput) ToNotificationRuleTargetArrayOutputWithContext

func (o NotificationRuleTargetArrayOutput) ToNotificationRuleTargetArrayOutputWithContext(ctx context.Context) NotificationRuleTargetArrayOutput

type NotificationRuleTargetInput

type NotificationRuleTargetInput interface {
	pulumi.Input

	ToNotificationRuleTargetOutput() NotificationRuleTargetOutput
	ToNotificationRuleTargetOutputWithContext(context.Context) NotificationRuleTargetOutput
}

NotificationRuleTargetInput is an input type that accepts NotificationRuleTargetArgs and NotificationRuleTargetOutput values. You can construct a concrete instance of `NotificationRuleTargetInput` via:

NotificationRuleTargetArgs{...}

type NotificationRuleTargetOutput

type NotificationRuleTargetOutput struct{ *pulumi.OutputState }

func (NotificationRuleTargetOutput) Address

The ARN of notification rule target. For example, a SNS Topic ARN.

func (NotificationRuleTargetOutput) ElementType

func (NotificationRuleTargetOutput) Status

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

func (NotificationRuleTargetOutput) ToNotificationRuleTargetOutput

func (o NotificationRuleTargetOutput) ToNotificationRuleTargetOutput() NotificationRuleTargetOutput

func (NotificationRuleTargetOutput) ToNotificationRuleTargetOutputWithContext

func (o NotificationRuleTargetOutput) ToNotificationRuleTargetOutputWithContext(ctx context.Context) NotificationRuleTargetOutput

func (NotificationRuleTargetOutput) Type

The type of the notification target. Default value is `SNS`.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL