azure-native.securityinsights.SourceControl

Explore with Pulumi AI

Represents a SourceControl in Azure Security Insights. API Version: 2021-03-01-preview.

Example Usage

Creates a source control.

using System.Collections.Generic;
using Pulumi;
using AzureNative = Pulumi.AzureNative;

return await Deployment.RunAsync(() => 
{
    var sourceControl = new AzureNative.SecurityInsights.SourceControl("sourceControl", new()
    {
        ContentTypes = new[]
        {
            "AnalyticRules",
            "Workbook",
        },
        Description = "This is a source control",
        DisplayName = "My Source Control",
        OperationalInsightsResourceProvider = "Microsoft.OperationalInsights",
        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 = "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/go/azure/securityinsights"
	"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("Workbook"),
			},
			Description:                         pulumi.String("This is a source control"),
			DisplayName:                         pulumi.String("My Source Control"),
			OperationalInsightsResourceProvider: pulumi.String("Microsoft.OperationalInsights"),
			RepoType:                            pulumi.String("Github"),
			Repository: securityinsights.RepositoryResponse{
				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("Workbook"),
						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 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")
            .operationalInsightsResourceProvider("Microsoft.OperationalInsights")
            .repoType("Github")
            .repository(Map.ofEntries(
                Map.entry("branch", "master"),
                Map.entry("displayUrl", "https://github.com/user/repo"),
                Map.entry("pathMapping",                 
                    Map.ofEntries(
                        Map.entry("contentType", "AnalyticRules"),
                        Map.entry("path", "path/to/rules")
                    ),
                    Map.ofEntries(
                        Map.entry("contentType", "Workbook"),
                        Map.entry("path", "path/to/workbooks")
                    )),
                Map.entry("url", "https://github.com/user/repo")
            ))
            .resourceGroupName("myRg")
            .sourceControlId("789e0c1f-4a3d-43ad-809c-e713b677b04a")
            .workspaceName("myWorkspace")
            .build());

    }
}
import pulumi
import pulumi_azure_native as azure_native

source_control = azure_native.securityinsights.SourceControl("sourceControl",
    content_types=[
        "AnalyticRules",
        "Workbook",
    ],
    description="This is a source control",
    display_name="My Source Control",
    operational_insights_resource_provider="Microsoft.OperationalInsights",
    repo_type="Github",
    repository=azure_native.securityinsights.RepositoryResponseArgs(
        branch="master",
        display_url="https://github.com/user/repo",
        path_mapping=[
            azure_native.securityinsights.ContentPathMapArgs(
                content_type="AnalyticRules",
                path="path/to/rules",
            ),
            azure_native.securityinsights.ContentPathMapArgs(
                content_type="Workbook",
                path="path/to/workbooks",
            ),
        ],
        url="https://github.com/user/repo",
    ),
    resource_group_name="myRg",
    source_control_id="789e0c1f-4a3d-43ad-809c-e713b677b04a",
    workspace_name="myWorkspace")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const sourceControl = new azure_native.securityinsights.SourceControl("sourceControl", {
    contentTypes: [
        "AnalyticRules",
        "Workbook",
    ],
    description: "This is a source control",
    displayName: "My Source Control",
    operationalInsightsResourceProvider: "Microsoft.OperationalInsights",
    repoType: "Github",
    repository: {
        branch: "master",
        displayUrl: "https://github.com/user/repo",
        pathMapping: [
            {
                contentType: "AnalyticRules",
                path: "path/to/rules",
            },
            {
                contentType: "Workbook",
                path: "path/to/workbooks",
            },
        ],
        url: "https://github.com/user/repo",
    },
    resourceGroupName: "myRg",
    sourceControlId: "789e0c1f-4a3d-43ad-809c-e713b677b04a",
    workspaceName: "myWorkspace",
});
resources:
  sourceControl:
    type: azure-native:securityinsights:SourceControl
    properties:
      contentTypes:
        - AnalyticRules
        - Workbook
      description: This is a source control
      displayName: My Source Control
      operationalInsightsResourceProvider: Microsoft.OperationalInsights
      repoType: Github
      repository:
        branch: master
        displayUrl: https://github.com/user/repo
        pathMapping:
          - contentType: AnalyticRules
            path: path/to/rules
          - contentType: Workbook
            path: path/to/workbooks
        url: https://github.com/user/repo
      resourceGroupName: myRg
      sourceControlId: 789e0c1f-4a3d-43ad-809c-e713b677b04a
      workspaceName: myWorkspace

Create SourceControl Resource

new SourceControl(name: string, args: SourceControlArgs, opts?: CustomResourceOptions);
@overload
def SourceControl(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  content_types: Optional[Sequence[Union[str, ContentType]]] = None,
                  created_at: Optional[str] = None,
                  created_by: Optional[str] = None,
                  created_by_type: Optional[Union[str, CreatedByType]] = None,
                  description: Optional[str] = None,
                  display_name: Optional[str] = None,
                  id: Optional[str] = None,
                  last_modified_at: Optional[str] = None,
                  last_modified_by: Optional[str] = None,
                  last_modified_by_type: Optional[Union[str, CreatedByType]] = None,
                  operational_insights_resource_provider: Optional[str] = None,
                  repo_type: Optional[Union[str, RepoType]] = None,
                  repository: Optional[RepositoryArgs] = None,
                  resource_group_name: Optional[str] = None,
                  source_control_id: Optional[str] = None,
                  workspace_name: Optional[str] = None)
@overload
def SourceControl(resource_name: str,
                  args: SourceControlArgs,
                  opts: Optional[ResourceOptions] = None)
func NewSourceControl(ctx *Context, name string, args SourceControlArgs, opts ...ResourceOption) (*SourceControl, error)
public SourceControl(string name, SourceControlArgs args, CustomResourceOptions? opts = null)
public SourceControl(String name, SourceControlArgs args)
public SourceControl(String name, SourceControlArgs args, CustomResourceOptions options)
type: azure-native:securityinsights:SourceControl
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args SourceControlArgs
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 SourceControlArgs
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 SourceControlArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args SourceControlArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args SourceControlArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

SourceControl Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The SourceControl resource accepts the following input properties:

ContentTypes List<Union<string, Pulumi.AzureNative.SecurityInsights.ContentType>>

Array of source control content types.

DisplayName string

The display name of the source control

OperationalInsightsResourceProvider string

The namespace of workspaces resource provider- Microsoft.OperationalInsights.

RepoType string | Pulumi.AzureNative.SecurityInsights.RepoType

The repository type of the source control

Repository Pulumi.AzureNative.SecurityInsights.Inputs.RepositoryArgs

Repository metadata.

ResourceGroupName string

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

WorkspaceName string

The name of the workspace.

CreatedAt string

The timestamp of resource creation (UTC).

CreatedBy string

The identity that created the resource.

CreatedByType string | Pulumi.AzureNative.SecurityInsights.CreatedByType

The type of identity that created the resource.

Description string

A description of the source control

Id string

The id (a Guid) of the source control

LastModifiedAt string

The timestamp of resource last modification (UTC)

LastModifiedBy string

The identity that last modified the resource.

LastModifiedByType string | Pulumi.AzureNative.SecurityInsights.CreatedByType

The type of identity that last modified the resource.

SourceControlId string

Source control Id

ContentTypes []string

Array of source control content types.

DisplayName string

The display name of the source control

OperationalInsightsResourceProvider string

The namespace of workspaces resource provider- Microsoft.OperationalInsights.

RepoType string | RepoType

The repository type of the source control

Repository RepositoryArgs

Repository metadata.

ResourceGroupName string

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

WorkspaceName string

The name of the workspace.

CreatedAt string

The timestamp of resource creation (UTC).

CreatedBy string

The identity that created the resource.

CreatedByType string | CreatedByType

The type of identity that created the resource.

Description string

A description of the source control

Id string

The id (a Guid) of the source control

LastModifiedAt string

The timestamp of resource last modification (UTC)

LastModifiedBy string

The identity that last modified the resource.

LastModifiedByType string | CreatedByType

The type of identity that last modified the resource.

SourceControlId string

Source control Id

contentTypes List<Either<String,ContentType>>

Array of source control content types.

displayName String

The display name of the source control

operationalInsightsResourceProvider String

The namespace of workspaces resource provider- Microsoft.OperationalInsights.

repoType String | RepoType

The repository type of the source control

repository RepositoryArgs

Repository metadata.

resourceGroupName String

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

workspaceName String

The name of the workspace.

createdAt String

The timestamp of resource creation (UTC).

createdBy String

The identity that created the resource.

createdByType String | CreatedByType

The type of identity that created the resource.

description String

A description of the source control

id String

The id (a Guid) of the source control

lastModifiedAt String

The timestamp of resource last modification (UTC)

lastModifiedBy String

The identity that last modified the resource.

lastModifiedByType String | CreatedByType

The type of identity that last modified the resource.

sourceControlId String

Source control Id

contentTypes (string | ContentType)[]

Array of source control content types.

displayName string

The display name of the source control

operationalInsightsResourceProvider string

The namespace of workspaces resource provider- Microsoft.OperationalInsights.

repoType string | RepoType

The repository type of the source control

repository RepositoryArgs

Repository metadata.

resourceGroupName string

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

workspaceName string

The name of the workspace.

createdAt string

The timestamp of resource creation (UTC).

createdBy string

The identity that created the resource.

createdByType string | CreatedByType

The type of identity that created the resource.

description string

A description of the source control

id string

The id (a Guid) of the source control

lastModifiedAt string

The timestamp of resource last modification (UTC)

lastModifiedBy string

The identity that last modified the resource.

lastModifiedByType string | CreatedByType

The type of identity that last modified the resource.

sourceControlId string

Source control Id

content_types Sequence[Union[str, ContentType]]

Array of source control content types.

display_name str

The display name of the source control

operational_insights_resource_provider str

The namespace of workspaces resource provider- Microsoft.OperationalInsights.

repo_type str | RepoType

The repository type of the source control

repository RepositoryArgs

Repository metadata.

resource_group_name str

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

workspace_name str

The name of the workspace.

created_at str

The timestamp of resource creation (UTC).

created_by str

The identity that created the resource.

created_by_type str | CreatedByType

The type of identity that created the resource.

description str

A description of the source control

id str

The id (a Guid) of the source control

last_modified_at str

The timestamp of resource last modification (UTC)

last_modified_by str

The identity that last modified the resource.

last_modified_by_type str | CreatedByType

The type of identity that last modified the resource.

source_control_id str

Source control Id

contentTypes List<String | "AnalyticRule" | "Workbook">

Array of source control content types.

displayName String

The display name of the source control

operationalInsightsResourceProvider String

The namespace of workspaces resource provider- Microsoft.OperationalInsights.

repoType String | "Github" | "DevOps"

The repository type of the source control

repository Property Map

Repository metadata.

resourceGroupName String

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

workspaceName String

The name of the workspace.

createdAt String

The timestamp of resource creation (UTC).

createdBy String

The identity that created the resource.

createdByType String | "User" | "Application" | "ManagedIdentity" | "Key"

The type of identity that created the resource.

description String

A description of the source control

id String

The id (a Guid) of the source control

lastModifiedAt String

The timestamp of resource last modification (UTC)

lastModifiedBy String

The identity that last modified the resource.

lastModifiedByType String | "User" | "Application" | "ManagedIdentity" | "Key"

The type of identity that last modified the resource.

sourceControlId String

Source control Id

Outputs

All input properties are implicitly available as output properties. Additionally, the SourceControl resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Name string

Azure resource name

SystemData Pulumi.AzureNative.SecurityInsights.Outputs.SystemDataResponse

Azure Resource Manager metadata containing createdBy and modifiedBy information.

Type string

Azure resource type

Etag string

Etag of the azure resource

Id string

The provider-assigned unique ID for this managed resource.

Name string

Azure resource name

SystemData SystemDataResponse

Azure Resource Manager metadata containing createdBy and modifiedBy information.

Type string

Azure resource type

Etag string

Etag of the azure resource

id String

The provider-assigned unique ID for this managed resource.

name String

Azure resource name

systemData SystemDataResponse

Azure Resource Manager metadata containing createdBy and modifiedBy information.

type String

Azure resource type

etag String

Etag of the azure resource

id string

The provider-assigned unique ID for this managed resource.

name string

Azure resource name

systemData SystemDataResponse

Azure Resource Manager metadata containing createdBy and modifiedBy information.

type string

Azure resource type

etag string

Etag of the azure resource

id str

The provider-assigned unique ID for this managed resource.

name str

Azure resource name

system_data SystemDataResponse

Azure Resource Manager metadata containing createdBy and modifiedBy information.

type str

Azure resource type

etag str

Etag of the azure resource

id String

The provider-assigned unique ID for this managed resource.

name String

Azure resource name

systemData Property Map

Azure Resource Manager metadata containing createdBy and modifiedBy information.

type String

Azure resource type

etag String

Etag of the azure resource

Supporting Types

ContentPathMap

ContentType string | Pulumi.AzureNative.SecurityInsights.ContentType

Content type.

Path string

The path to the content.

ContentType string | ContentType

Content type.

Path string

The path to the content.

contentType String | ContentType

Content type.

path String

The path to the content.

contentType string | ContentType

Content type.

path string

The path to the content.

content_type str | ContentType

Content type.

path str

The path to the content.

contentType String | "AnalyticRule" | "Workbook"

Content type.

path String

The path to the content.

ContentPathMapResponse

ContentType string

Content type.

Path string

The path to the content.

ContentType string

Content type.

Path string

The path to the content.

contentType String

Content type.

path String

The path to the content.

contentType string

Content type.

path string

The path to the content.

content_type str

Content type.

path str

The path to the content.

contentType String

Content type.

path String

The path to the content.

ContentType

AnalyticRule
AnalyticRule
Workbook
Workbook
ContentTypeAnalyticRule
AnalyticRule
ContentTypeWorkbook
Workbook
AnalyticRule
AnalyticRule
Workbook
Workbook
AnalyticRule
AnalyticRule
Workbook
Workbook
ANALYTIC_RULE
AnalyticRule
WORKBOOK
Workbook
"AnalyticRule"
AnalyticRule
"Workbook"
Workbook

CreatedByType

User
User
Application
Application
ManagedIdentity
ManagedIdentity
Key
Key
CreatedByTypeUser
User
CreatedByTypeApplication
Application
CreatedByTypeManagedIdentity
ManagedIdentity
CreatedByTypeKey
Key
User
User
Application
Application
ManagedIdentity
ManagedIdentity
Key
Key
User
User
Application
Application
ManagedIdentity
ManagedIdentity
Key
Key
USER
User
APPLICATION
Application
MANAGED_IDENTITY
ManagedIdentity
KEY
Key
"User"
User
"Application"
Application
"ManagedIdentity"
ManagedIdentity
"Key"
Key

RepoType

Github
Github
DevOps
DevOps
RepoTypeGithub
Github
RepoTypeDevOps
DevOps
Github
Github
DevOps
DevOps
Github
Github
DevOps
DevOps
GITHUB
Github
DEV_OPS
DevOps
"Github"
Github
"DevOps"
DevOps

Repository

Branch string

Branch name of repository.

DeploymentLogsUrl string

Url to access repository action logs.

DisplayUrl string

Display url of repository.

PathMapping List<Pulumi.AzureNative.SecurityInsights.Inputs.ContentPathMap>

Dictionary of source control content type and path mapping.

Url string

Url of repository.

Branch string

Branch name of repository.

DeploymentLogsUrl string

Url to access repository action logs.

DisplayUrl string

Display url of repository.

PathMapping []ContentPathMap

Dictionary of source control content type and path mapping.

Url string

Url of repository.

branch String

Branch name of repository.

deploymentLogsUrl String

Url to access repository action logs.

displayUrl String

Display url of repository.

pathMapping List<ContentPathMap>

Dictionary of source control content type and path mapping.

url String

Url of repository.

branch string

Branch name of repository.

deploymentLogsUrl string

Url to access repository action logs.

displayUrl string

Display url of repository.

pathMapping ContentPathMap[]

Dictionary of source control content type and path mapping.

url string

Url of repository.

branch str

Branch name of repository.

deployment_logs_url str

Url to access repository action logs.

display_url str

Display url of repository.

path_mapping Sequence[ContentPathMap]

Dictionary of source control content type and path mapping.

url str

Url of repository.

branch String

Branch name of repository.

deploymentLogsUrl String

Url to access repository action logs.

displayUrl String

Display url of repository.

pathMapping List<Property Map>

Dictionary of source control content type and path mapping.

url String

Url of repository.

RepositoryResponse

Branch string

Branch name of repository.

DeploymentLogsUrl string

Url to access repository action logs.

DisplayUrl string

Display url of repository.

PathMapping List<Pulumi.AzureNative.SecurityInsights.Inputs.ContentPathMapResponse>

Dictionary of source control content type and path mapping.

Url string

Url of repository.

Branch string

Branch name of repository.

DeploymentLogsUrl string

Url to access repository action logs.

DisplayUrl string

Display url of repository.

PathMapping []ContentPathMapResponse

Dictionary of source control content type and path mapping.

Url string

Url of repository.

branch String

Branch name of repository.

deploymentLogsUrl String

Url to access repository action logs.

displayUrl String

Display url of repository.

pathMapping List<ContentPathMapResponse>

Dictionary of source control content type and path mapping.

url String

Url of repository.

branch string

Branch name of repository.

deploymentLogsUrl string

Url to access repository action logs.

displayUrl string

Display url of repository.

pathMapping ContentPathMapResponse[]

Dictionary of source control content type and path mapping.

url string

Url of repository.

branch str

Branch name of repository.

deployment_logs_url str

Url to access repository action logs.

display_url str

Display url of repository.

path_mapping Sequence[ContentPathMapResponse]

Dictionary of source control content type and path mapping.

url str

Url of repository.

branch String

Branch name of repository.

deploymentLogsUrl String

Url to access repository action logs.

displayUrl String

Display url of repository.

pathMapping List<Property Map>

Dictionary of source control content type and path mapping.

url String

Url of repository.

SystemDataResponse

CreatedAt string

The timestamp of resource creation (UTC).

CreatedBy string

The identity that created the resource.

CreatedByType string

The type of identity that created the resource.

LastModifiedAt string

The timestamp of resource last modification (UTC)

LastModifiedBy string

The identity that last modified the resource.

LastModifiedByType string

The type of identity that last modified the resource.

CreatedAt string

The timestamp of resource creation (UTC).

CreatedBy string

The identity that created the resource.

CreatedByType string

The type of identity that created the resource.

LastModifiedAt string

The timestamp of resource last modification (UTC)

LastModifiedBy string

The identity that last modified the resource.

LastModifiedByType string

The type of identity that last modified the resource.

createdAt String

The timestamp of resource creation (UTC).

createdBy String

The identity that created the resource.

createdByType String

The type of identity that created the resource.

lastModifiedAt String

The timestamp of resource last modification (UTC)

lastModifiedBy String

The identity that last modified the resource.

lastModifiedByType String

The type of identity that last modified the resource.

createdAt string

The timestamp of resource creation (UTC).

createdBy string

The identity that created the resource.

createdByType string

The type of identity that created the resource.

lastModifiedAt string

The timestamp of resource last modification (UTC)

lastModifiedBy string

The identity that last modified the resource.

lastModifiedByType string

The type of identity that last modified the resource.

created_at str

The timestamp of resource creation (UTC).

created_by str

The identity that created the resource.

created_by_type str

The type of identity that created the resource.

last_modified_at str

The timestamp of resource last modification (UTC)

last_modified_by str

The identity that last modified the resource.

last_modified_by_type str

The type of identity that last modified the resource.

createdAt String

The timestamp of resource creation (UTC).

createdBy String

The identity that created the resource.

createdByType String

The type of identity that created the resource.

lastModifiedAt String

The timestamp of resource last modification (UTC)

lastModifiedBy String

The identity that last modified the resource.

lastModifiedByType String

The type of identity that last modified the resource.

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/d0cfe6b2-9ac0-4464-9919-dccaee2e48c0/resourceGroups/myRg/providers/Microsoft.OperationalIinsights/workspaces/myWorkspace/providers/Microsoft.SecurityInsights/sourcecontrols/789e0c1f-4a3d-43ad-809c-e713b677b04a 

Package Details

Repository
Azure Native pulumi/pulumi-azure-native
License
Apache-2.0