SourceControl

class SourceControl : KotlinCustomResource

Represents a SourceControl in Azure Security Insights. Uses Azure REST API version 2023-05-01-preview. In version 1.x of the Azure Native provider, it used API version 2021-03-01-preview. Other available API versions: 2021-03-01-preview.

Example Usage

Creates a source control.

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using AzureNative = Pulumi.AzureNative;
return await Deployment.RunAsync(() =>
{
var sourceControl = new AzureNative.SecurityInsights.SourceControl("sourceControl", new()
{
ContentTypes = new[]
{
"AnalyticRules",
AzureNative.SecurityInsights.ContentType.Workbook,
},
Description = "This is a source control",
DisplayName = "My Source Control",
RepoType = AzureNative.SecurityInsights.RepoType.Github,
Repository = new AzureNative.SecurityInsights.Inputs.RepositoryArgs
{
Branch = "master",
DisplayUrl = "https://github.com/user/repo",
PathMapping = new[]
{
new AzureNative.SecurityInsights.Inputs.ContentPathMapArgs
{
ContentType = "AnalyticRules",
Path = "path/to/rules",
},
new AzureNative.SecurityInsights.Inputs.ContentPathMapArgs
{
ContentType = AzureNative.SecurityInsights.ContentType.Workbook,
Path = "path/to/workbooks",
},
},
Url = "https://github.com/user/repo",
},
ResourceGroupName = "myRg",
SourceControlId = "789e0c1f-4a3d-43ad-809c-e713b677b04a",
WorkspaceName = "myWorkspace",
});
});
package main
import (
securityinsights "github.com/pulumi/pulumi-azure-native-sdk/securityinsights/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := securityinsights.NewSourceControl(ctx, "sourceControl", &securityinsights.SourceControlArgs{
ContentTypes: pulumi.StringArray{
pulumi.String("AnalyticRules"),
pulumi.String(securityinsights.ContentTypeWorkbook),
},
Description: pulumi.String("This is a source control"),
DisplayName: pulumi.String("My Source Control"),
RepoType: pulumi.String(securityinsights.RepoTypeGithub),
Repository: &securityinsights.RepositoryArgs{
Branch: pulumi.String("master"),
DisplayUrl: pulumi.String("https://github.com/user/repo"),
PathMapping: securityinsights.ContentPathMapArray{
&securityinsights.ContentPathMapArgs{
ContentType: pulumi.String("AnalyticRules"),
Path: pulumi.String("path/to/rules"),
},
&securityinsights.ContentPathMapArgs{
ContentType: pulumi.String(securityinsights.ContentTypeWorkbook),
Path: pulumi.String("path/to/workbooks"),
},
},
Url: pulumi.String("https://github.com/user/repo"),
},
ResourceGroupName: pulumi.String("myRg"),
SourceControlId: pulumi.String("789e0c1f-4a3d-43ad-809c-e713b677b04a"),
WorkspaceName: pulumi.String("myWorkspace"),
})
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.securityinsights.SourceControl;
import com.pulumi.azurenative.securityinsights.SourceControlArgs;
import com.pulumi.azurenative.securityinsights.inputs.RepositoryArgs;
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 sourceControl = new SourceControl("sourceControl", SourceControlArgs.builder()
.contentTypes(
"AnalyticRules",
"Workbook")
.description("This is a source control")
.displayName("My Source Control")
.repoType("Github")
.repository(RepositoryArgs.builder()
.branch("master")
.displayUrl("https://github.com/user/repo")
.pathMapping(
ContentPathMapArgs.builder()
.contentType("AnalyticRules")
.path("path/to/rules")
.build(),
ContentPathMapArgs.builder()
.contentType("Workbook")
.path("path/to/workbooks")
.build())
.url("https://github.com/user/repo")
.build())
.resourceGroupName("myRg")
.sourceControlId("789e0c1f-4a3d-43ad-809c-e713b677b04a")
.workspaceName("myWorkspace")
.build());
}
}

Import

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

$ pulumi import azure-native:securityinsights:SourceControl 789e0c1f-4a3d-43ad-809c-e713b677b04a /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/providers/Microsoft.SecurityInsights/sourcecontrols/{sourceControlId}

Properties

Link copied to clipboard
val contentTypes: Output<List<String>>

Array of source control content types.

Link copied to clipboard
val description: Output<String>?

A description of the source control

Link copied to clipboard
val displayName: Output<String>

The display name of the source control

Link copied to clipboard
val etag: Output<String>?

Etag of the azure resource

Link copied to clipboard
val id: Output<String>
Link copied to clipboard

Information regarding the latest deployment for the source control.

Link copied to clipboard
val name: Output<String>

The name of the resource

Link copied to clipboard
val pulumiChildResources: Set<KotlinResource>
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Repository metadata.

Link copied to clipboard

Information regarding the resources created in user's repository.

Link copied to clipboard
val repoType: Output<String>

The repository type of the source control

Link copied to clipboard

Azure Resource Manager metadata containing createdBy and modifiedBy information.

Link copied to clipboard
val type: Output<String>

The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"

Link copied to clipboard
val urn: Output<String>
Link copied to clipboard
val version: Output<String>?

The version number associated with the source control