1. Packages
  2. OVH
  3. API Docs
  4. CloudProjectDatabase
  5. KafkaAcl
OVHCloud v0.37.0 published on Wednesday, Feb 21, 2024 by OVHcloud

ovh.CloudProjectDatabase.KafkaAcl

Explore with Pulumi AI

ovh logo
OVHCloud v0.37.0 published on Wednesday, Feb 21, 2024 by OVHcloud

    Creates an ACL for a kafka cluster associated with a public cloud project.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ovh = Pulumi.Ovh;
    
    return await Deployment.RunAsync(() => 
    {
        var kafka = Ovh.CloudProjectDatabase.GetDatabase.Invoke(new()
        {
            ServiceName = "XXX",
            Engine = "kafka",
            Id = "ZZZ",
        });
    
        var acl = new Ovh.CloudProjectDatabase.KafkaAcl("acl", new()
        {
            ServiceName = kafka.Apply(getDatabaseResult => getDatabaseResult.ServiceName),
            ClusterId = kafka.Apply(getDatabaseResult => getDatabaseResult.Id),
            Permission = "read",
            Topic = "mytopic",
            Username = "johndoe",
        });
    
    });
    
    package main
    
    import (
    	"github.com/ovh/pulumi-ovh/sdk/go/ovh/CloudProjectDatabase"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		kafka, err := CloudProjectDatabase.GetDatabase(ctx, &cloudprojectdatabase.GetDatabaseArgs{
    			ServiceName: "XXX",
    			Engine:      "kafka",
    			Id:          "ZZZ",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = CloudProjectDatabase.NewKafkaAcl(ctx, "acl", &CloudProjectDatabase.KafkaAclArgs{
    			ServiceName: *pulumi.String(kafka.ServiceName),
    			ClusterId:   *pulumi.String(kafka.Id),
    			Permission:  pulumi.String("read"),
    			Topic:       pulumi.String("mytopic"),
    			Username:    pulumi.String("johndoe"),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ovh.CloudProjectDatabase.CloudProjectDatabaseFunctions;
    import com.pulumi.ovh.CloudProjectDatabase.inputs.GetDatabaseArgs;
    import com.pulumi.ovh.CloudProjectDatabase.KafkaAcl;
    import com.pulumi.ovh.CloudProjectDatabase.KafkaAclArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            final var kafka = CloudProjectDatabaseFunctions.getDatabase(GetDatabaseArgs.builder()
                .serviceName("XXX")
                .engine("kafka")
                .id("ZZZ")
                .build());
    
            var acl = new KafkaAcl("acl", KafkaAclArgs.builder()        
                .serviceName(kafka.applyValue(getDatabaseResult -> getDatabaseResult.serviceName()))
                .clusterId(kafka.applyValue(getDatabaseResult -> getDatabaseResult.id()))
                .permission("read")
                .topic("mytopic")
                .username("johndoe")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_ovh as ovh
    
    kafka = ovh.CloudProjectDatabase.get_database(service_name="XXX",
        engine="kafka",
        id="ZZZ")
    acl = ovh.cloud_project_database.KafkaAcl("acl",
        service_name=kafka.service_name,
        cluster_id=kafka.id,
        permission="read",
        topic="mytopic",
        username="johndoe")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as ovh from "@ovh-devrelteam/pulumi-ovh";
    import * as ovh from "@pulumi/ovh";
    
    const kafka = ovh.CloudProjectDatabase.getDatabase({
        serviceName: "XXX",
        engine: "kafka",
        id: "ZZZ",
    });
    const acl = new ovh.cloudprojectdatabase.KafkaAcl("acl", {
        serviceName: kafka.then(kafka => kafka.serviceName),
        clusterId: kafka.then(kafka => kafka.id),
        permission: "read",
        topic: "mytopic",
        username: "johndoe",
    });
    
    resources:
      acl:
        type: ovh:CloudProjectDatabase:KafkaAcl
        properties:
          serviceName: ${kafka.serviceName}
          clusterId: ${kafka.id}
          permission: read
          topic: mytopic
          username: johndoe
    variables:
      kafka:
        fn::invoke:
          Function: ovh:CloudProjectDatabase:getDatabase
          Arguments:
            serviceName: XXX
            engine: kafka
            id: ZZZ
    

    Create KafkaAcl Resource

    new KafkaAcl(name: string, args: KafkaAclArgs, opts?: CustomResourceOptions);
    @overload
    def KafkaAcl(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 cluster_id: Optional[str] = None,
                 permission: Optional[str] = None,
                 service_name: Optional[str] = None,
                 topic: Optional[str] = None,
                 username: Optional[str] = None)
    @overload
    def KafkaAcl(resource_name: str,
                 args: KafkaAclArgs,
                 opts: Optional[ResourceOptions] = None)
    func NewKafkaAcl(ctx *Context, name string, args KafkaAclArgs, opts ...ResourceOption) (*KafkaAcl, error)
    public KafkaAcl(string name, KafkaAclArgs args, CustomResourceOptions? opts = null)
    public KafkaAcl(String name, KafkaAclArgs args)
    public KafkaAcl(String name, KafkaAclArgs args, CustomResourceOptions options)
    
    type: ovh:CloudProjectDatabase:KafkaAcl
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args KafkaAclArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args KafkaAclArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args KafkaAclArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args KafkaAclArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args KafkaAclArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    KafkaAcl Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The KafkaAcl resource accepts the following input properties:

    ClusterId string
    Cluster ID.
    Permission string
    Permission to give to this username on this topic. Available permissions:
    ServiceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    Topic string
    Topic affected by this ACL.
    Username string
    Username affected by this ACL.
    ClusterId string
    Cluster ID.
    Permission string
    Permission to give to this username on this topic. Available permissions:
    ServiceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    Topic string
    Topic affected by this ACL.
    Username string
    Username affected by this ACL.
    clusterId String
    Cluster ID.
    permission String
    Permission to give to this username on this topic. Available permissions:
    serviceName String
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    topic String
    Topic affected by this ACL.
    username String
    Username affected by this ACL.
    clusterId string
    Cluster ID.
    permission string
    Permission to give to this username on this topic. Available permissions:
    serviceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    topic string
    Topic affected by this ACL.
    username string
    Username affected by this ACL.
    cluster_id str
    Cluster ID.
    permission str
    Permission to give to this username on this topic. Available permissions:
    service_name str
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    topic str
    Topic affected by this ACL.
    username str
    Username affected by this ACL.
    clusterId String
    Cluster ID.
    permission String
    Permission to give to this username on this topic. Available permissions:
    serviceName String
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    topic String
    Topic affected by this ACL.
    username String
    Username affected by this ACL.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the KafkaAcl resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing KafkaAcl Resource

    Get an existing KafkaAcl resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: KafkaAclState, opts?: CustomResourceOptions): KafkaAcl
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cluster_id: Optional[str] = None,
            permission: Optional[str] = None,
            service_name: Optional[str] = None,
            topic: Optional[str] = None,
            username: Optional[str] = None) -> KafkaAcl
    func GetKafkaAcl(ctx *Context, name string, id IDInput, state *KafkaAclState, opts ...ResourceOption) (*KafkaAcl, error)
    public static KafkaAcl Get(string name, Input<string> id, KafkaAclState? state, CustomResourceOptions? opts = null)
    public static KafkaAcl get(String name, Output<String> id, KafkaAclState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    ClusterId string
    Cluster ID.
    Permission string
    Permission to give to this username on this topic. Available permissions:
    ServiceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    Topic string
    Topic affected by this ACL.
    Username string
    Username affected by this ACL.
    ClusterId string
    Cluster ID.
    Permission string
    Permission to give to this username on this topic. Available permissions:
    ServiceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    Topic string
    Topic affected by this ACL.
    Username string
    Username affected by this ACL.
    clusterId String
    Cluster ID.
    permission String
    Permission to give to this username on this topic. Available permissions:
    serviceName String
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    topic String
    Topic affected by this ACL.
    username String
    Username affected by this ACL.
    clusterId string
    Cluster ID.
    permission string
    Permission to give to this username on this topic. Available permissions:
    serviceName string
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    topic string
    Topic affected by this ACL.
    username string
    Username affected by this ACL.
    cluster_id str
    Cluster ID.
    permission str
    Permission to give to this username on this topic. Available permissions:
    service_name str
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    topic str
    Topic affected by this ACL.
    username str
    Username affected by this ACL.
    clusterId String
    Cluster ID.
    permission String
    Permission to give to this username on this topic. Available permissions:
    serviceName String
    The id of the public cloud project. If omitted, the OVH_CLOUD_PROJECT_SERVICE environment variable is used.
    topic String
    Topic affected by this ACL.
    username String
    Username affected by this ACL.

    Import

    OVHcloud Managed kafka clusters ACLs can be imported using the service_name, cluster_id and id of the acl, separated by “/” E.g.,

    bash

    $ pulumi import ovh:CloudProjectDatabase/kafkaAcl:KafkaAcl my_acl service_name/cluster_id/id
    

    Package Details

    Repository
    ovh ovh/pulumi-ovh
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the ovh Terraform Provider.
    ovh logo
    OVHCloud v0.37.0 published on Wednesday, Feb 21, 2024 by OVHcloud