AWS Classic

Pulumi Official
Package maintained by Pulumi
v5.10.0 published on Monday, Jul 11, 2022 by Pulumi

EventStream

Provides a Pinpoint Event Stream resource.

Example Usage

using Pulumi;
using Aws = Pulumi.Aws;

class MyStack : Stack
{
    public MyStack()
    {
        var app = new Aws.Pinpoint.App("app", new Aws.Pinpoint.AppArgs
        {
        });
        var testStream = new Aws.Kinesis.Stream("testStream", new Aws.Kinesis.StreamArgs
        {
            ShardCount = 1,
        });
        var testRole = new Aws.Iam.Role("testRole", new Aws.Iam.RoleArgs
        {
            AssumeRolePolicy = @"{
  ""Version"": ""2012-10-17"",
  ""Statement"": [
    {
      ""Action"": ""sts:AssumeRole"",
      ""Principal"": {
        ""Service"": ""pinpoint.us-east-1.amazonaws.com""
      },
      ""Effect"": ""Allow"",
      ""Sid"": """"
    }
  ]
}
",
        });
        var stream = new Aws.Pinpoint.EventStream("stream", new Aws.Pinpoint.EventStreamArgs
        {
            ApplicationId = app.ApplicationId,
            DestinationStreamArn = testStream.Arn,
            RoleArn = testRole.Arn,
        });
        var testRolePolicy = new Aws.Iam.RolePolicy("testRolePolicy", new Aws.Iam.RolePolicyArgs
        {
            Role = testRole.Id,
            Policy = @"{
  ""Version"": ""2012-10-17"",
  ""Statement"": {
    ""Action"": [
      ""kinesis:PutRecords"",
      ""kinesis:DescribeStream""
    ],
    ""Effect"": ""Allow"",
    ""Resource"": [
      ""arn:aws:kinesis:us-east-1:*:*/*""
    ]
  }
}
",
        });
    }

}
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/iam"
	"github.com/pulumi/pulumi-aws/sdk/v5/go/aws/kinesis"
	"github.com/pulumi/pulumi-aws/sdk/v5/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, "testStream", &kinesis.StreamArgs{
			ShardCount: pulumi.Int(1),
		})
		if err != nil {
			return err
		}
		testRole, err := iam.NewRole(ctx, "testRole", &iam.RoleArgs{
			AssumeRolePolicy: pulumi.Any(fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v%v%v%v", "{\n", "  \"Version\": \"2012-10-17\",\n", "  \"Statement\": [\n", "    {\n", "      \"Action\": \"sts:AssumeRole\",\n", "      \"Principal\": {\n", "        \"Service\": \"pinpoint.us-east-1.amazonaws.com\"\n", "      },\n", "      \"Effect\": \"Allow\",\n", "      \"Sid\": \"\"\n", "    }\n", "  ]\n", "}\n")),
		})
		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
		}
		_, err = iam.NewRolePolicy(ctx, "testRolePolicy", &iam.RolePolicyArgs{
			Role:   testRole.ID(),
			Policy: pulumi.Any(fmt.Sprintf("%v%v%v%v%v%v%v%v%v%v%v%v%v", "{\n", "  \"Version\": \"2012-10-17\",\n", "  \"Statement\": {\n", "    \"Action\": [\n", "      \"kinesis:PutRecords\",\n", "      \"kinesis:DescribeStream\"\n", "    ],\n", "    \"Effect\": \"Allow\",\n", "    \"Resource\": [\n", "      \"arn:aws:kinesis:us-east-1:*:*/*\"\n", "    ]\n", "  }\n", "}\n")),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
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 app = new App("app");

        var testStream = new Stream("testStream", StreamArgs.builder()        
            .shardCount(1)
            .build());

        var testRole = new Role("testRole", RoleArgs.builder()        
            .assumeRolePolicy("""
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": "sts:AssumeRole",
      "Principal": {
        "Service": "pinpoint.us-east-1.amazonaws.com"
      },
      "Effect": "Allow",
      "Sid": ""
    }
  ]
}
            """)
            .build());

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

        var testRolePolicy = new RolePolicy("testRolePolicy", RolePolicyArgs.builder()        
            .role(testRole.id())
            .policy("""
{
  "Version": "2012-10-17",
  "Statement": {
    "Action": [
      "kinesis:PutRecords",
      "kinesis:DescribeStream"
    ],
    "Effect": "Allow",
    "Resource": [
      "arn:aws:kinesis:us-east-1:*:*/*"
    ]
  }
}
            """)
            .build());

    }
}
import pulumi
import pulumi_aws as aws

app = aws.pinpoint.App("app")
test_stream = aws.kinesis.Stream("testStream", shard_count=1)
test_role = aws.iam.Role("testRole", assume_role_policy="""{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": "sts:AssumeRole",
      "Principal": {
        "Service": "pinpoint.us-east-1.amazonaws.com"
      },
      "Effect": "Allow",
      "Sid": ""
    }
  ]
}
""")
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.RolePolicy("testRolePolicy",
    role=test_role.id,
    policy="""{
  "Version": "2012-10-17",
  "Statement": {
    "Action": [
      "kinesis:PutRecords",
      "kinesis:DescribeStream"
    ],
    "Effect": "Allow",
    "Resource": [
      "arn:aws:kinesis:us-east-1:*:*/*"
    ]
  }
}
""")
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("testStream", {shardCount: 1});
const testRole = new aws.iam.Role("testRole", {assumeRolePolicy: `{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": "sts:AssumeRole",
      "Principal": {
        "Service": "pinpoint.us-east-1.amazonaws.com"
      },
      "Effect": "Allow",
      "Sid": ""
    }
  ]
}
`});
const stream = new aws.pinpoint.EventStream("stream", {
    applicationId: app.applicationId,
    destinationStreamArn: testStream.arn,
    roleArn: testRole.arn,
});
const testRolePolicy = new aws.iam.RolePolicy("testRolePolicy", {
    role: testRole.id,
    policy: `{
  "Version": "2012-10-17",
  "Statement": {
    "Action": [
      "kinesis:PutRecords",
      "kinesis:DescribeStream"
    ],
    "Effect": "Allow",
    "Resource": [
      "arn:aws:kinesis:us-east-1:*:*/*"
    ]
  }
}
`,
});
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
    properties:
      shardCount: 1
  testRole:
    type: aws:iam:Role
    properties:
      assumeRolePolicy: |
        {
          "Version": "2012-10-17",
          "Statement": [
            {
              "Action": "sts:AssumeRole",
              "Principal": {
                "Service": "pinpoint.us-east-1.amazonaws.com"
              },
              "Effect": "Allow",
              "Sid": ""
            }
          ]
        }        
  testRolePolicy:
    type: aws:iam:RolePolicy
    properties:
      role: ${testRole.id}
      policy: |
        {
          "Version": "2012-10-17",
          "Statement": {
            "Action": [
              "kinesis:PutRecords",
              "kinesis:DescribeStream"
            ],
            "Effect": "Allow",
            "Resource": [
              "arn:aws:kinesis:us-east-1:*:*/*"
            ]
          }
        }        

Create a EventStream Resource

new EventStream(name: string, args: EventStreamArgs, opts?: CustomResourceOptions);
@overload
def EventStream(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                application_id: Optional[str] = None,
                destination_stream_arn: Optional[str] = None,
                role_arn: Optional[str] = None)
@overload
def EventStream(resource_name: str,
                args: EventStreamArgs,
                opts: Optional[ResourceOptions] = None)
func NewEventStream(ctx *Context, name string, args EventStreamArgs, opts ...ResourceOption) (*EventStream, error)
public EventStream(string name, EventStreamArgs args, CustomResourceOptions? opts = null)
public EventStream(String name, EventStreamArgs args)
public EventStream(String name, EventStreamArgs args, CustomResourceOptions options)
type: aws:pinpoint:EventStream
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args EventStreamArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args EventStreamArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args EventStreamArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args EventStreamArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args EventStreamArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

EventStream Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The EventStream resource accepts the following input properties:

ApplicationId string

The application ID.

DestinationStreamArn string

The Amazon Resource Name (ARN) of the Amazon Kinesis stream or Firehose delivery stream to which you want to publish events.

RoleArn string

The IAM role that authorizes Amazon Pinpoint to publish events to the stream in your account.

ApplicationId string

The application ID.

DestinationStreamArn string

The Amazon Resource Name (ARN) of the Amazon Kinesis stream or Firehose delivery stream to which you want to publish events.

RoleArn string

The IAM role that authorizes Amazon Pinpoint to publish events to the stream in your account.

applicationId String

The application ID.

destinationStreamArn String

The Amazon Resource Name (ARN) of the Amazon Kinesis stream or Firehose delivery stream to which you want to publish events.

roleArn String

The IAM role that authorizes Amazon Pinpoint to publish events to the stream in your account.

applicationId string

The application ID.

destinationStreamArn string

The Amazon Resource Name (ARN) of the Amazon Kinesis stream or Firehose delivery stream to which you want to publish events.

roleArn string

The IAM role that authorizes Amazon Pinpoint to publish events to the stream in your account.

application_id str

The application ID.

destination_stream_arn str

The Amazon Resource Name (ARN) of the Amazon Kinesis stream or Firehose delivery stream to which you want to publish events.

role_arn str

The IAM role that authorizes Amazon Pinpoint to publish events to the stream in your account.

applicationId String

The application ID.

destinationStreamArn String

The Amazon Resource Name (ARN) of the Amazon Kinesis stream or Firehose delivery stream to which you want to publish events.

roleArn String

The IAM role that authorizes Amazon Pinpoint to publish events to the stream in your account.

Outputs

All input properties are implicitly available as output properties. Additionally, the EventStream resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up an Existing EventStream Resource

Get an existing EventStream resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: EventStreamState, opts?: CustomResourceOptions): EventStream
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        application_id: Optional[str] = None,
        destination_stream_arn: Optional[str] = None,
        role_arn: Optional[str] = None) -> EventStream
func GetEventStream(ctx *Context, name string, id IDInput, state *EventStreamState, opts ...ResourceOption) (*EventStream, error)
public static EventStream Get(string name, Input<string> id, EventStreamState? state, CustomResourceOptions? opts = null)
public static EventStream get(String name, Output<String> id, EventStreamState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
ApplicationId string

The application ID.

DestinationStreamArn string

The Amazon Resource Name (ARN) of the Amazon Kinesis stream or Firehose delivery stream to which you want to publish events.

RoleArn string

The IAM role that authorizes Amazon Pinpoint to publish events to the stream in your account.

ApplicationId string

The application ID.

DestinationStreamArn string

The Amazon Resource Name (ARN) of the Amazon Kinesis stream or Firehose delivery stream to which you want to publish events.

RoleArn string

The IAM role that authorizes Amazon Pinpoint to publish events to the stream in your account.

applicationId String

The application ID.

destinationStreamArn String

The Amazon Resource Name (ARN) of the Amazon Kinesis stream or Firehose delivery stream to which you want to publish events.

roleArn String

The IAM role that authorizes Amazon Pinpoint to publish events to the stream in your account.

applicationId string

The application ID.

destinationStreamArn string

The Amazon Resource Name (ARN) of the Amazon Kinesis stream or Firehose delivery stream to which you want to publish events.

roleArn string

The IAM role that authorizes Amazon Pinpoint to publish events to the stream in your account.

application_id str

The application ID.

destination_stream_arn str

The Amazon Resource Name (ARN) of the Amazon Kinesis stream or Firehose delivery stream to which you want to publish events.

role_arn str

The IAM role that authorizes Amazon Pinpoint to publish events to the stream in your account.

applicationId String

The application ID.

destinationStreamArn String

The Amazon Resource Name (ARN) of the Amazon Kinesis stream or Firehose delivery stream to which you want to publish events.

roleArn String

The IAM role that authorizes Amazon Pinpoint to publish events to the stream in your account.

Import

Pinpoint Event Stream can be imported using the application-id, e.g.,

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

Package Details

Repository
https://github.com/pulumi/pulumi-aws
License
Apache-2.0
Notes

This Pulumi package is based on the aws Terraform Provider.