EventStream class

> NOTE: This resource is deprecated. AWS End User Messaging event streams are being discontinued on October 30, 2026. After that date, this resource will no longer be available. For SMS/Voice event delivery, use aws.pinpoint.Smsvoicev2ConfigurationSet with an event destination.

Provides an End User Messaging Event Stream resource.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const app = new aws.pinpoint.App("app", {});
const testStream = new aws.kinesis.Stream("test_stream", {
    name: "pinpoint-kinesis-test",
    shardCount: 1,
});
const assumeRole = aws.iam.getPolicyDocument({
    statements: [{
        principals: [{
            type: "Service",
            identifiers: ["pinpoint.us-east-1.amazonaws.com"],
        }],
        effect: "Allow",
        actions: ["sts:AssumeRole"],
    }],
});
const testRole = new aws.iam.Role("test_role", {assumeRolePolicy: assumeRole.then(assumeRole => assumeRole.json)});
const stream = new aws.pinpoint.EventStream("stream", {
    applicationId: app.applicationId,
    destinationStreamArn: testStream.arn,
    roleArn: testRole.arn,
});
const testRolePolicy = aws.iam.getPolicyDocument({
    statements: [{
        effect: "Allow",
        actions: [
            "kinesis:PutRecords",
            "kinesis:DescribeStream",
        ],
        resources: ["arn:aws:kinesis:us-east-1:*:*/*"],
    }],
});
const testRolePolicyRolePolicy = new aws.iam.RolePolicy("test_role_policy", {
    name: "test_policy",
    role: testRole.id,
    policy: testRolePolicy.then(testRolePolicy => testRolePolicy.json),
});
import pulumi
import pulumi_aws as aws

app = aws.pinpoint.App("app")
test_stream = aws.kinesis.Stream("test_stream",
    name="pinpoint-kinesis-test",
    shard_count=1)
assume_role = aws.iam.get_policy_document(statements=[{
    "principals": [{
        "type": "Service",
        "identifiers": ["pinpoint.us-east-1.amazonaws.com"],
    }],
    "effect": "Allow",
    "actions": ["sts:AssumeRole"],
}])
test_role = aws.iam.Role("test_role", assume_role_policy=assume_role.json)
stream = aws.pinpoint.EventStream("stream",
    application_id=app.application_id,
    destination_stream_arn=test_stream.arn,
    role_arn=test_role.arn)
test_role_policy = aws.iam.get_policy_document(statements=[{
    "effect": "Allow",
    "actions": [
        "kinesis:PutRecords",
        "kinesis:DescribeStream",
    ],
    "resources": ["arn:aws:kinesis:us-east-1:*:*/*"],
}])
test_role_policy_role_policy = aws.iam.RolePolicy("test_role_policy",
    name="test_policy",
    role=test_role.id,
    policy=test_role_policy.json)
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() =>
{
    var app = new Aws.Pinpoint.App("app");

    var testStream = new Aws.Kinesis.Stream("test_stream", new()
    {
        Name = "pinpoint-kinesis-test",
        ShardCount = 1,
    });

    var assumeRole = Aws.Iam.GetPolicyDocument.Invoke(new()
    {
        Statements = new[]
        {
            new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
            {
                Principals = new[]
                {
                    new Aws.Iam.Inputs.GetPolicyDocumentStatementPrincipalInputArgs
                    {
                        Type = "Service",
                        Identifiers = new[]
                        {
                            "pinpoint.us-east-1.amazonaws.com",
                        },
                    },
                },
                Effect = "Allow",
                Actions = new[]
                {
                    "sts:AssumeRole",
                },
            },
        },
    });

    var testRole = new Aws.Iam.Role("test_role", new()
    {
        AssumeRolePolicy = assumeRole.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
    });

    var stream = new Aws.Pinpoint.EventStream("stream", new()
    {
        ApplicationId = app.ApplicationId,
        DestinationStreamArn = testStream.Arn,
        RoleArn = testRole.Arn,
    });

    var testRolePolicy = Aws.Iam.GetPolicyDocument.Invoke(new()
    {
        Statements = new[]
        {
            new Aws.Iam.Inputs.GetPolicyDocumentStatementInputArgs
            {
                Effect = "Allow",
                Actions = new[]
                {
                    "kinesis:PutRecords",
                    "kinesis:DescribeStream",
                },
                Resources = new[]
                {
                    "arn:aws:kinesis:us-east-1:*:*/*",
                },
            },
        },
    });

    var testRolePolicyRolePolicy = new Aws.Iam.RolePolicy("test_role_policy", new()
    {
        Name = "test_policy",
        Role = testRole.Id,
        Policy = testRolePolicy.Apply(getPolicyDocumentResult => getPolicyDocumentResult.Json),
    });

});
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/iam"
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/kinesis"
	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/pinpoint"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		app, err := pinpoint.NewApp(ctx, "app", nil)
		if err != nil {
			return err
		}
		testStream, err := kinesis.NewStream(ctx, "test_stream", &kinesis.StreamArgs{
			Name:       pulumi.String("pinpoint-kinesis-test"),
			ShardCount: pulumi.Int(1),
		})
		if err != nil {
			return err
		}
		assumeRole, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
			Statements: []iam.GetPolicyDocumentStatement{
				{
					Principals: []iam.GetPolicyDocumentStatementPrincipal{
						{
							Type: "Service",
							Identifiers: []string{
								"pinpoint.us-east-1.amazonaws.com",
							},
						},
					},
					Effect: pulumi.StringRef("Allow"),
					Actions: []string{
						"sts:AssumeRole",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		testRole, err := iam.NewRole(ctx, "test_role", &iam.RoleArgs{
			AssumeRolePolicy: pulumi.String(assumeRole.Json),
		})
		if err != nil {
			return err
		}
		_, err = pinpoint.NewEventStream(ctx, "stream", &pinpoint.EventStreamArgs{
			ApplicationId:        app.ApplicationId,
			DestinationStreamArn: testStream.Arn,
			RoleArn:              testRole.Arn,
		})
		if err != nil {
			return err
		}
		testRolePolicy, err := iam.GetPolicyDocument(ctx, &iam.GetPolicyDocumentArgs{
			Statements: []iam.GetPolicyDocumentStatement{
				{
					Effect: pulumi.StringRef("Allow"),
					Actions: []string{
						"kinesis:PutRecords",
						"kinesis:DescribeStream",
					},
					Resources: []string{
						"arn:aws:kinesis:us-east-1:*:*/*",
					},
				},
			},
		}, nil)
		if err != nil {
			return err
		}
		_, err = iam.NewRolePolicy(ctx, "test_role_policy", &iam.RolePolicyArgs{
			Name:   pulumi.String("test_policy"),
			Role:   testRole.ID().ToIDOutput().ToStringOutput(),
			Policy: pulumi.String(testRolePolicy.Json),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    aws = {
      source = "pulumi/aws"
    }
  }
}

data "aws_iam_getpolicydocument" "assumeRole" {
  statements {
    principals {
      type        = "Service"
      identifiers = ["pinpoint.us-east-1.amazonaws.com"]
    }
    effect  = "Allow"
    actions = ["sts:AssumeRole"]
  }
}
data "aws_iam_getpolicydocument" "testRolePolicy" {
  statements {
    effect    = "Allow"
    actions   = ["kinesis:PutRecords", "kinesis:DescribeStream"]
    resources = ["arn:aws:kinesis:us-east-1:*:*/*"]
  }
}

resource "aws_pinpoint_eventstream" "stream" {
  application_id         = aws_pinpoint_app.app.application_id
  destination_stream_arn = aws_kinesis_stream.test_stream.arn
  role_arn               = aws_iam_role.test_role.arn
}
resource "aws_pinpoint_app" "app" {
}
resource "aws_kinesis_stream" "test_stream" {
  name        = "pinpoint-kinesis-test"
  shard_count = 1
}
resource "aws_iam_role" "test_role" {
  assume_role_policy = data.aws_iam_getpolicydocument.assumeRole.json
}
resource "aws_iam_rolepolicy" "test_role_policy" {
  name   = "test_policy"
  role   = aws_iam_role.test_role.id
  policy = data.aws_iam_getpolicydocument.testRolePolicy.json
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.pinpoint.App;
import com.pulumi.aws.kinesis.Stream;
import com.pulumi.aws.kinesis.StreamArgs;
import com.pulumi.aws.iam.IamFunctions;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentArgs;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentStatementArgs;
import com.pulumi.aws.iam.inputs.GetPolicyDocumentStatementPrincipalArgs;
import com.pulumi.aws.iam.Role;
import com.pulumi.aws.iam.RoleArgs;
import com.pulumi.aws.pinpoint.EventStream;
import com.pulumi.aws.pinpoint.EventStreamArgs;
import com.pulumi.aws.iam.RolePolicy;
import com.pulumi.aws.iam.RolePolicyArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 app = new App("app");

        var testStream = new Stream("testStream", StreamArgs.builder()
            .name("pinpoint-kinesis-test")
            .shardCount(1)
            .build());

        final var assumeRole = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
            .statements(GetPolicyDocumentStatementArgs.builder()
                .principals(GetPolicyDocumentStatementPrincipalArgs.builder()
                    .type("Service")
                    .identifiers("pinpoint.us-east-1.amazonaws.com")
                    .build())
                .effect("Allow")
                .actions("sts:AssumeRole")
                .build())
            .build());

        var testRole = new Role("testRole", RoleArgs.builder()
            .assumeRolePolicy(assumeRole.json())
            .build());

        var stream = new EventStream("stream", EventStreamArgs.builder()
            .applicationId(app.applicationId())
            .destinationStreamArn(testStream.arn())
            .roleArn(testRole.arn())
            .build());

        final var testRolePolicy = IamFunctions.getPolicyDocument(GetPolicyDocumentArgs.builder()
            .statements(GetPolicyDocumentStatementArgs.builder()
                .effect("Allow")
                .actions(
                    "kinesis:PutRecords",
                    "kinesis:DescribeStream")
                .resources("arn:aws:kinesis:us-east-1:*:*/*")
                .build())
            .build());

        var testRolePolicyRolePolicy = new RolePolicy("testRolePolicyRolePolicy", RolePolicyArgs.builder()
            .name("test_policy")
            .role(testRole.id())
            .policy(testRolePolicy.json())
            .build());

    }
}
resources:
  stream:
    type: aws:pinpoint:EventStream
    properties:
      applicationId: ${app.applicationId}
      destinationStreamArn: ${testStream.arn}
      roleArn: ${testRole.arn}
  app:
    type: aws:pinpoint:App
  testStream:
    type: aws:kinesis:Stream
    name: test_stream
    properties:
      name: pinpoint-kinesis-test
      shardCount: 1
  testRole:
    type: aws:iam:Role
    name: test_role
    properties:
      assumeRolePolicy: ${assumeRole.json}
  testRolePolicyRolePolicy:
    type: aws:iam:RolePolicy
    name: test_role_policy
    properties:
      name: test_policy
      role: ${testRole.id}
      policy: ${testRolePolicy.json}
variables:
  assumeRole:
    fn::invoke:
      function: aws:iam:getPolicyDocument
      arguments:
        statements:
          - principals:
              - type: Service
                identifiers:
                  - pinpoint.us-east-1.amazonaws.com
            effect: Allow
            actions:
              - sts:AssumeRole
  testRolePolicy:
    fn::invoke:
      function: aws:iam:getPolicyDocument
      arguments:
        statements:
          - effect: Allow
            actions:
              - kinesis:PutRecords
              - kinesis:DescribeStream
            resources:
              - arn:aws:kinesis:us-east-1:*:*/*

Import

Using pulumi import, import End User Messaging Event Stream using the application-id. For example:

$ pulumi import aws:pinpoint/eventStream:EventStream stream application-id

Constructors

EventStream(String name, {EventStreamArgs? args, CustomResourceOptions? options})
Creates a new EventStream. name The Pulumi resource name. args Arguments used to configure this EventStream. The set of arguments for EventStream. options Resource options controlling this resource's behavior.
EventStream.reference(String urn)
Creates a typed reference to an existing EventStream resource.

Properties

applicationId ↔ Output<String>
Application ID.
latefinal
childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
destinationStreamArn ↔ Output<String>
ARN of the Amazon Kinesis stream or Firehose delivery stream to which you want to publish events.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
region ↔ Output<String>
Region where this resource will be managed. Defaults to the Region set in the provider configuration.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
roleArn ↔ Output<String>
IAM role that authorizes AWS End User Messaging to publish events to the stream in your account.
latefinal
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {EventStreamState? state, CustomResourceOptions? options}) → EventStream
Gets an existing EventStream resource's state with the given name and id.