ProductApi
Manages an API Management API Assignment to a Product.
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 exampleApi = Output.Tuple(exampleService, exampleService).Apply(values =>
{
var exampleService = values.Item1;
var exampleService1 = values.Item2;
return Output.Create(Azure.ApiManagement.GetApi.InvokeAsync(new Azure.ApiManagement.GetApiArgs
{
Name = "search-api",
ApiManagementName = exampleService.Name,
ResourceGroupName = exampleService1.ResourceGroupName,
Revision = "2",
}));
});
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 exampleProductApi = new Azure.ApiManagement.ProductApi("exampleProductApi", new Azure.ApiManagement.ProductApiArgs
{
ApiName = exampleApi.Apply(exampleApi => exampleApi.Name),
ProductId = exampleProduct.Apply(exampleProduct => exampleProduct.ProductId),
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
}
exampleApi, err := apimanagement.LookupApi(ctx, &apimanagement.LookupApiArgs{
Name: "search-api",
ApiManagementName: exampleService.Name,
ResourceGroupName: exampleService.ResourceGroupName,
Revision: "2",
}, 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
}
_, err = apimanagement.NewProductApi(ctx, "exampleProductApi", &apimanagement.ProductApiArgs{
ApiName: pulumi.String(exampleApi.Name),
ProductId: pulumi.String(exampleProduct.ProductId),
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_api = azure.apimanagement.get_api(name="search-api",
api_management_name=example_service.name,
resource_group_name=example_service.resource_group_name,
revision="2")
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_product_api = azure.apimanagement.ProductApi("exampleProductApi",
api_name=example_api.name,
product_id=example_product.product_id,
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 exampleApi = Promise.all([exampleService, exampleService]).then(([exampleService, exampleService1]) => azure.apimanagement.getApi({
name: "search-api",
apiManagementName: exampleService.name,
resourceGroupName: exampleService1.resourceGroupName,
revision: "2",
}));
const exampleProduct = Promise.all([exampleService, exampleService]).then(([exampleService, exampleService1]) => azure.apimanagement.getProduct({
productId: "my-product",
apiManagementName: exampleService.name,
resourceGroupName: exampleService1.resourceGroupName,
}));
const exampleProductApi = new azure.apimanagement.ProductApi("exampleProductApi", {
apiName: exampleApi.then(exampleApi => exampleApi.name),
productId: exampleProduct.then(exampleProduct => exampleProduct.productId),
apiManagementName: exampleService.then(exampleService => exampleService.name),
resourceGroupName: exampleService.then(exampleService => exampleService.resourceGroupName),
});Create a ProductApi Resource
new ProductApi(name: string, args: ProductApiArgs, opts?: CustomResourceOptions);def ProductApi(resource_name, opts=None, api_management_name=None, api_name=None, product_id=None, resource_group_name=None, __props__=None);func NewProductApi(ctx *Context, name string, args ProductApiArgs, opts ...ResourceOption) (*ProductApi, error)public ProductApi(string name, ProductApiArgs args, CustomResourceOptions? opts = null)- name string
- The unique name of the resource.
- args ProductApiArgs
- 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 ProductApiArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ProductApiArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
ProductApi Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.
Inputs
The ProductApi resource accepts the following input properties:
- Api
Management stringName The name of the API Management Service. Changing this forces a new resource to be created.
- Api
Name string The Name of the API Management API within the API Management Service. Changing this forces a new resource to be created.
- Product
Id string The ID of the API Management Product within the API Management Service. Changing this forces a new resource to be created.
- Resource
Group stringName The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
- Api
Management stringName The name of the API Management Service. Changing this forces a new resource to be created.
- Api
Name string The Name of the API Management API within the API Management Service. Changing this forces a new resource to be created.
- Product
Id string The ID of the API Management Product within the API Management Service. Changing this forces a new resource to be created.
- Resource
Group stringName The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
- api
Management stringName The name of the API Management Service. Changing this forces a new resource to be created.
- api
Name string The Name of the API Management API within the API Management Service. Changing this forces a new resource to be created.
- product
Id string The ID of the API Management Product within the API Management Service. Changing this forces a new resource to be created.
- resource
Group stringName The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
- api_
management_ strname The name of the API Management Service. Changing this forces a new resource to be created.
- api_
name str The Name of the API Management API 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_ strname 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 ProductApi resource produces the following output properties:
Look up an Existing ProductApi Resource
Get an existing ProductApi 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?: ProductApiState, opts?: CustomResourceOptions): ProductApistatic get(resource_name, id, opts=None, api_management_name=None, api_name=None, product_id=None, resource_group_name=None, __props__=None);func GetProductApi(ctx *Context, name string, id IDInput, state *ProductApiState, opts ...ResourceOption) (*ProductApi, error)public static ProductApi Get(string name, Input<string> id, ProductApiState? 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:
- Api
Management stringName The name of the API Management Service. Changing this forces a new resource to be created.
- Api
Name string The Name of the API Management API within the API Management Service. Changing this forces a new resource to be created.
- Product
Id string The ID of the API Management Product within the API Management Service. Changing this forces a new resource to be created.
- Resource
Group stringName The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
- Api
Management stringName The name of the API Management Service. Changing this forces a new resource to be created.
- Api
Name string The Name of the API Management API within the API Management Service. Changing this forces a new resource to be created.
- Product
Id string The ID of the API Management Product within the API Management Service. Changing this forces a new resource to be created.
- Resource
Group stringName The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
- api
Management stringName The name of the API Management Service. Changing this forces a new resource to be created.
- api
Name string The Name of the API Management API within the API Management Service. Changing this forces a new resource to be created.
- product
Id string The ID of the API Management Product within the API Management Service. Changing this forces a new resource to be created.
- resource
Group stringName The name of the Resource Group in which the API Management Service exists. Changing this forces a new resource to be created.
- api_
management_ strname The name of the API Management Service. Changing this forces a new resource to be created.
- api_
name str The Name of the API Management API 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_ strname 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
azurermTerraform Provider.