UNPKG

@pulumi/aws

Version:

A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.

119 lines 4.58 kB
"use strict"; // *** WARNING: this file was generated by pulumi-language-nodejs. *** // *** Do not edit by hand unless you're certain you know what you are doing! *** Object.defineProperty(exports, "__esModule", { value: true }); exports.EventStream = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Provides a Pinpoint Event Stream resource. * * ## Example Usage * * ```typescript * 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: [{ * effect: "Allow", * principals: [{ * type: "Service", * identifiers: ["pinpoint.us-east-1.amazonaws.com"], * }], * 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 * * Using `pulumi import`, import Pinpoint Event Stream using the `application-id`. For example: * * ```sh * $ pulumi import aws:pinpoint/eventStream:EventStream stream application-id * ``` */ class EventStream extends pulumi.CustomResource { /** * Get an existing EventStream resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name, id, state, opts) { return new EventStream(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of EventStream. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj) { if (obj === undefined || obj === null) { return false; } return obj['__pulumiType'] === EventStream.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["applicationId"] = state?.applicationId; resourceInputs["destinationStreamArn"] = state?.destinationStreamArn; resourceInputs["region"] = state?.region; resourceInputs["roleArn"] = state?.roleArn; } else { const args = argsOrState; if (args?.applicationId === undefined && !opts.urn) { throw new Error("Missing required property 'applicationId'"); } if (args?.destinationStreamArn === undefined && !opts.urn) { throw new Error("Missing required property 'destinationStreamArn'"); } if (args?.roleArn === undefined && !opts.urn) { throw new Error("Missing required property 'roleArn'"); } resourceInputs["applicationId"] = args?.applicationId; resourceInputs["destinationStreamArn"] = args?.destinationStreamArn; resourceInputs["region"] = args?.region; resourceInputs["roleArn"] = args?.roleArn; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(EventStream.__pulumiType, name, resourceInputs, opts); } } exports.EventStream = EventStream; /** @internal */ EventStream.__pulumiType = 'aws:pinpoint/eventStream:EventStream'; //# sourceMappingURL=eventStream.js.map