ProductGroup

Manages an API Management Product Assignment to a Group.

Example Usage

using Pulumi;
using Azure = Pulumi.Azure;

class MyStack : Stack
{
    public MyStack()
    {
        var exampleService = Output.Create(Azure.ApiManagement.GetService.InvokeAsync(new Azure.ApiManagement.GetServiceArgs
        {
            Name = "example-api",
            ResourceGroupName = "example-resources",
        }));
        var exampleProduct = Output.Tuple(exampleService, exampleService).Apply(values =>
        {
            var exampleService = values.Item1;
            var exampleService1 = values.Item2;
            return Output.Create(Azure.ApiManagement.GetProduct.InvokeAsync(new Azure.ApiManagement.GetProductArgs
            {
                ProductId = "my-product",
                ApiManagementName = exampleService.Name,
                ResourceGroupName = exampleService1.ResourceGroupName,
            }));
        });
        var exampleGroup = Output.Tuple(exampleService, exampleService).Apply(values =>
        {
            var exampleService = values.Item1;
            var exampleService1 = values.Item2;
            return Output.Create(Azure.ApiManagement.GetGroup.InvokeAsync(new Azure.ApiManagement.GetGroupArgs
            {
                Name = "my-group",
                ApiManagementName = exampleService.Name,
                ResourceGroupName = exampleService1.ResourceGroupName,
            }));
        });
        var exampleProductGroup = new Azure.ApiManagement.ProductGroup("exampleProductGroup", new Azure.ApiManagement.ProductGroupArgs
        {
            ProductId = exampleProduct.Apply(exampleProduct => exampleProduct.ProductId),
            GroupName = exampleGroup.Apply(exampleGroup => exampleGroup.Name),
            ApiManagementName = exampleService.Apply(exampleService => exampleService.Name),
            ResourceGroupName = exampleService.Apply(exampleService => exampleService.ResourceGroupName),
        });
    }

}
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 {
        exampleService, err := apimanagement.LookupService(ctx, &apimanagement.LookupServiceArgs{
            Name:              "example-api",
            ResourceGroupName: "example-resources",
        }, nil)
        if err != nil {
            return err
        }
        exampleProduct, err := apimanagement.LookupProduct(ctx, &apimanagement.LookupProductArgs{
            ProductId:         "my-product",
            ApiManagementName: exampleService.Name,
            ResourceGroupName: exampleService.ResourceGroupName,
        }, nil)
        if err != nil {
            return err
        }
        exampleGroup, err := apimanagement.LookupGroup(ctx, &apimanagement.LookupGroupArgs{
            Name:              "my-group",
            ApiManagementName: exampleService.Name,
            ResourceGroupName: exampleService.ResourceGroupName,
        }, nil)
        if err != nil {
            return err
        }
        _, err = apimanagement.NewProductGroup(ctx, "exampleProductGroup", &apimanagement.ProductGroupArgs{
            ProductId:         pulumi.String(exampleProduct.ProductId),
            GroupName:         pulumi.String(exampleGroup.Name),
            ApiManagementName: pulumi.String(exampleService.Name),
            ResourceGroupName: pulumi.String(exampleService.ResourceGroupName),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_azure as azure

example_service = azure.apimanagement.get_service(name="example-api",
    resource_group_name="example-resources")
example_product = azure.apimanagement.get_product(product_id="my-product",
    api_management_name=example_service.name,
    resource_group_name=example_service.resource_group_name)
example_group = azure.apimanagement.get_group(name="my-group",
    api_management_name=example_service.name,
    resource_group_name=example_service.resource_group_name)
example_product_group = azure.apimanagement.ProductGroup("exampleProductGroup",
    product_id=example_product.product_id,
    group_name=example_group.name,
    api_management_name=example_service.name,
    resource_group_name=example_service.resource_group_name)
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleService = azure.apimanagement.getService({
    name: "example-api",
    resourceGroupName: "example-resources",
});
const exampleProduct = Promise.all([exampleService, exampleService]).then(([exampleService, exampleService1]) => azure.apimanagement.getProduct({
    productId: "my-product",
    apiManagementName: exampleService.name,
    resourceGroupName: exampleService1.resourceGroupName,
}));
const exampleGroup = Promise.all([exampleService, exampleService]).then(([exampleService, exampleService1]) => azure.apimanagement.getGroup({
    name: "my-group",
    apiManagementName: exampleService.name,
    resourceGroupName: exampleService1.resourceGroupName,
}));
const exampleProductGroup = new azure.apimanagement.ProductGroup("exampleProductGroup", {
    productId: exampleProduct.then(exampleProduct => exampleProduct.productId),
    groupName: exampleGroup.then(exampleGroup => exampleGroup.name),
    apiManagementName: exampleService.then(exampleService => exampleService.name),
    resourceGroupName: exampleService.then(exampleService => exampleService.resourceGroupName),
});

Create a ProductGroup Resource

def ProductGroup(resource_name, opts=None, api_management_name=None, group_name=None, product_id=None, resource_group_name=None, __props__=None);
func NewProductGroup(ctx *Context, name string, args ProductGroupArgs, opts ...ResourceOption) (*ProductGroup, error)
name string
The unique name of the resource.
args ProductGroupArgs
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 ProductGroupArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ProductGroupArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.

ProductGroup Resource Properties

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

Inputs

The ProductGroup 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.

ProductId string

The ID of the API Management Product 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.

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.

ProductId string

The ID of the API Management Product 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.

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.

productId string

The ID of the API Management Product 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.

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.

product_id str

The ID of the API Management Product 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.

Outputs

All input properties are implicitly available as output properties. Additionally, the ProductGroup 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 ProductGroup Resource

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

ProductId string

The ID of the API Management Product 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.

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.

ProductId string

The ID of the API Management Product 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.

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.

productId string

The ID of the API Management Product 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.

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.

product_id str

The ID of the API Management Product 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.

Package Details

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