We recommend using Azure Native.
azure.apimanagement.Workspace
Explore with Pulumi AI
Manages an API Management Workspace.
Note: This resource is currently available only when using the Classic Premium SKU of
azure.apimanagement.Service
. For more details, refer to Federated API Management with Workspaces.
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-apimanagement",
location: example.location,
resourceGroupName: example.name,
publisherName: "pub1",
publisherEmail: "pub1@email.com",
skuName: "Premium_1",
});
const exampleWorkspace = new azure.apimanagement.Workspace("example", {
name: "example-workspace",
apiManagementId: exampleService.id,
displayName: "my workspace",
});
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-apimanagement",
location=example.location,
resource_group_name=example.name,
publisher_name="pub1",
publisher_email="pub1@email.com",
sku_name="Premium_1")
example_workspace = azure.apimanagement.Workspace("example",
name="example-workspace",
api_management_id=example_service.id,
display_name="my workspace")
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-apimanagement"),
Location: example.Location,
ResourceGroupName: example.Name,
PublisherName: pulumi.String("pub1"),
PublisherEmail: pulumi.String("pub1@email.com"),
SkuName: pulumi.String("Premium_1"),
})
if err != nil {
return err
}
_, err = apimanagement.NewWorkspace(ctx, "example", &apimanagement.WorkspaceArgs{
Name: pulumi.String("example-workspace"),
ApiManagementId: exampleService.ID(),
DisplayName: pulumi.String("my workspace"),
})
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-apimanagement",
Location = example.Location,
ResourceGroupName = example.Name,
PublisherName = "pub1",
PublisherEmail = "pub1@email.com",
SkuName = "Premium_1",
});
var exampleWorkspace = new Azure.ApiManagement.Workspace("example", new()
{
Name = "example-workspace",
ApiManagementId = exampleService.Id,
DisplayName = "my workspace",
});
});
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 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-apimanagement")
.location(example.location())
.resourceGroupName(example.name())
.publisherName("pub1")
.publisherEmail("pub1@email.com")
.skuName("Premium_1")
.build());
var exampleWorkspace = new Workspace("exampleWorkspace", WorkspaceArgs.builder()
.name("example-workspace")
.apiManagementId(exampleService.id())
.displayName("my workspace")
.build());
}
}
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
exampleService:
type: azure:apimanagement:Service
name: example
properties:
name: example-apimanagement
location: ${example.location}
resourceGroupName: ${example.name}
publisherName: pub1
publisherEmail: pub1@email.com
skuName: Premium_1
exampleWorkspace:
type: azure:apimanagement:Workspace
name: example
properties:
name: example-workspace
apiManagementId: ${exampleService.id}
displayName: my workspace
API Providers
This resource uses the following Azure API Providers:
Microsoft.ApiManagement
- 2024-05-01
Create Workspace Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Workspace(name: string, args: WorkspaceArgs, opts?: CustomResourceOptions);
@overload
def Workspace(resource_name: str,
args: WorkspaceArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Workspace(resource_name: str,
opts: Optional[ResourceOptions] = None,
api_management_id: Optional[str] = None,
display_name: Optional[str] = None,
description: Optional[str] = None,
name: Optional[str] = None)
func NewWorkspace(ctx *Context, name string, args WorkspaceArgs, opts ...ResourceOption) (*Workspace, error)
public Workspace(string name, WorkspaceArgs args, CustomResourceOptions? opts = null)
public Workspace(String name, WorkspaceArgs args)
public Workspace(String name, WorkspaceArgs args, CustomResourceOptions options)
type: azure:apimanagement:Workspace
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 WorkspaceArgs
- 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 WorkspaceArgs
- 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 WorkspaceArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args WorkspaceArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args WorkspaceArgs
- 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 workspaceResource = new Azure.ApiManagement.Workspace("workspaceResource", new()
{
ApiManagementId = "string",
DisplayName = "string",
Description = "string",
Name = "string",
});
example, err := apimanagement.NewWorkspace(ctx, "workspaceResource", &apimanagement.WorkspaceArgs{
ApiManagementId: pulumi.String("string"),
DisplayName: pulumi.String("string"),
Description: pulumi.String("string"),
Name: pulumi.String("string"),
})
var workspaceResource = new com.pulumi.azure.apimanagement.Workspace("workspaceResource", com.pulumi.azure.apimanagement.WorkspaceArgs.builder()
.apiManagementId("string")
.displayName("string")
.description("string")
.name("string")
.build());
workspace_resource = azure.apimanagement.Workspace("workspaceResource",
api_management_id="string",
display_name="string",
description="string",
name="string")
const workspaceResource = new azure.apimanagement.Workspace("workspaceResource", {
apiManagementId: "string",
displayName: "string",
description: "string",
name: "string",
});
type: azure:apimanagement:Workspace
properties:
apiManagementId: string
description: string
displayName: string
name: string
Workspace 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 Workspace resource accepts the following input properties:
- Api
Management stringId - Specifies the ID of the API Management Service in which the API Management Workspace should be created. Changing this forces a new resource to be created.
- Display
Name string - The display name of the API Management Workspace.
- Description string
- The description of the API Management Workspace.
- Name string
- Specifies the name which should be used for this API Management Workspace. Changing this forces a new resource to be created.
- Api
Management stringId - Specifies the ID of the API Management Service in which the API Management Workspace should be created. Changing this forces a new resource to be created.
- Display
Name string - The display name of the API Management Workspace.
- Description string
- The description of the API Management Workspace.
- Name string
- Specifies the name which should be used for this API Management Workspace. Changing this forces a new resource to be created.
- api
Management StringId - Specifies the ID of the API Management Service in which the API Management Workspace should be created. Changing this forces a new resource to be created.
- display
Name String - The display name of the API Management Workspace.
- description String
- The description of the API Management Workspace.
- name String
- Specifies the name which should be used for this API Management Workspace. Changing this forces a new resource to be created.
- api
Management stringId - Specifies the ID of the API Management Service in which the API Management Workspace should be created. Changing this forces a new resource to be created.
- display
Name string - The display name of the API Management Workspace.
- description string
- The description of the API Management Workspace.
- name string
- Specifies the name which should be used for this API Management Workspace. Changing this forces a new resource to be created.
- api_
management_ strid - Specifies the ID of the API Management Service in which the API Management Workspace should be created. Changing this forces a new resource to be created.
- display_
name str - The display name of the API Management Workspace.
- description str
- The description of the API Management Workspace.
- name str
- Specifies the name which should be used for this API Management Workspace. Changing this forces a new resource to be created.
- api
Management StringId - Specifies the ID of the API Management Service in which the API Management Workspace should be created. Changing this forces a new resource to be created.
- display
Name String - The display name of the API Management Workspace.
- description String
- The description of the API Management Workspace.
- name String
- Specifies the name which should be used for this API Management Workspace. Changing this forces a new resource to be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the Workspace 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 Workspace Resource
Get an existing Workspace 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?: WorkspaceState, opts?: CustomResourceOptions): Workspace
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
api_management_id: Optional[str] = None,
description: Optional[str] = None,
display_name: Optional[str] = None,
name: Optional[str] = None) -> Workspace
func GetWorkspace(ctx *Context, name string, id IDInput, state *WorkspaceState, opts ...ResourceOption) (*Workspace, error)
public static Workspace Get(string name, Input<string> id, WorkspaceState? state, CustomResourceOptions? opts = null)
public static Workspace get(String name, Output<String> id, WorkspaceState state, CustomResourceOptions options)
resources: _: type: azure:apimanagement:Workspace 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 stringId - Specifies the ID of the API Management Service in which the API Management Workspace should be created. Changing this forces a new resource to be created.
- Description string
- The description of the API Management Workspace.
- Display
Name string - The display name of the API Management Workspace.
- Name string
- Specifies the name which should be used for this API Management Workspace. Changing this forces a new resource to be created.
- Api
Management stringId - Specifies the ID of the API Management Service in which the API Management Workspace should be created. Changing this forces a new resource to be created.
- Description string
- The description of the API Management Workspace.
- Display
Name string - The display name of the API Management Workspace.
- Name string
- Specifies the name which should be used for this API Management Workspace. Changing this forces a new resource to be created.
- api
Management StringId - Specifies the ID of the API Management Service in which the API Management Workspace should be created. Changing this forces a new resource to be created.
- description String
- The description of the API Management Workspace.
- display
Name String - The display name of the API Management Workspace.
- name String
- Specifies the name which should be used for this API Management Workspace. Changing this forces a new resource to be created.
- api
Management stringId - Specifies the ID of the API Management Service in which the API Management Workspace should be created. Changing this forces a new resource to be created.
- description string
- The description of the API Management Workspace.
- display
Name string - The display name of the API Management Workspace.
- name string
- Specifies the name which should be used for this API Management Workspace. Changing this forces a new resource to be created.
- api_
management_ strid - Specifies the ID of the API Management Service in which the API Management Workspace should be created. Changing this forces a new resource to be created.
- description str
- The description of the API Management Workspace.
- display_
name str - The display name of the API Management Workspace.
- name str
- Specifies the name which should be used for this API Management Workspace. Changing this forces a new resource to be created.
- api
Management StringId - Specifies the ID of the API Management Service in which the API Management Workspace should be created. Changing this forces a new resource to be created.
- description String
- The description of the API Management Workspace.
- display
Name String - The display name of the API Management Workspace.
- name String
- Specifies the name which should be used for this API Management Workspace. Changing this forces a new resource to be created.
Import
API Management Workspace can be imported using the resource id
, e.g.
$ pulumi import azure:apimanagement/workspace:Workspace example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.ApiManagement/service/service1/workspaces/workspace1
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
azurerm
Terraform Provider.