![JAR search and dependency download from the Maven repository](/logo.png)
com.pulumi.azure.apimanagement.kotlin.ProductGroup.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pulumi-azure-kotlin Show documentation
Show all versions of pulumi-azure-kotlin Show documentation
Build cloud applications and infrastructure by combining the safety and reliability of infrastructure as code with the power of the Kotlin programming language.
@file:Suppress("NAME_SHADOWING", "DEPRECATION")
package com.pulumi.azure.apimanagement.kotlin
import com.pulumi.core.Output
import com.pulumi.kotlin.KotlinCustomResource
import com.pulumi.kotlin.PulumiTagMarker
import com.pulumi.kotlin.ResourceMapper
import com.pulumi.kotlin.options.CustomResourceOptions
import com.pulumi.kotlin.options.CustomResourceOptionsBuilder
import com.pulumi.resources.Resource
import kotlin.Boolean
import kotlin.String
import kotlin.Suppress
import kotlin.Unit
/**
* Builder for [ProductGroup].
*/
@PulumiTagMarker
public class ProductGroupResourceBuilder internal constructor() {
public var name: String? = null
public var args: ProductGroupArgs = ProductGroupArgs()
public var opts: CustomResourceOptions = CustomResourceOptions()
/**
* @param name The _unique_ name of the resulting resource.
*/
public fun name(`value`: String) {
this.name = value
}
/**
* @param block The arguments to use to populate this resource's properties.
*/
public suspend fun args(block: suspend ProductGroupArgsBuilder.() -> Unit) {
val builder = ProductGroupArgsBuilder()
block(builder)
this.args = builder.build()
}
/**
* @param block A bag of options that control this resource's behavior.
*/
public suspend fun opts(block: suspend CustomResourceOptionsBuilder.() -> Unit) {
this.opts = com.pulumi.kotlin.options.CustomResourceOptions.opts(block)
}
internal fun build(): ProductGroup {
val builtJavaResource = com.pulumi.azure.apimanagement.ProductGroup(
this.name,
this.args.toJava(),
this.opts.toJava(),
)
return ProductGroup(builtJavaResource)
}
}
/**
* Manages an API Management Product Assignment to a Group.
* ## Example Usage
*
* ```typescript
* import * as pulumi from "@pulumi/pulumi";
* import * as azure from "@pulumi/azure";
* const example = azure.apimanagement.getService({
* name: "example-api",
* resourceGroupName: "example-resources",
* });
* const exampleGetProduct = Promise.all([example, example]).then(([example, example1]) => azure.apimanagement.getProduct({
* productId: "my-product",
* apiManagementName: example.name,
* resourceGroupName: example1.resourceGroupName,
* }));
* const exampleGetGroup = Promise.all([example, example]).then(([example, example1]) => azure.apimanagement.getGroup({
* name: "my-group",
* apiManagementName: example.name,
* resourceGroupName: example1.resourceGroupName,
* }));
* const exampleProductGroup = new azure.apimanagement.ProductGroup("example", {
* productId: exampleGetProduct.then(exampleGetProduct => exampleGetProduct.productId),
* groupName: exampleGetGroup.then(exampleGetGroup => exampleGetGroup.name),
* apiManagementName: example.then(example => example.name),
* resourceGroupName: example.then(example => example.resourceGroupName),
* });
* ```
* ```python
* import pulumi
* import pulumi_azure as azure
* example = azure.apimanagement.get_service(name="example-api",
* resource_group_name="example-resources")
* example_get_product = azure.apimanagement.get_product(product_id="my-product",
* api_management_name=example.name,
* resource_group_name=example.resource_group_name)
* example_get_group = azure.apimanagement.get_group(name="my-group",
* api_management_name=example.name,
* resource_group_name=example.resource_group_name)
* example_product_group = azure.apimanagement.ProductGroup("example",
* product_id=example_get_product.product_id,
* group_name=example_get_group.name,
* api_management_name=example.name,
* resource_group_name=example.resource_group_name)
* ```
* ```csharp
* using System.Collections.Generic;
* using System.Linq;
* using Pulumi;
* using Azure = Pulumi.Azure;
* return await Deployment.RunAsync(() =>
* {
* var example = Azure.ApiManagement.GetService.Invoke(new()
* {
* Name = "example-api",
* ResourceGroupName = "example-resources",
* });
* var exampleGetProduct = Azure.ApiManagement.GetProduct.Invoke(new()
* {
* ProductId = "my-product",
* ApiManagementName = example.Apply(getServiceResult => getServiceResult.Name),
* ResourceGroupName = example.Apply(getServiceResult => getServiceResult.ResourceGroupName),
* });
* var exampleGetGroup = Azure.ApiManagement.GetGroup.Invoke(new()
* {
* Name = "my-group",
* ApiManagementName = example.Apply(getServiceResult => getServiceResult.Name),
* ResourceGroupName = example.Apply(getServiceResult => getServiceResult.ResourceGroupName),
* });
* var exampleProductGroup = new Azure.ApiManagement.ProductGroup("example", new()
* {
* ProductId = exampleGetProduct.Apply(getProductResult => getProductResult.ProductId),
* GroupName = exampleGetGroup.Apply(getGroupResult => getGroupResult.Name),
* ApiManagementName = example.Apply(getServiceResult => getServiceResult.Name),
* ResourceGroupName = example.Apply(getServiceResult => getServiceResult.ResourceGroupName),
* });
* });
* ```
* ```go
* package main
* import (
* "github.com/pulumi/pulumi-azure/sdk/v5/go/azure/apimanagement"
* "github.com/pulumi/pulumi/sdk/v3/go/pulumi"
* )
* func main() {
* pulumi.Run(func(ctx *pulumi.Context) error {
* example, err := apimanagement.LookupService(ctx, &apimanagement.LookupServiceArgs{
* Name: "example-api",
* ResourceGroupName: "example-resources",
* }, nil)
* if err != nil {
* return err
* }
* exampleGetProduct, err := apimanagement.LookupProduct(ctx, &apimanagement.LookupProductArgs{
* ProductId: "my-product",
* ApiManagementName: example.Name,
* ResourceGroupName: example.ResourceGroupName,
* }, nil)
* if err != nil {
* return err
* }
* exampleGetGroup, err := apimanagement.LookupGroup(ctx, &apimanagement.LookupGroupArgs{
* Name: "my-group",
* ApiManagementName: example.Name,
* ResourceGroupName: example.ResourceGroupName,
* }, nil)
* if err != nil {
* return err
* }
* _, err = apimanagement.NewProductGroup(ctx, "example", &apimanagement.ProductGroupArgs{
* ProductId: pulumi.String(exampleGetProduct.ProductId),
* GroupName: pulumi.String(exampleGetGroup.Name),
* ApiManagementName: pulumi.String(example.Name),
* ResourceGroupName: pulumi.String(example.ResourceGroupName),
* })
* if err != nil {
* return err
* }
* return nil
* })
* }
* ```
* ```java
* package generated_program;
* import com.pulumi.Context;
* import com.pulumi.Pulumi;
* import com.pulumi.core.Output;
* import com.pulumi.azure.apimanagement.ApimanagementFunctions;
* import com.pulumi.azure.apimanagement.inputs.GetServiceArgs;
* import com.pulumi.azure.apimanagement.inputs.GetProductArgs;
* import com.pulumi.azure.apimanagement.inputs.GetGroupArgs;
* import com.pulumi.azure.apimanagement.ProductGroup;
* import com.pulumi.azure.apimanagement.ProductGroupArgs;
* 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 example = ApimanagementFunctions.getService(GetServiceArgs.builder()
* .name("example-api")
* .resourceGroupName("example-resources")
* .build());
* final var exampleGetProduct = ApimanagementFunctions.getProduct(GetProductArgs.builder()
* .productId("my-product")
* .apiManagementName(example.applyValue(getServiceResult -> getServiceResult.name()))
* .resourceGroupName(example.applyValue(getServiceResult -> getServiceResult.resourceGroupName()))
* .build());
* final var exampleGetGroup = ApimanagementFunctions.getGroup(GetGroupArgs.builder()
* .name("my-group")
* .apiManagementName(example.applyValue(getServiceResult -> getServiceResult.name()))
* .resourceGroupName(example.applyValue(getServiceResult -> getServiceResult.resourceGroupName()))
* .build());
* var exampleProductGroup = new ProductGroup("exampleProductGroup", ProductGroupArgs.builder()
* .productId(exampleGetProduct.applyValue(getProductResult -> getProductResult.productId()))
* .groupName(exampleGetGroup.applyValue(getGroupResult -> getGroupResult.name()))
* .apiManagementName(example.applyValue(getServiceResult -> getServiceResult.name()))
* .resourceGroupName(example.applyValue(getServiceResult -> getServiceResult.resourceGroupName()))
* .build());
* }
* }
* ```
* ```yaml
* resources:
* exampleProductGroup:
* type: azure:apimanagement:ProductGroup
* name: example
* properties:
* productId: ${exampleGetProduct.productId}
* groupName: ${exampleGetGroup.name}
* apiManagementName: ${example.name}
* resourceGroupName: ${example.resourceGroupName}
* variables:
* example:
* fn::invoke:
* Function: azure:apimanagement:getService
* Arguments:
* name: example-api
* resourceGroupName: example-resources
* exampleGetProduct:
* fn::invoke:
* Function: azure:apimanagement:getProduct
* Arguments:
* productId: my-product
* apiManagementName: ${example.name}
* resourceGroupName: ${example.resourceGroupName}
* exampleGetGroup:
* fn::invoke:
* Function: azure:apimanagement:getGroup
* Arguments:
* name: my-group
* apiManagementName: ${example.name}
* resourceGroupName: ${example.resourceGroupName}
* ```
*
* ## Import
* API Management Product Groups can be imported using the `resource id`, e.g.
* ```sh
* $ pulumi import azure:apimanagement/productGroup:ProductGroup example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ApiManagement/service/service1/products/exampleId/groups/groupId
* ```
*/
public class ProductGroup internal constructor(
override val javaResource: com.pulumi.azure.apimanagement.ProductGroup,
) : KotlinCustomResource(javaResource, ProductGroupMapper) {
/**
* The name of the API Management Service. Changing this forces a new resource to be created.
*/
public val apiManagementName: Output
get() = javaResource.apiManagementName().applyValue({ args0 -> args0 })
/**
* The Name of the API Management Group within the API Management Service. Changing this forces a new resource to be created.
*/
public val groupName: Output
get() = javaResource.groupName().applyValue({ args0 -> args0 })
/**
* The ID of the API Management Product within the API Management Service. Changing this forces a new resource to be created.
*/
public val productId: Output
get() = javaResource.productId().applyValue({ args0 -> args0 })
/**
* The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
*/
public val resourceGroupName: Output
get() = javaResource.resourceGroupName().applyValue({ args0 -> args0 })
}
public object ProductGroupMapper : ResourceMapper {
override fun supportsMappingOfType(javaResource: Resource): Boolean =
com.pulumi.azure.apimanagement.ProductGroup::class == javaResource::class
override fun map(javaResource: Resource): ProductGroup = ProductGroup(
javaResource as
com.pulumi.azure.apimanagement.ProductGroup,
)
}
/**
* @see [ProductGroup].
* @param name The _unique_ name of the resulting resource.
* @param block Builder for [ProductGroup].
*/
public suspend fun productGroup(
name: String,
block: suspend ProductGroupResourceBuilder.() -> Unit,
): ProductGroup {
val builder = ProductGroupResourceBuilder()
builder.name(name)
block(builder)
return builder.build()
}
/**
* @see [ProductGroup].
* @param name The _unique_ name of the resulting resource.
*/
public fun productGroup(name: String): ProductGroup {
val builder = ProductGroupResourceBuilder()
builder.name(name)
return builder.build()
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy