Product Api
Manages an API Management API Assignment to a Product.
Example Usage
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.GetApiArgs;
import com.pulumi.azure.apimanagement.inputs.GetProductArgs;
import com.pulumi.azure.apimanagement.ProductApi;
import com.pulumi.azure.apimanagement.ProductApiArgs;
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 exampleService = ApimanagementFunctions.getService(GetServiceArgs.builder()
.name("example-api")
.resourceGroupName("example-resources")
.build());
final var exampleApi = ApimanagementFunctions.getApi(GetApiArgs.builder()
.name("search-api")
.apiManagementName(exampleService.applyValue(getServiceResult -> getServiceResult.name()))
.resourceGroupName(exampleService.applyValue(getServiceResult -> getServiceResult.resourceGroupName()))
.revision("2")
.build());
final var exampleProduct = ApimanagementFunctions.getProduct(GetProductArgs.builder()
.productId("my-product")
.apiManagementName(exampleService.applyValue(getServiceResult -> getServiceResult.name()))
.resourceGroupName(exampleService.applyValue(getServiceResult -> getServiceResult.resourceGroupName()))
.build());
var exampleProductApi = new ProductApi("exampleProductApi", ProductApiArgs.builder()
.apiName(exampleApi.applyValue(getApiResult -> getApiResult.name()))
.productId(exampleProduct.applyValue(getProductResult -> getProductResult.productId()))
.apiManagementName(exampleService.applyValue(getServiceResult -> getServiceResult.name()))
.resourceGroupName(exampleService.applyValue(getServiceResult -> getServiceResult.resourceGroupName()))
.build());
}
}
Content copied to clipboard
Import
API Management Product API's can be imported using the resource id
, e.g.
$ pulumi import azure:apimanagement/productApi:ProductApi example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ApiManagement/service/service1/products/exampleId/apis/apiId
Content copied to clipboard