ApiSourceArgs

data class ApiSourceArgs(val apiSourceName: Output<String>? = null, val azureApiManagementSource: Output<AzureApiManagementSourceArgs>? = null, val importSpecification: Output<Either<String, ImportSpecificationOptions>>? = null, val resourceGroupName: Output<String>? = null, val serviceName: Output<String>? = null, val targetEnvironmentId: Output<String>? = null, val targetLifecycleStage: Output<Either<String, LifecycleStage>>? = null, val workspaceName: Output<String>? = null) : ConvertibleToJava<ApiSourceArgs>

API source entity. Uses Azure REST API version 2024-06-01-preview.

Example Usage

ApiSources_CreateOrUpdate

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var apiSource = new AzureNative.ApiCenter.ApiSource("apiSource", new()
{
ApiSourceName = "contoso-api-management",
AzureApiManagementSource = new AzureNative.ApiCenter.Inputs.AzureApiManagementSourceArgs
{
MsiResourceId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity",
ResourceId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiManagement/service/contoso",
},
ImportSpecification = AzureNative.ApiCenter.ImportSpecificationOptions.OnDemand,
ResourceGroupName = "contoso-resources",
ServiceName = "contoso",
TargetEnvironmentId = "/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/environments/azure-api-management",
TargetLifecycleStage = AzureNative.ApiCenter.LifecycleStage.Design,
WorkspaceName = "default",
});
});
package main
import (
apicenter "github.com/pulumi/pulumi-azure-native-sdk/apicenter/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := apicenter.NewApiSource(ctx, "apiSource", &apicenter.ApiSourceArgs{
ApiSourceName: pulumi.String("contoso-api-management"),
AzureApiManagementSource: &apicenter.AzureApiManagementSourceArgs{
MsiResourceId: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity"),
ResourceId: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiManagement/service/contoso"),
},
ImportSpecification: pulumi.String(apicenter.ImportSpecificationOptionsOnDemand),
ResourceGroupName: pulumi.String("contoso-resources"),
ServiceName: pulumi.String("contoso"),
TargetEnvironmentId: pulumi.String("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/environments/azure-api-management"),
TargetLifecycleStage: pulumi.String(apicenter.LifecycleStageDesign),
WorkspaceName: pulumi.String("default"),
})
if err != nil {
return err
}
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azurenative.apicenter.ApiSource;
import com.pulumi.azurenative.apicenter.ApiSourceArgs;
import com.pulumi.azurenative.apicenter.inputs.AzureApiManagementSourceArgs;
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 apiSource = new ApiSource("apiSource", ApiSourceArgs.builder()
.apiSourceName("contoso-api-management")
.azureApiManagementSource(AzureApiManagementSourceArgs.builder()
.msiResourceId("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ManagedIdentity/userAssignedIdentities/contoso-identity")
.resourceId("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiManagement/service/contoso")
.build())
.importSpecification("ondemand")
.resourceGroupName("contoso-resources")
.serviceName("contoso")
.targetEnvironmentId("/subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/contoso-resources/providers/Microsoft.ApiCenter/services/contoso/workspaces/default/environments/azure-api-management")
.targetLifecycleStage("design")
.workspaceName("default")
.build());
}
}

Import

An existing resource can be imported using its type token, name, and identifier, e.g.

$ pulumi import azure-native:apicenter:ApiSource contoso-api-management /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ApiCenter/services/{serviceName}/workspaces/{workspaceName}/apiSources/{apiSourceName}

Constructors

Link copied to clipboard
constructor(apiSourceName: Output<String>? = null, azureApiManagementSource: Output<AzureApiManagementSourceArgs>? = null, importSpecification: Output<Either<String, ImportSpecificationOptions>>? = null, resourceGroupName: Output<String>? = null, serviceName: Output<String>? = null, targetEnvironmentId: Output<String>? = null, targetLifecycleStage: Output<Either<String, LifecycleStage>>? = null, workspaceName: Output<String>? = null)

Properties

Link copied to clipboard
val apiSourceName: Output<String>? = null

The name of the API.

Link copied to clipboard

API source configuration for Azure API Management.

Link copied to clipboard

Indicates if the specification should be imported along with metadata.

Link copied to clipboard
val resourceGroupName: Output<String>? = null

The name of the resource group. The name is case insensitive.

Link copied to clipboard
val serviceName: Output<String>? = null

The name of Azure API Center service.

Link copied to clipboard
val targetEnvironmentId: Output<String>? = null

The target environment resource ID.

Link copied to clipboard
val targetLifecycleStage: Output<Either<String, LifecycleStage>>? = null

The target lifecycle stage.

Link copied to clipboard
val workspaceName: Output<String>? = null

The name of the workspace.

Functions

Link copied to clipboard
open override fun toJava(): ApiSourceArgs