GroupUser

Manages an API Management User Assignment to a Group.

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleUser = Output.Create(Azure.ApiManagement.GetUser.InvokeAsync(new Azure.ApiManagement.GetUserArgs
        {
            UserId = "my-user",
            ApiManagementName = "example-apim",
            ResourceGroupName = "search-service",
        }));
        var exampleGroupUser = new Azure.ApiManagement.GroupUser("exampleGroupUser", new Azure.ApiManagement.GroupUserArgs
        {
            UserId = exampleUser.Apply(exampleUser => exampleUser.Id),
            GroupName = "example-group",
            ResourceGroupName = exampleUser.Apply(exampleUser => exampleUser.ResourceGroupName),
            ApiManagementName = exampleUser.Apply(exampleUser => exampleUser.ApiManagementName),
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-azure/sdk/v3/go/azure/apimanagement"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        exampleUser, err := apimanagement.LookupUser(ctx, &apimanagement.LookupUserArgs{
            UserId:            "my-user",
            ApiManagementName: "example-apim",
            ResourceGroupName: "search-service",
        }, nil)
        if err != nil {
            return err
        }
        _, err = apimanagement.NewGroupUser(ctx, "exampleGroupUser", &apimanagement.GroupUserArgs{
            UserId:            pulumi.String(exampleUser.Id),
            GroupName:         pulumi.String("example-group"),
            ResourceGroupName: pulumi.String(exampleUser.ResourceGroupName),
            ApiManagementName: pulumi.String(exampleUser.ApiManagementName),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_azure as azure

example_user = azure.apimanagement.get_user(user_id="my-user",
    api_management_name="example-apim",
    resource_group_name="search-service")
example_group_user = azure.apimanagement.GroupUser("exampleGroupUser",
    user_id=example_user.id,
    group_name="example-group",
    resource_group_name=example_user.resource_group_name,
    api_management_name=example_user.api_management_name)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleUser = azure.apimanagement.getUser({
    userId: "my-user",
    apiManagementName: "example-apim",
    resourceGroupName: "search-service",
});
const exampleGroupUser = new azure.apimanagement.GroupUser("exampleGroupUser", {
    userId: exampleUser.then(exampleUser => exampleUser.id),
    groupName: "example-group",
    resourceGroupName: exampleUser.then(exampleUser => exampleUser.resourceGroupName),
    apiManagementName: exampleUser.then(exampleUser => exampleUser.apiManagementName),
});

Create a GroupUser Resource

def GroupUser(resource_name, opts=None, api_management_name=None, group_name=None, resource_group_name=None, user_id=None, __props__=None);
func NewGroupUser(ctx *Context, name string, args GroupUserArgs, opts ...ResourceOption) (*GroupUser, error)
public GroupUser(string name, GroupUserArgs args, CustomResourceOptions? opts = null)
name string
The unique name of the resource.
args GroupUserArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
opts ResourceOptions
A bag of options that control this resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args GroupUserArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args GroupUserArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

GroupUser Resource Properties

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

Inputs

The GroupUser resource accepts the following input properties:

ApiManagementName string

The name of the API Management Service. Changing this forces a new resource to be created.

GroupName string

The Name of the API Management Group within the API Management Service. Changing this forces a new resource to be created.

ResourceGroupName string

The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.

UserId string

The ID of the API Management User which should be assigned to this API Management Group. Changing this forces a new resource to be created.

ApiManagementName string

The name of the API Management Service. Changing this forces a new resource to be created.

GroupName string

The Name of the API Management Group within the API Management Service. Changing this forces a new resource to be created.

ResourceGroupName string

The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.

UserId string

The ID of the API Management User which should be assigned to this API Management Group. Changing this forces a new resource to be created.

apiManagementName string

The name of the API Management Service. Changing this forces a new resource to be created.

groupName string

The Name of the API Management Group within the API Management Service. Changing this forces a new resource to be created.

resourceGroupName string

The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.

userId string

The ID of the API Management User which should be assigned to this API Management Group. Changing this forces a new resource to be created.

api_management_name str

The name of the API Management Service. Changing this forces a new resource to be created.

group_name str

The Name of the API Management Group within the API Management Service. Changing this forces a new resource to be created.

resource_group_name str

The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.

user_id str

The ID of the API Management User which should be assigned to this API Management Group. Changing this forces a new resource to be created.

Outputs

All input properties are implicitly available as output properties. Additionally, the GroupUser 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 str
The provider-assigned unique ID for this managed resource.

Look up an Existing GroupUser Resource

Get an existing GroupUser 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?: GroupUserState, opts?: CustomResourceOptions): GroupUser
static get(resource_name, id, opts=None, api_management_name=None, group_name=None, resource_group_name=None, user_id=None, __props__=None);
func GetGroupUser(ctx *Context, name string, id IDInput, state *GroupUserState, opts ...ResourceOption) (*GroupUser, error)
public static GroupUser Get(string name, Input<string> id, GroupUserState? state, CustomResourceOptions? opts = null)
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.

The following state arguments are supported:

ApiManagementName string

The name of the API Management Service. Changing this forces a new resource to be created.

GroupName string

The Name of the API Management Group within the API Management Service. Changing this forces a new resource to be created.

ResourceGroupName string

The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.

UserId string

The ID of the API Management User which should be assigned to this API Management Group. Changing this forces a new resource to be created.

ApiManagementName string

The name of the API Management Service. Changing this forces a new resource to be created.

GroupName string

The Name of the API Management Group within the API Management Service. Changing this forces a new resource to be created.

ResourceGroupName string

The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.

UserId string

The ID of the API Management User which should be assigned to this API Management Group. Changing this forces a new resource to be created.

apiManagementName string

The name of the API Management Service. Changing this forces a new resource to be created.

groupName string

The Name of the API Management Group within the API Management Service. Changing this forces a new resource to be created.

resourceGroupName string

The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.

userId string

The ID of the API Management User which should be assigned to this API Management Group. Changing this forces a new resource to be created.

api_management_name str

The name of the API Management Service. Changing this forces a new resource to be created.

group_name str

The Name of the API Management Group within the API Management Service. Changing this forces a new resource to be created.

resource_group_name str

The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.

user_id str

The ID of the API Management User which should be assigned to this API Management Group. Changing this forces a new resource to be created.

Package Details

Repository
https://github.com/pulumi/pulumi-azure
License
Apache-2.0
Notes
This Pulumi package is based on the azurerm Terraform Provider.