Skip to content

Resource: awsPinpointEventStream

Provides a Pinpoint Event Stream resource.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
const awsKinesisStreamTestStream = new aws.kinesisStream.KinesisStream(
  this,
  "test_stream",
  {
    name: "pinpoint-kinesis-test",
    shardCount: 1,
  }
);
const awsPinpointAppApp = new aws.pinpointApp.PinpointApp(this, "app", {});
const dataAwsIamPolicyDocumentAssumeRole =
  new aws.dataAwsIamPolicyDocument.DataAwsIamPolicyDocument(
    this,
    "assume_role",
    {
      statement: [
        {
          actions: ["sts:AssumeRole"],
          effect: "Allow",
          principals: [
            {
              identifiers: ["pinpoint.us-east-1.amazonaws.com"],
              type: "Service",
            },
          ],
        },
      ],
    }
  );
const dataAwsIamPolicyDocumentTestRolePolicy =
  new aws.dataAwsIamPolicyDocument.DataAwsIamPolicyDocument(
    this,
    "test_role_policy",
    {
      statement: [
        {
          actions: ["kinesis:PutRecords", "kinesis:DescribeStream"],
          effect: "Allow",
          resources: ["arn:aws:kinesis:us-east-1:*:*/*"],
        },
      ],
    }
  );
const awsIamRoleTestRole = new aws.iamRole.IamRole(this, "test_role", {
  assumeRolePolicy: dataAwsIamPolicyDocumentAssumeRole.json,
});
const awsIamRolePolicyTestRolePolicy = new aws.iamRolePolicy.IamRolePolicy(
  this,
  "test_role_policy_5",
  {
    name: "test_policy",
    policy: dataAwsIamPolicyDocumentTestRolePolicy.json,
    role: awsIamRoleTestRole.id,
  }
);
/*This allows the Terraform resource name to match the original name. You can remove the call if you don't need them to match.*/
awsIamRolePolicyTestRolePolicy.overrideLogicalId("test_role_policy");
new aws.pinpointEventStream.PinpointEventStream(this, "stream", {
  applicationId: awsPinpointAppApp.applicationId,
  destinationStreamArn: awsKinesisStreamTestStream.arn,
  roleArn: awsIamRoleTestRole.arn,
});

Argument Reference

The following arguments are supported:

  • applicationId - (Required) The application ID.
  • destinationStreamArn - (Required) The Amazon Resource Name (ARN) of the Amazon Kinesis stream or Firehose delivery stream to which you want to publish events.
  • roleArn - (Required) The IAM role that authorizes Amazon Pinpoint to publish events to the stream in your account.

Attributes Reference

No additional attributes are exported.

Import

Pinpoint Event Stream can be imported using the applicationId, e.g.,

$ terraform import aws_pinpoint_event_stream.stream application-id