UNPKG

@pulumi/aws

Version:

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

310 lines • 12.6 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.Application = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * Manages a Kinesis Analytics v2 Application. * This resource can be used to manage both Kinesis Data Analytics for SQL applications and Kinesis Data Analytics for Apache Flink applications. * * > **Note:** Kinesis Data Analytics for SQL applications created using this resource cannot currently be viewed in the AWS Console. To manage Kinesis Data Analytics for SQL applications that can also be viewed in the AWS Console, use the `aws.kinesis.AnalyticsApplication` resource. * * ## Example Usage * * ### Apache Flink Application * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.s3.Bucket("example", {bucket: "example-flink-application"}); * const exampleBucketObjectv2 = new aws.s3.BucketObjectv2("example", { * bucket: example.id, * key: "example-flink-application", * source: new pulumi.asset.FileAsset("flink-app.jar"), * }); * const exampleApplication = new aws.kinesisanalyticsv2.Application("example", { * name: "example-flink-application", * runtimeEnvironment: "FLINK-1_8", * serviceExecutionRole: exampleAwsIamRole.arn, * applicationConfiguration: { * applicationCodeConfiguration: { * codeContent: { * s3ContentLocation: { * bucketArn: example.arn, * fileKey: exampleBucketObjectv2.key, * }, * }, * codeContentType: "ZIPFILE", * }, * environmentProperties: { * propertyGroups: [ * { * propertyGroupId: "PROPERTY-GROUP-1", * propertyMap: { * Key1: "Value1", * }, * }, * { * propertyGroupId: "PROPERTY-GROUP-2", * propertyMap: { * KeyA: "ValueA", * KeyB: "ValueB", * }, * }, * ], * }, * flinkApplicationConfiguration: { * checkpointConfiguration: { * configurationType: "DEFAULT", * }, * monitoringConfiguration: { * configurationType: "CUSTOM", * logLevel: "DEBUG", * metricsLevel: "TASK", * }, * parallelismConfiguration: { * autoScalingEnabled: true, * configurationType: "CUSTOM", * parallelism: 10, * parallelismPerKpu: 4, * }, * }, * }, * tags: { * Environment: "test", * }, * }); * ``` * * ### SQL Application * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.cloudwatch.LogGroup("example", {name: "example-sql-application"}); * const exampleLogStream = new aws.cloudwatch.LogStream("example", { * name: "example-sql-application", * logGroupName: example.name, * }); * const exampleApplication = new aws.kinesisanalyticsv2.Application("example", { * name: "example-sql-application", * runtimeEnvironment: "SQL-1_0", * serviceExecutionRole: exampleAwsIamRole.arn, * applicationConfiguration: { * applicationCodeConfiguration: { * codeContent: { * textContent: "SELECT 1;\n", * }, * codeContentType: "PLAINTEXT", * }, * sqlApplicationConfiguration: { * input: { * namePrefix: "PREFIX_1", * inputParallelism: { * count: 3, * }, * inputSchema: { * recordColumns: [ * { * name: "COLUMN_1", * sqlType: "VARCHAR(8)", * mapping: "MAPPING-1", * }, * { * name: "COLUMN_2", * sqlType: "DOUBLE", * }, * ], * recordEncoding: "UTF-8", * recordFormat: { * recordFormatType: "CSV", * mappingParameters: { * csvMappingParameters: { * recordColumnDelimiter: ",", * recordRowDelimiter: "\n", * }, * }, * }, * }, * kinesisStreamsInput: { * resourceArn: exampleAwsKinesisStream.arn, * }, * }, * outputs: [ * { * name: "OUTPUT_1", * destinationSchema: { * recordFormatType: "JSON", * }, * lambdaOutput: { * resourceArn: exampleAwsLambdaFunction.arn, * }, * }, * { * name: "OUTPUT_2", * destinationSchema: { * recordFormatType: "CSV", * }, * kinesisFirehoseOutput: { * resourceArn: exampleAwsKinesisFirehoseDeliveryStream.arn, * }, * }, * ], * referenceDataSource: { * tableName: "TABLE-1", * referenceSchema: { * recordColumns: [{ * name: "COLUMN_1", * sqlType: "INTEGER", * }], * recordFormat: { * recordFormatType: "JSON", * mappingParameters: { * jsonMappingParameters: { * recordRowPath: "$", * }, * }, * }, * }, * s3ReferenceDataSource: { * bucketArn: exampleAwsS3Bucket.arn, * fileKey: "KEY-1", * }, * }, * }, * }, * cloudwatchLoggingOptions: { * logStreamArn: exampleLogStream.arn, * }, * }); * ``` * * ### VPC Configuration * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as aws from "@pulumi/aws"; * * const example = new aws.s3.Bucket("example", {bucket: "example-flink-application"}); * const exampleBucketObjectv2 = new aws.s3.BucketObjectv2("example", { * bucket: example.id, * key: "example-flink-application", * source: new pulumi.asset.FileAsset("flink-app.jar"), * }); * const exampleApplication = new aws.kinesisanalyticsv2.Application("example", { * name: "example-flink-application", * runtimeEnvironment: "FLINK-1_8", * serviceExecutionRole: exampleAwsIamRole.arn, * applicationConfiguration: { * applicationCodeConfiguration: { * codeContent: { * s3ContentLocation: { * bucketArn: example.arn, * fileKey: exampleBucketObjectv2.key, * }, * }, * codeContentType: "ZIPFILE", * }, * vpcConfiguration: { * securityGroupIds: [ * exampleAwsSecurityGroup[0].id, * exampleAwsSecurityGroup[1].id, * ], * subnetIds: [exampleAwsSubnet.id], * }, * }, * }); * ``` * * ## Import * * Using `pulumi import`, import `aws_kinesisanalyticsv2_application` using the application ARN. For example: * * ```sh * $ pulumi import aws:kinesisanalyticsv2/application:Application example arn:aws:kinesisanalytics:us-west-2:123456789012:application/example-sql-application * ``` */ class Application extends pulumi.CustomResource { /** * Get an existing Application 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 Application(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Application. 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'] === Application.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["applicationConfiguration"] = state?.applicationConfiguration; resourceInputs["applicationMode"] = state?.applicationMode; resourceInputs["arn"] = state?.arn; resourceInputs["cloudwatchLoggingOptions"] = state?.cloudwatchLoggingOptions; resourceInputs["createTimestamp"] = state?.createTimestamp; resourceInputs["description"] = state?.description; resourceInputs["forceStop"] = state?.forceStop; resourceInputs["lastUpdateTimestamp"] = state?.lastUpdateTimestamp; resourceInputs["name"] = state?.name; resourceInputs["region"] = state?.region; resourceInputs["runtimeEnvironment"] = state?.runtimeEnvironment; resourceInputs["serviceExecutionRole"] = state?.serviceExecutionRole; resourceInputs["startApplication"] = state?.startApplication; resourceInputs["status"] = state?.status; resourceInputs["tags"] = state?.tags; resourceInputs["tagsAll"] = state?.tagsAll; resourceInputs["versionId"] = state?.versionId; } else { const args = argsOrState; if (args?.runtimeEnvironment === undefined && !opts.urn) { throw new Error("Missing required property 'runtimeEnvironment'"); } if (args?.serviceExecutionRole === undefined && !opts.urn) { throw new Error("Missing required property 'serviceExecutionRole'"); } resourceInputs["applicationConfiguration"] = args?.applicationConfiguration; resourceInputs["applicationMode"] = args?.applicationMode; resourceInputs["cloudwatchLoggingOptions"] = args?.cloudwatchLoggingOptions; resourceInputs["description"] = args?.description; resourceInputs["forceStop"] = args?.forceStop; resourceInputs["name"] = args?.name; resourceInputs["region"] = args?.region; resourceInputs["runtimeEnvironment"] = args?.runtimeEnvironment; resourceInputs["serviceExecutionRole"] = args?.serviceExecutionRole; resourceInputs["startApplication"] = args?.startApplication; resourceInputs["tags"] = args?.tags; resourceInputs["arn"] = undefined /*out*/; resourceInputs["createTimestamp"] = undefined /*out*/; resourceInputs["lastUpdateTimestamp"] = undefined /*out*/; resourceInputs["status"] = undefined /*out*/; resourceInputs["tagsAll"] = undefined /*out*/; resourceInputs["versionId"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Application.__pulumiType, name, resourceInputs, opts); } } exports.Application = Application; /** @internal */ Application.__pulumiType = 'aws:kinesisanalyticsv2/application:Application'; //# sourceMappingURL=application.js.map