Api Source
API source entity. Uses Azure REST API version 2024-06-01-preview. In version 2.x of the Azure Native provider, it used 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",
});
});
Content copied to clipboard
package main
import (
apicenter "github.com/pulumi/pulumi-azure-native-sdk/apicenter/v3"
"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
})
}
Content copied to clipboard
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());
}
}
Content copied to clipboard
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}
Content copied to clipboard
Properties
Link copied to clipboard
API source configuration for Azure API Management.
Link copied to clipboard
The Azure API version of the resource.
Link copied to clipboard
Indicates if the specification should be imported along with metadata.
Link copied to clipboard
The state of the API source link
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Azure Resource Manager metadata containing createdBy and modifiedBy information.
Link copied to clipboard
The target environment resource ID.
Link copied to clipboard
The target lifecycle stage.