We recommend using Azure Native.
Manages an API Version Set within an API Management Workspace.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "example-resources",
location: "West Europe",
});
const exampleService = new azure.apimanagement.Service("example", {
name: "example-apim",
location: example.location,
resourceGroupName: example.name,
publisherName: "Example Publisher",
publisherEmail: "publisher@example.com",
skuName: "Premium_1",
});
const exampleWorkspace = new azure.apimanagement.Workspace("example", {
name: "example-workspace",
apiManagementId: exampleService.id,
displayName: "Example Workspace",
description: "Example workspace for development",
});
const exampleWorkspaceApiVersionSet = new azure.apimanagement.WorkspaceApiVersionSet("example", {
name: "example-version-set",
apiManagementWorkspaceId: exampleWorkspace.id,
displayName: "Example API Version Set",
versioningScheme: "Segment",
});
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_service = azure.apimanagement.Service("example",
name="example-apim",
location=example.location,
resource_group_name=example.name,
publisher_name="Example Publisher",
publisher_email="publisher@example.com",
sku_name="Premium_1")
example_workspace = azure.apimanagement.Workspace("example",
name="example-workspace",
api_management_id=example_service.id,
display_name="Example Workspace",
description="Example workspace for development")
example_workspace_api_version_set = azure.apimanagement.WorkspaceApiVersionSet("example",
name="example-version-set",
api_management_workspace_id=example_workspace.id,
display_name="Example API Version Set",
versioning_scheme="Segment")
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/apimanagement"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("example-resources"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleService, err := apimanagement.NewService(ctx, "example", &apimanagement.ServiceArgs{
Name: pulumi.String("example-apim"),
Location: example.Location,
ResourceGroupName: example.Name,
PublisherName: pulumi.String("Example Publisher"),
PublisherEmail: pulumi.String("publisher@example.com"),
SkuName: pulumi.String("Premium_1"),
})
if err != nil {
return err
}
exampleWorkspace, err := apimanagement.NewWorkspace(ctx, "example", &apimanagement.WorkspaceArgs{
Name: pulumi.String("example-workspace"),
ApiManagementId: exampleService.ID(),
DisplayName: pulumi.String("Example Workspace"),
Description: pulumi.String("Example workspace for development"),
})
if err != nil {
return err
}
_, err = apimanagement.NewWorkspaceApiVersionSet(ctx, "example", &apimanagement.WorkspaceApiVersionSetArgs{
Name: pulumi.String("example-version-set"),
ApiManagementWorkspaceId: exampleWorkspace.ID(),
DisplayName: pulumi.String("Example API Version Set"),
VersioningScheme: pulumi.String("Segment"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "example-resources",
Location = "West Europe",
});
var exampleService = new Azure.ApiManagement.Service("example", new()
{
Name = "example-apim",
Location = example.Location,
ResourceGroupName = example.Name,
PublisherName = "Example Publisher",
PublisherEmail = "publisher@example.com",
SkuName = "Premium_1",
});
var exampleWorkspace = new Azure.ApiManagement.Workspace("example", new()
{
Name = "example-workspace",
ApiManagementId = exampleService.Id,
DisplayName = "Example Workspace",
Description = "Example workspace for development",
});
var exampleWorkspaceApiVersionSet = new Azure.ApiManagement.WorkspaceApiVersionSet("example", new()
{
Name = "example-version-set",
ApiManagementWorkspaceId = exampleWorkspace.Id,
DisplayName = "Example API Version Set",
VersioningScheme = "Segment",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.apimanagement.Service;
import com.pulumi.azure.apimanagement.ServiceArgs;
import com.pulumi.azure.apimanagement.Workspace;
import com.pulumi.azure.apimanagement.WorkspaceArgs;
import com.pulumi.azure.apimanagement.WorkspaceApiVersionSet;
import com.pulumi.azure.apimanagement.WorkspaceApiVersionSetArgs;
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) {
var example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("example-resources")
.location("West Europe")
.build());
var exampleService = new Service("exampleService", ServiceArgs.builder()
.name("example-apim")
.location(example.location())
.resourceGroupName(example.name())
.publisherName("Example Publisher")
.publisherEmail("publisher@example.com")
.skuName("Premium_1")
.build());
var exampleWorkspace = new Workspace("exampleWorkspace", WorkspaceArgs.builder()
.name("example-workspace")
.apiManagementId(exampleService.id())
.displayName("Example Workspace")
.description("Example workspace for development")
.build());
var exampleWorkspaceApiVersionSet = new WorkspaceApiVersionSet("exampleWorkspaceApiVersionSet", WorkspaceApiVersionSetArgs.builder()
.name("example-version-set")
.apiManagementWorkspaceId(exampleWorkspace.id())
.displayName("Example API Version Set")
.versioningScheme("Segment")
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
exampleService:
type: azure:apimanagement:Service
name: example
properties:
name: example-apim
location: ${example.location}
resourceGroupName: ${example.name}
publisherName: Example Publisher
publisherEmail: publisher@example.com
skuName: Premium_1
exampleWorkspace:
type: azure:apimanagement:Workspace
name: example
properties:
name: example-workspace
apiManagementId: ${exampleService.id}
displayName: Example Workspace
description: Example workspace for development
exampleWorkspaceApiVersionSet:
type: azure:apimanagement:WorkspaceApiVersionSet
name: example
properties:
name: example-version-set
apiManagementWorkspaceId: ${exampleWorkspace.id}
displayName: Example API Version Set
versioningScheme: Segment
API Providers
This resource uses the following Azure API Providers:
Microsoft.ApiManagement- 2024-05-01
Create WorkspaceApiVersionSet Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new WorkspaceApiVersionSet(name: string, args: WorkspaceApiVersionSetArgs, opts?: CustomResourceOptions);@overload
def WorkspaceApiVersionSet(resource_name: str,
args: WorkspaceApiVersionSetArgs,
opts: Optional[ResourceOptions] = None)
@overload
def WorkspaceApiVersionSet(resource_name: str,
opts: Optional[ResourceOptions] = None,
api_management_workspace_id: Optional[str] = None,
display_name: Optional[str] = None,
versioning_scheme: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None,
version_header_name: Optional[str] = None,
version_query_name: Optional[str] = None)func NewWorkspaceApiVersionSet(ctx *Context, name string, args WorkspaceApiVersionSetArgs, opts ...ResourceOption) (*WorkspaceApiVersionSet, error)public WorkspaceApiVersionSet(string name, WorkspaceApiVersionSetArgs args, CustomResourceOptions? opts = null)
public WorkspaceApiVersionSet(String name, WorkspaceApiVersionSetArgs args)
public WorkspaceApiVersionSet(String name, WorkspaceApiVersionSetArgs args, CustomResourceOptions options)
type: azure:apimanagement:WorkspaceApiVersionSet
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args WorkspaceApiVersionSetArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args WorkspaceApiVersionSetArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args WorkspaceApiVersionSetArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args WorkspaceApiVersionSetArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args WorkspaceApiVersionSetArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var workspaceApiVersionSetResource = new Azure.ApiManagement.WorkspaceApiVersionSet("workspaceApiVersionSetResource", new()
{
ApiManagementWorkspaceId = "string",
DisplayName = "string",
VersioningScheme = "string",
Description = "string",
Name = "string",
VersionHeaderName = "string",
VersionQueryName = "string",
});
example, err := apimanagement.NewWorkspaceApiVersionSet(ctx, "workspaceApiVersionSetResource", &apimanagement.WorkspaceApiVersionSetArgs{
ApiManagementWorkspaceId: pulumi.String("string"),
DisplayName: pulumi.String("string"),
VersioningScheme: pulumi.String("string"),
Description: pulumi.String("string"),
Name: pulumi.String("string"),
VersionHeaderName: pulumi.String("string"),
VersionQueryName: pulumi.String("string"),
})
var workspaceApiVersionSetResource = new WorkspaceApiVersionSet("workspaceApiVersionSetResource", WorkspaceApiVersionSetArgs.builder()
.apiManagementWorkspaceId("string")
.displayName("string")
.versioningScheme("string")
.description("string")
.name("string")
.versionHeaderName("string")
.versionQueryName("string")
.build());
workspace_api_version_set_resource = azure.apimanagement.WorkspaceApiVersionSet("workspaceApiVersionSetResource",
api_management_workspace_id="string",
display_name="string",
versioning_scheme="string",
description="string",
name="string",
version_header_name="string",
version_query_name="string")
const workspaceApiVersionSetResource = new azure.apimanagement.WorkspaceApiVersionSet("workspaceApiVersionSetResource", {
apiManagementWorkspaceId: "string",
displayName: "string",
versioningScheme: "string",
description: "string",
name: "string",
versionHeaderName: "string",
versionQueryName: "string",
});
type: azure:apimanagement:WorkspaceApiVersionSet
properties:
apiManagementWorkspaceId: string
description: string
displayName: string
name: string
versionHeaderName: string
versionQueryName: string
versioningScheme: string
WorkspaceApiVersionSet Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The WorkspaceApiVersionSet resource accepts the following input properties:
- Api
Management stringWorkspace Id - Specifies the ID of the API Management Workspace. Changing this forces a new resource to be created.
- Display
Name string - Specifies the display name of the API Management Workspace API Version Set.
- Versioning
Scheme string - Specifies where in a request that the API Version should be read from. Possible values are
Header,QueryandSegment. - Description string
- Specifies the description of the API Management Workspace API Version Set.
- Name string
- Specifies the name of the API Management Workspace API Version Set. Changing this forces a new resource to be created.
- Version
Header stringName - Specifies the name of the header to read from inbound requests to determine the API version.
- Version
Query stringName - Specifies the name of the query string parameter to read from inbound requests to determine the API version.
- Api
Management stringWorkspace Id - Specifies the ID of the API Management Workspace. Changing this forces a new resource to be created.
- Display
Name string - Specifies the display name of the API Management Workspace API Version Set.
- Versioning
Scheme string - Specifies where in a request that the API Version should be read from. Possible values are
Header,QueryandSegment. - Description string
- Specifies the description of the API Management Workspace API Version Set.
- Name string
- Specifies the name of the API Management Workspace API Version Set. Changing this forces a new resource to be created.
- Version
Header stringName - Specifies the name of the header to read from inbound requests to determine the API version.
- Version
Query stringName - Specifies the name of the query string parameter to read from inbound requests to determine the API version.
- api
Management StringWorkspace Id - Specifies the ID of the API Management Workspace. Changing this forces a new resource to be created.
- display
Name String - Specifies the display name of the API Management Workspace API Version Set.
- versioning
Scheme String - Specifies where in a request that the API Version should be read from. Possible values are
Header,QueryandSegment. - description String
- Specifies the description of the API Management Workspace API Version Set.
- name String
- Specifies the name of the API Management Workspace API Version Set. Changing this forces a new resource to be created.
- version
Header StringName - Specifies the name of the header to read from inbound requests to determine the API version.
- version
Query StringName - Specifies the name of the query string parameter to read from inbound requests to determine the API version.
- api
Management stringWorkspace Id - Specifies the ID of the API Management Workspace. Changing this forces a new resource to be created.
- display
Name string - Specifies the display name of the API Management Workspace API Version Set.
- versioning
Scheme string - Specifies where in a request that the API Version should be read from. Possible values are
Header,QueryandSegment. - description string
- Specifies the description of the API Management Workspace API Version Set.
- name string
- Specifies the name of the API Management Workspace API Version Set. Changing this forces a new resource to be created.
- version
Header stringName - Specifies the name of the header to read from inbound requests to determine the API version.
- version
Query stringName - Specifies the name of the query string parameter to read from inbound requests to determine the API version.
- api_
management_ strworkspace_ id - Specifies the ID of the API Management Workspace. Changing this forces a new resource to be created.
- display_
name str - Specifies the display name of the API Management Workspace API Version Set.
- versioning_
scheme str - Specifies where in a request that the API Version should be read from. Possible values are
Header,QueryandSegment. - description str
- Specifies the description of the API Management Workspace API Version Set.
- name str
- Specifies the name of the API Management Workspace API Version Set. Changing this forces a new resource to be created.
- version_
header_ strname - Specifies the name of the header to read from inbound requests to determine the API version.
- version_
query_ strname - Specifies the name of the query string parameter to read from inbound requests to determine the API version.
- api
Management StringWorkspace Id - Specifies the ID of the API Management Workspace. Changing this forces a new resource to be created.
- display
Name String - Specifies the display name of the API Management Workspace API Version Set.
- versioning
Scheme String - Specifies where in a request that the API Version should be read from. Possible values are
Header,QueryandSegment. - description String
- Specifies the description of the API Management Workspace API Version Set.
- name String
- Specifies the name of the API Management Workspace API Version Set. Changing this forces a new resource to be created.
- version
Header StringName - Specifies the name of the header to read from inbound requests to determine the API version.
- version
Query StringName - Specifies the name of the query string parameter to read from inbound requests to determine the API version.
Outputs
All input properties are implicitly available as output properties. Additionally, the WorkspaceApiVersionSet 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 string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing WorkspaceApiVersionSet Resource
Get an existing WorkspaceApiVersionSet 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?: WorkspaceApiVersionSetState, opts?: CustomResourceOptions): WorkspaceApiVersionSet@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
api_management_workspace_id: Optional[str] = None,
description: Optional[str] = None,
display_name: Optional[str] = None,
name: Optional[str] = None,
version_header_name: Optional[str] = None,
version_query_name: Optional[str] = None,
versioning_scheme: Optional[str] = None) -> WorkspaceApiVersionSetfunc GetWorkspaceApiVersionSet(ctx *Context, name string, id IDInput, state *WorkspaceApiVersionSetState, opts ...ResourceOption) (*WorkspaceApiVersionSet, error)public static WorkspaceApiVersionSet Get(string name, Input<string> id, WorkspaceApiVersionSetState? state, CustomResourceOptions? opts = null)public static WorkspaceApiVersionSet get(String name, Output<String> id, WorkspaceApiVersionSetState state, CustomResourceOptions options)resources: _: type: azure:apimanagement:WorkspaceApiVersionSet get: id: ${id}- 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.
- 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.
- Api
Management stringWorkspace Id - Specifies the ID of the API Management Workspace. Changing this forces a new resource to be created.
- Description string
- Specifies the description of the API Management Workspace API Version Set.
- Display
Name string - Specifies the display name of the API Management Workspace API Version Set.
- Name string
- Specifies the name of the API Management Workspace API Version Set. Changing this forces a new resource to be created.
- Version
Header stringName - Specifies the name of the header to read from inbound requests to determine the API version.
- Version
Query stringName - Specifies the name of the query string parameter to read from inbound requests to determine the API version.
- Versioning
Scheme string - Specifies where in a request that the API Version should be read from. Possible values are
Header,QueryandSegment.
- Api
Management stringWorkspace Id - Specifies the ID of the API Management Workspace. Changing this forces a new resource to be created.
- Description string
- Specifies the description of the API Management Workspace API Version Set.
- Display
Name string - Specifies the display name of the API Management Workspace API Version Set.
- Name string
- Specifies the name of the API Management Workspace API Version Set. Changing this forces a new resource to be created.
- Version
Header stringName - Specifies the name of the header to read from inbound requests to determine the API version.
- Version
Query stringName - Specifies the name of the query string parameter to read from inbound requests to determine the API version.
- Versioning
Scheme string - Specifies where in a request that the API Version should be read from. Possible values are
Header,QueryandSegment.
- api
Management StringWorkspace Id - Specifies the ID of the API Management Workspace. Changing this forces a new resource to be created.
- description String
- Specifies the description of the API Management Workspace API Version Set.
- display
Name String - Specifies the display name of the API Management Workspace API Version Set.
- name String
- Specifies the name of the API Management Workspace API Version Set. Changing this forces a new resource to be created.
- version
Header StringName - Specifies the name of the header to read from inbound requests to determine the API version.
- version
Query StringName - Specifies the name of the query string parameter to read from inbound requests to determine the API version.
- versioning
Scheme String - Specifies where in a request that the API Version should be read from. Possible values are
Header,QueryandSegment.
- api
Management stringWorkspace Id - Specifies the ID of the API Management Workspace. Changing this forces a new resource to be created.
- description string
- Specifies the description of the API Management Workspace API Version Set.
- display
Name string - Specifies the display name of the API Management Workspace API Version Set.
- name string
- Specifies the name of the API Management Workspace API Version Set. Changing this forces a new resource to be created.
- version
Header stringName - Specifies the name of the header to read from inbound requests to determine the API version.
- version
Query stringName - Specifies the name of the query string parameter to read from inbound requests to determine the API version.
- versioning
Scheme string - Specifies where in a request that the API Version should be read from. Possible values are
Header,QueryandSegment.
- api_
management_ strworkspace_ id - Specifies the ID of the API Management Workspace. Changing this forces a new resource to be created.
- description str
- Specifies the description of the API Management Workspace API Version Set.
- display_
name str - Specifies the display name of the API Management Workspace API Version Set.
- name str
- Specifies the name of the API Management Workspace API Version Set. Changing this forces a new resource to be created.
- version_
header_ strname - Specifies the name of the header to read from inbound requests to determine the API version.
- version_
query_ strname - Specifies the name of the query string parameter to read from inbound requests to determine the API version.
- versioning_
scheme str - Specifies where in a request that the API Version should be read from. Possible values are
Header,QueryandSegment.
- api
Management StringWorkspace Id - Specifies the ID of the API Management Workspace. Changing this forces a new resource to be created.
- description String
- Specifies the description of the API Management Workspace API Version Set.
- display
Name String - Specifies the display name of the API Management Workspace API Version Set.
- name String
- Specifies the name of the API Management Workspace API Version Set. Changing this forces a new resource to be created.
- version
Header StringName - Specifies the name of the header to read from inbound requests to determine the API version.
- version
Query StringName - Specifies the name of the query string parameter to read from inbound requests to determine the API version.
- versioning
Scheme String - Specifies where in a request that the API Version should be read from. Possible values are
Header,QueryandSegment.
Import
API Management Workspace API Version Sets can be imported using the resource id, e.g.
$ pulumi import azure:apimanagement/workspaceApiVersionSet:WorkspaceApiVersionSet example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ApiManagement/service/service1/workspaces/workspace1/apiVersionSets/set1
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Classic pulumi/pulumi-azure
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azurermTerraform Provider.
