UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

139 lines 5.4 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.Acl = void 0; const pulumi = require("@pulumi/pulumi"); const utilities = require("../utilities"); /** * A Managed Service for Apache Kafka ACL. Apache Kafka is a trademark owned by the Apache Software Foundation. * * ## Example Usage * * ### Managedkafka Acl Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const project = gcp.organizations.getProject({}); * const cluster = new gcp.managedkafka.Cluster("cluster", { * clusterId: "my-cluster", * location: "us-central1", * capacityConfig: { * vcpuCount: "3", * memoryBytes: "3221225472", * }, * gcpConfig: { * accessConfig: { * networkConfigs: [{ * subnet: project.then(project => `projects/${project.number}/regions/us-central1/subnetworks/default`), * }], * }, * }, * }); * const example = new gcp.managedkafka.Acl("example", { * aclId: "topic/mytopic", * cluster: cluster.clusterId, * location: "us-central1", * aclEntries: [ * { * principal: "User:admin@my-project.iam.gserviceaccount.com", * permissionType: "ALLOW", * operation: "ALL", * host: "*", * }, * { * principal: "User:producer-client@my-project.iam.gserviceaccount.com", * permissionType: "ALLOW", * operation: "WRITE", * host: "*", * }, * ], * }); * ``` * * ## Import * * Acl can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/clusters/{{cluster}}/acls/{{acl_id}}` * * When using the `pulumi import` command, Acl can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:managedkafka/acl:Acl default projects/{{project}}/locations/{{location}}/clusters/{{cluster}}/acls/{{acl_id}} * ``` */ class Acl extends pulumi.CustomResource { /** * Get an existing Acl 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 Acl(name, state, { ...opts, id: id }); } /** * Returns true if the given object is an instance of Acl. 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'] === Acl.__pulumiType; } constructor(name, argsOrState, opts) { let resourceInputs = {}; opts = opts || {}; if (opts.id) { const state = argsOrState; resourceInputs["aclEntries"] = state?.aclEntries; resourceInputs["aclId"] = state?.aclId; resourceInputs["cluster"] = state?.cluster; resourceInputs["etag"] = state?.etag; resourceInputs["location"] = state?.location; resourceInputs["name"] = state?.name; resourceInputs["patternType"] = state?.patternType; resourceInputs["project"] = state?.project; resourceInputs["resourceName"] = state?.resourceName; resourceInputs["resourceType"] = state?.resourceType; } else { const args = argsOrState; if (args?.aclEntries === undefined && !opts.urn) { throw new Error("Missing required property 'aclEntries'"); } if (args?.aclId === undefined && !opts.urn) { throw new Error("Missing required property 'aclId'"); } if (args?.cluster === undefined && !opts.urn) { throw new Error("Missing required property 'cluster'"); } if (args?.location === undefined && !opts.urn) { throw new Error("Missing required property 'location'"); } resourceInputs["aclEntries"] = args?.aclEntries; resourceInputs["aclId"] = args?.aclId; resourceInputs["cluster"] = args?.cluster; resourceInputs["location"] = args?.location; resourceInputs["project"] = args?.project; resourceInputs["etag"] = undefined /*out*/; resourceInputs["name"] = undefined /*out*/; resourceInputs["patternType"] = undefined /*out*/; resourceInputs["resourceName"] = undefined /*out*/; resourceInputs["resourceType"] = undefined /*out*/; } opts = pulumi.mergeOptions(utilities.resourceOptsDefaults(), opts); super(Acl.__pulumiType, name, resourceInputs, opts); } } exports.Acl = Acl; /** @internal */ Acl.__pulumiType = 'gcp:managedkafka/acl:Acl'; //# sourceMappingURL=acl.js.map