codestarnotifications

package
v4.38.1 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2022 License: Apache-2.0 Imports: 7 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. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
	Tags pulumi.StringMapOutput `pulumi:"tags"`
	// A map of tags assigned to the resource, including those inherited from the provider .
	TagsAll pulumi.StringMapOutput `pulumi:"tagsAll"`
	// 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/v4/go/aws/codecommit"
"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/codestarnotifications"
"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/iam"
"github.com/pulumi/pulumi-aws/sdk/v4/go/aws/sns"
"github.com/pulumi/pulumi/sdk/v3/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
	})
}

```

## 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

```

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.

func (*NotificationRule) ElementType

func (*NotificationRule) ElementType() reflect.Type

func (*NotificationRule) ToNotificationRuleOutput

func (i *NotificationRule) ToNotificationRuleOutput() NotificationRuleOutput

func (*NotificationRule) ToNotificationRuleOutputWithContext

func (i *NotificationRule) ToNotificationRuleOutputWithContext(ctx context.Context) NotificationRuleOutput

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. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
	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 NotificationRuleArray

type NotificationRuleArray []NotificationRuleInput

func (NotificationRuleArray) ElementType

func (NotificationRuleArray) ElementType() reflect.Type

func (NotificationRuleArray) ToNotificationRuleArrayOutput

func (i NotificationRuleArray) ToNotificationRuleArrayOutput() NotificationRuleArrayOutput

func (NotificationRuleArray) ToNotificationRuleArrayOutputWithContext

func (i NotificationRuleArray) ToNotificationRuleArrayOutputWithContext(ctx context.Context) NotificationRuleArrayOutput

type NotificationRuleArrayInput

type NotificationRuleArrayInput interface {
	pulumi.Input

	ToNotificationRuleArrayOutput() NotificationRuleArrayOutput
	ToNotificationRuleArrayOutputWithContext(context.Context) NotificationRuleArrayOutput
}

NotificationRuleArrayInput is an input type that accepts NotificationRuleArray and NotificationRuleArrayOutput values. You can construct a concrete instance of `NotificationRuleArrayInput` via:

NotificationRuleArray{ NotificationRuleArgs{...} }

type NotificationRuleArrayOutput

type NotificationRuleArrayOutput struct{ *pulumi.OutputState }

func (NotificationRuleArrayOutput) ElementType

func (NotificationRuleArrayOutput) Index

func (NotificationRuleArrayOutput) ToNotificationRuleArrayOutput

func (o NotificationRuleArrayOutput) ToNotificationRuleArrayOutput() NotificationRuleArrayOutput

func (NotificationRuleArrayOutput) ToNotificationRuleArrayOutputWithContext

func (o NotificationRuleArrayOutput) ToNotificationRuleArrayOutputWithContext(ctx context.Context) NotificationRuleArrayOutput

type NotificationRuleInput

type NotificationRuleInput interface {
	pulumi.Input

	ToNotificationRuleOutput() NotificationRuleOutput
	ToNotificationRuleOutputWithContext(ctx context.Context) NotificationRuleOutput
}

type NotificationRuleMap

type NotificationRuleMap map[string]NotificationRuleInput

func (NotificationRuleMap) ElementType

func (NotificationRuleMap) ElementType() reflect.Type

func (NotificationRuleMap) ToNotificationRuleMapOutput

func (i NotificationRuleMap) ToNotificationRuleMapOutput() NotificationRuleMapOutput

func (NotificationRuleMap) ToNotificationRuleMapOutputWithContext

func (i NotificationRuleMap) ToNotificationRuleMapOutputWithContext(ctx context.Context) NotificationRuleMapOutput

type NotificationRuleMapInput

type NotificationRuleMapInput interface {
	pulumi.Input

	ToNotificationRuleMapOutput() NotificationRuleMapOutput
	ToNotificationRuleMapOutputWithContext(context.Context) NotificationRuleMapOutput
}

NotificationRuleMapInput is an input type that accepts NotificationRuleMap and NotificationRuleMapOutput values. You can construct a concrete instance of `NotificationRuleMapInput` via:

NotificationRuleMap{ "key": NotificationRuleArgs{...} }

type NotificationRuleMapOutput

type NotificationRuleMapOutput struct{ *pulumi.OutputState }

func (NotificationRuleMapOutput) ElementType

func (NotificationRuleMapOutput) ElementType() reflect.Type

func (NotificationRuleMapOutput) MapIndex

func (NotificationRuleMapOutput) ToNotificationRuleMapOutput

func (o NotificationRuleMapOutput) ToNotificationRuleMapOutput() NotificationRuleMapOutput

func (NotificationRuleMapOutput) ToNotificationRuleMapOutputWithContext

func (o NotificationRuleMapOutput) ToNotificationRuleMapOutputWithContext(ctx context.Context) NotificationRuleMapOutput

type NotificationRuleOutput

type NotificationRuleOutput struct{ *pulumi.OutputState }

func (NotificationRuleOutput) ElementType

func (NotificationRuleOutput) ElementType() reflect.Type

func (NotificationRuleOutput) ToNotificationRuleOutput

func (o NotificationRuleOutput) ToNotificationRuleOutput() NotificationRuleOutput

func (NotificationRuleOutput) ToNotificationRuleOutputWithContext

func (o NotificationRuleOutput) ToNotificationRuleOutputWithContext(ctx context.Context) NotificationRuleOutput

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. .If configured with a provider `defaultTags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
	Tags pulumi.StringMapInput
	// A map of tags assigned to the resource, including those inherited from the provider .
	TagsAll 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