@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
266 lines (265 loc) • 10.9 kB
TypeScript
import * as pulumi from "@pulumi/pulumi";
import * as inputs from "../types/input";
import * as outputs from "../types/output";
/**
* ## Example Usage
*
* ### Managedkafka Connector Basic
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as gcp from "@pulumi/gcp";
*
* const mkcNetwork = new gcp.compute.Network("mkc_network", {
* name: "my-network-0",
* autoCreateSubnetworks: false,
* });
* const mkcSubnet = new gcp.compute.Subnetwork("mkc_subnet", {
* name: "my-subnetwork-0",
* ipCidrRange: "10.4.0.0/16",
* region: "us-central1",
* network: mkcNetwork.id,
* });
* const mkcAdditionalSubnet = new gcp.compute.Subnetwork("mkc_additional_subnet", {
* name: "my-additional-subnetwork-0",
* ipCidrRange: "10.5.0.0/16",
* region: "us-central1",
* network: mkcNetwork.id,
* });
* const cpsTopic = new gcp.pubsub.Topic("cps_topic", {
* name: "my-cps-topic",
* messageRetentionDuration: "86600s",
* });
* const project = gcp.organizations.getProject({});
* const gmkCluster = new gcp.managedkafka.Cluster("gmk_cluster", {
* clusterId: "my-cluster",
* location: "us-central1",
* capacityConfig: {
* vcpuCount: "3",
* memoryBytes: "3221225472",
* },
* gcpConfig: {
* accessConfig: {
* networkConfigs: [{
* subnet: pulumi.all([project, mkcSubnet.id]).apply(([project, id]) => `projects/${project.projectId}/regions/us-central1/subnetworks/${id}`),
* }],
* },
* },
* });
* const gmkTopic = new gcp.managedkafka.Topic("gmk_topic", {
* topicId: "my-topic",
* cluster: gmkCluster.clusterId,
* location: "us-central1",
* partitionCount: 2,
* replicationFactor: 3,
* });
* const mkcCluster = new gcp.managedkafka.ConnectCluster("mkc_cluster", {
* connectClusterId: "my-connect-cluster",
* kafkaCluster: pulumi.all([project, gmkCluster.clusterId]).apply(([project, clusterId]) => `projects/${project.projectId}/locations/us-central1/clusters/${clusterId}`),
* location: "us-central1",
* capacityConfig: {
* vcpuCount: "12",
* memoryBytes: "21474836480",
* },
* gcpConfig: {
* accessConfig: {
* networkConfigs: [{
* primarySubnet: pulumi.all([project, mkcSubnet.id]).apply(([project, id]) => `projects/${project.projectId}/regions/us-central1/subnetworks/${id}`),
* additionalSubnets: [mkcAdditionalSubnet.id],
* dnsDomainNames: [pulumi.all([gmkCluster.clusterId, project]).apply(([clusterId, project]) => `${clusterId}.us-central1.managedkafka-staging.${project.projectId}.cloud-staging.goog`)],
* }],
* },
* },
* labels: {
* key: "value",
* },
* });
* const example = new gcp.managedkafka.Connector("example", {
* connectorId: "my-connector",
* connectCluster: mkcCluster.connectClusterId,
* location: "us-central1",
* configs: {
* "connector.class": "com.google.pubsub.kafka.sink.CloudPubSubSinkConnector",
* name: "my-connector",
* "tasks.max": "1",
* topics: gmkTopic.topicId,
* "cps.topic": cpsTopic.name,
* "cps.project": project.then(project => project.projectId),
* "value.converter": "org.apache.kafka.connect.storage.StringConverter",
* "key.converter": "org.apache.kafka.connect.storage.StringConverter",
* },
* taskRestartPolicy: {
* minimumBackoff: "60s",
* maximumBackoff: "1800s",
* },
* });
* ```
*
* ## Import
*
* Connector can be imported using any of these accepted formats:
*
* * `projects/{{project}}/locations/{{location}}/connectClusters/{{connect_cluster}}/connectors/{{connector_id}}`
*
* * `{{project}}/{{location}}/{{connect_cluster}}/{{connector_id}}`
*
* * `{{location}}/{{connect_cluster}}/{{connector_id}}`
*
* When using the `pulumi import` command, Connector can be imported using one of the formats above. For example:
*
* ```sh
* $ pulumi import gcp:managedkafka/connector:Connector default projects/{{project}}/locations/{{location}}/connectClusters/{{connect_cluster}}/connectors/{{connector_id}}
* ```
*
* ```sh
* $ pulumi import gcp:managedkafka/connector:Connector default {{project}}/{{location}}/{{connect_cluster}}/{{connector_id}}
* ```
*
* ```sh
* $ pulumi import gcp:managedkafka/connector:Connector default {{location}}/{{connect_cluster}}/{{connector_id}}
* ```
*/
export declare 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: string, id: pulumi.Input<pulumi.ID>, state?: ConnectorState, opts?: pulumi.CustomResourceOptions): Connector;
/**
* 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: any): obj is Connector;
/**
* Connector config as keys/values. The keys of the map are connector property names, for example: `connector.class`, `tasks.max`, `key.converter`.
*/
readonly configs: pulumi.Output<{
[key: string]: string;
} | undefined>;
/**
* The connect cluster name.
*/
readonly connectCluster: pulumi.Output<string>;
/**
* The ID to use for the connector, which will become the final component of the connector's name. This value is structured like: `my-connector-id`.
*
*
* - - -
*/
readonly connectorId: pulumi.Output<string>;
/**
* ID of the location of the Kafka Connect resource. See https://cloud.google.com/managed-kafka/docs/locations for a list of supported locations.
*/
readonly location: pulumi.Output<string>;
/**
* The name of the connector. The `connector` segment is used when connecting directly to the connect cluster. Structured like: `projects/PROJECT_ID/locations/LOCATION/connectClusters/CONNECT_CLUSTER/connectors/CONNECTOR_ID`.
*/
readonly name: pulumi.Output<string>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
readonly project: pulumi.Output<string>;
/**
* The current state of the connect. Possible values: `STATE_UNSPECIFIED`, `UNASSIGNED`, `RUNNING`, `PAUSED`, `FAILED`, `RESTARTING`, and `STOPPED`.
*/
readonly state: pulumi.Output<string>;
/**
* A policy that specifies how to restart the failed connectors/tasks in a Cluster resource. If not set, the failed connectors/tasks won't be restarted.
* Structure is documented below.
*/
readonly taskRestartPolicy: pulumi.Output<outputs.managedkafka.ConnectorTaskRestartPolicy | undefined>;
/**
* Create a Connector resource with the given unique name, arguments, and options.
*
* @param name The _unique_ name of the resource.
* @param args The arguments to use to populate this resource's properties.
* @param opts A bag of options that control this resource's behavior.
*/
constructor(name: string, args: ConnectorArgs, opts?: pulumi.CustomResourceOptions);
}
/**
* Input properties used for looking up and filtering Connector resources.
*/
export interface ConnectorState {
/**
* Connector config as keys/values. The keys of the map are connector property names, for example: `connector.class`, `tasks.max`, `key.converter`.
*/
configs?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The connect cluster name.
*/
connectCluster?: pulumi.Input<string>;
/**
* The ID to use for the connector, which will become the final component of the connector's name. This value is structured like: `my-connector-id`.
*
*
* - - -
*/
connectorId?: pulumi.Input<string>;
/**
* ID of the location of the Kafka Connect resource. See https://cloud.google.com/managed-kafka/docs/locations for a list of supported locations.
*/
location?: pulumi.Input<string>;
/**
* The name of the connector. The `connector` segment is used when connecting directly to the connect cluster. Structured like: `projects/PROJECT_ID/locations/LOCATION/connectClusters/CONNECT_CLUSTER/connectors/CONNECTOR_ID`.
*/
name?: pulumi.Input<string>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string>;
/**
* The current state of the connect. Possible values: `STATE_UNSPECIFIED`, `UNASSIGNED`, `RUNNING`, `PAUSED`, `FAILED`, `RESTARTING`, and `STOPPED`.
*/
state?: pulumi.Input<string>;
/**
* A policy that specifies how to restart the failed connectors/tasks in a Cluster resource. If not set, the failed connectors/tasks won't be restarted.
* Structure is documented below.
*/
taskRestartPolicy?: pulumi.Input<inputs.managedkafka.ConnectorTaskRestartPolicy>;
}
/**
* The set of arguments for constructing a Connector resource.
*/
export interface ConnectorArgs {
/**
* Connector config as keys/values. The keys of the map are connector property names, for example: `connector.class`, `tasks.max`, `key.converter`.
*/
configs?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The connect cluster name.
*/
connectCluster: pulumi.Input<string>;
/**
* The ID to use for the connector, which will become the final component of the connector's name. This value is structured like: `my-connector-id`.
*
*
* - - -
*/
connectorId: pulumi.Input<string>;
/**
* ID of the location of the Kafka Connect resource. See https://cloud.google.com/managed-kafka/docs/locations for a list of supported locations.
*/
location: pulumi.Input<string>;
/**
* The ID of the project in which the resource belongs.
* If it is not provided, the provider project is used.
*/
project?: pulumi.Input<string>;
/**
* A policy that specifies how to restart the failed connectors/tasks in a Cluster resource. If not set, the failed connectors/tasks won't be restarted.
* Structure is documented below.
*/
taskRestartPolicy?: pulumi.Input<inputs.managedkafka.ConnectorTaskRestartPolicy>;
}