@pulumi/aws
Version:
A Pulumi package for creating and managing Amazon Web Services (AWS) cloud resources.
174 lines • 7.65 kB
JavaScript
;
// *** 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.Connector = void 0;
const pulumi = require("@pulumi/pulumi");
const utilities = require("../utilities");
/**
* Provides an Amazon MSK Connect Connector resource.
*
* ## Example Usage
*
* ### Basic configuration
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as aws from "@pulumi/aws";
*
* const example = new aws.mskconnect.Connector("example", {
* name: "example",
* kafkaconnectVersion: "2.7.1",
* capacity: {
* autoscaling: {
* mcuCount: 1,
* minWorkerCount: 1,
* maxWorkerCount: 2,
* scaleInPolicy: {
* cpuUtilizationPercentage: 20,
* },
* scaleOutPolicy: {
* cpuUtilizationPercentage: 80,
* },
* },
* },
* connectorConfiguration: {
* "connector.class": "com.github.jcustenborder.kafka.connect.simulator.SimulatorSinkConnector",
* "tasks.max": "1",
* topics: "example",
* },
* kafkaCluster: {
* apacheKafkaCluster: {
* bootstrapServers: exampleAwsMskCluster.bootstrapBrokersTls,
* vpc: {
* securityGroups: [exampleAwsSecurityGroup.id],
* subnets: [
* example1.id,
* example2.id,
* example3.id,
* ],
* },
* },
* },
* kafkaClusterClientAuthentication: {
* authenticationType: "NONE",
* },
* kafkaClusterEncryptionInTransit: {
* encryptionType: "TLS",
* },
* plugins: [{
* customPlugin: {
* arn: exampleAwsMskconnectCustomPlugin.arn,
* revision: exampleAwsMskconnectCustomPlugin.latestRevision,
* },
* }],
* serviceExecutionRoleArn: exampleAwsIamRole.arn,
* });
* ```
*
* ## Import
*
* Using `pulumi import`, import MSK Connect Connector using the connector's `arn`. For example:
*
* ```sh
* $ pulumi import aws:mskconnect/connector:Connector example 'arn:aws:kafkaconnect:eu-central-1:123456789012:connector/example/264edee4-17a3-412e-bd76-6681cfc93805-3'
* ```
*/
class Connector extends pulumi.CustomResource {
/**
* Get an existing Connector 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 Connector(name, state, { ...opts, id: id });
}
/**
* Returns true if the given object is an instance of Connector. 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'] === Connector.__pulumiType;
}
constructor(name, argsOrState, opts) {
let resourceInputs = {};
opts = opts || {};
if (opts.id) {
const state = argsOrState;
resourceInputs["arn"] = state?.arn;
resourceInputs["capacity"] = state?.capacity;
resourceInputs["connectorConfiguration"] = state?.connectorConfiguration;
resourceInputs["description"] = state?.description;
resourceInputs["kafkaCluster"] = state?.kafkaCluster;
resourceInputs["kafkaClusterClientAuthentication"] = state?.kafkaClusterClientAuthentication;
resourceInputs["kafkaClusterEncryptionInTransit"] = state?.kafkaClusterEncryptionInTransit;
resourceInputs["kafkaconnectVersion"] = state?.kafkaconnectVersion;
resourceInputs["logDelivery"] = state?.logDelivery;
resourceInputs["name"] = state?.name;
resourceInputs["plugins"] = state?.plugins;
resourceInputs["region"] = state?.region;
resourceInputs["serviceExecutionRoleArn"] = state?.serviceExecutionRoleArn;
resourceInputs["tags"] = state?.tags;
resourceInputs["tagsAll"] = state?.tagsAll;
resourceInputs["version"] = state?.version;
resourceInputs["workerConfiguration"] = state?.workerConfiguration;
}
else {
const args = argsOrState;
if (args?.capacity === undefined && !opts.urn) {
throw new Error("Missing required property 'capacity'");
}
if (args?.connectorConfiguration === undefined && !opts.urn) {
throw new Error("Missing required property 'connectorConfiguration'");
}
if (args?.kafkaCluster === undefined && !opts.urn) {
throw new Error("Missing required property 'kafkaCluster'");
}
if (args?.kafkaClusterClientAuthentication === undefined && !opts.urn) {
throw new Error("Missing required property 'kafkaClusterClientAuthentication'");
}
if (args?.kafkaClusterEncryptionInTransit === undefined && !opts.urn) {
throw new Error("Missing required property 'kafkaClusterEncryptionInTransit'");
}
if (args?.kafkaconnectVersion === undefined && !opts.urn) {
throw new Error("Missing required property 'kafkaconnectVersion'");
}
if (args?.plugins === undefined && !opts.urn) {
throw new Error("Missing required property 'plugins'");
}
if (args?.serviceExecutionRoleArn === undefined && !opts.urn) {
throw new Error("Missing required property 'serviceExecutionRoleArn'");
}
resourceInputs["capacity"] = args?.capacity;
resourceInputs["connectorConfiguration"] = args?.connectorConfiguration;
resourceInputs["description"] = args?.description;
resourceInputs["kafkaCluster"] = args?.kafkaCluster;
resourceInputs["kafkaClusterClientAuthentication"] = args?.kafkaClusterClientAuthentication;
resourceInputs["kafkaClusterEncryptionInTransit"] = args?.kafkaClusterEncryptionInTransit;
resourceInputs["kafkaconnectVersion"] = args?.kafkaconnectVersion;
resourceInputs["logDelivery"] = args?.logDelivery;
resourceInputs["name"] = args?.name;
resourceInputs["plugins"] = args?.plugins;
resourceInputs["region"] = args?.region;
resourceInputs["serviceExecutionRoleArn"] = args?.serviceExecutionRoleArn;
resourceInputs["tags"] = args?.tags;
resourceInputs["workerConfiguration"] = args?.workerConfiguration;
resourceInputs["arn"] = undefined /*out*/;
resourceInputs["tagsAll"] = undefined /*out*/;
resourceInputs["version"] = undefined /*out*/;
}
opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts);
super(Connector.__pulumiType, name, resourceInputs, opts);
}
}
exports.Connector = Connector;
/** @internal */
Connector.__pulumiType = 'aws:mskconnect/connector:Connector';
//# sourceMappingURL=connector.js.map