azure-native.automation.SourceControl

Explore with Pulumi AI

Definition of the source control. API Version: 2019-06-01.

Example Usage

Create or update a source control

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

return await Deployment.RunAsync(() => 
{
    var sourceControl = new AzureNative.Automation.SourceControl("sourceControl", new()
    {
        AutoSync = true,
        AutomationAccountName = "sampleAccount9",
        Branch = "master",
        Description = "my description",
        FolderPath = "/folderOne/folderTwo",
        PublishRunbook = true,
        RepoUrl = "https://sampleUser.visualstudio.com/myProject/_git/myRepository",
        ResourceGroupName = "rg",
        SecurityToken = new AzureNative.Automation.Inputs.SourceControlSecurityTokenPropertiesArgs
        {
            AccessToken = "******",
            TokenType = "PersonalAccessToken",
        },
        SourceControlName = "sampleSourceControl",
        SourceType = "VsoGit",
    });

});
package main

import (
	automation "github.com/pulumi/pulumi-azure-native/sdk/go/azure/automation"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := automation.NewSourceControl(ctx, "sourceControl", &automation.SourceControlArgs{
			AutoSync:              pulumi.Bool(true),
			AutomationAccountName: pulumi.String("sampleAccount9"),
			Branch:                pulumi.String("master"),
			Description:           pulumi.String("my description"),
			FolderPath:            pulumi.String("/folderOne/folderTwo"),
			PublishRunbook:        pulumi.Bool(true),
			RepoUrl:               pulumi.String("https://sampleUser.visualstudio.com/myProject/_git/myRepository"),
			ResourceGroupName:     pulumi.String("rg"),
			SecurityToken: &automation.SourceControlSecurityTokenPropertiesArgs{
				AccessToken: pulumi.String("******"),
				TokenType:   pulumi.String("PersonalAccessToken"),
			},
			SourceControlName: pulumi.String("sampleSourceControl"),
			SourceType:        pulumi.String("VsoGit"),
		})
		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.automation.SourceControl;
import com.pulumi.azurenative.automation.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()        
            .autoSync(true)
            .automationAccountName("sampleAccount9")
            .branch("master")
            .description("my description")
            .folderPath("/folderOne/folderTwo")
            .publishRunbook(true)
            .repoUrl("https://sampleUser.visualstudio.com/myProject/_git/myRepository")
            .resourceGroupName("rg")
            .securityToken(Map.ofEntries(
                Map.entry("accessToken", "******"),
                Map.entry("tokenType", "PersonalAccessToken")
            ))
            .sourceControlName("sampleSourceControl")
            .sourceType("VsoGit")
            .build());

    }
}
import pulumi
import pulumi_azure_native as azure_native

source_control = azure_native.automation.SourceControl("sourceControl",
    auto_sync=True,
    automation_account_name="sampleAccount9",
    branch="master",
    description="my description",
    folder_path="/folderOne/folderTwo",
    publish_runbook=True,
    repo_url="https://sampleUser.visualstudio.com/myProject/_git/myRepository",
    resource_group_name="rg",
    security_token=azure_native.automation.SourceControlSecurityTokenPropertiesArgs(
        access_token="******",
        token_type="PersonalAccessToken",
    ),
    source_control_name="sampleSourceControl",
    source_type="VsoGit")
import * as pulumi from "@pulumi/pulumi";
import * as azure_native from "@pulumi/azure-native";

const sourceControl = new azure_native.automation.SourceControl("sourceControl", {
    autoSync: true,
    automationAccountName: "sampleAccount9",
    branch: "master",
    description: "my description",
    folderPath: "/folderOne/folderTwo",
    publishRunbook: true,
    repoUrl: "https://sampleUser.visualstudio.com/myProject/_git/myRepository",
    resourceGroupName: "rg",
    securityToken: {
        accessToken: "******",
        tokenType: "PersonalAccessToken",
    },
    sourceControlName: "sampleSourceControl",
    sourceType: "VsoGit",
});
resources:
  sourceControl:
    type: azure-native:automation:SourceControl
    properties:
      autoSync: true
      automationAccountName: sampleAccount9
      branch: master
      description: my description
      folderPath: /folderOne/folderTwo
      publishRunbook: true
      repoUrl: https://sampleUser.visualstudio.com/myProject/_git/myRepository
      resourceGroupName: rg
      securityToken:
        accessToken: '******'
        tokenType: PersonalAccessToken
      sourceControlName: sampleSourceControl
      sourceType: VsoGit

Create SourceControl Resource

new SourceControl(name: string, args: SourceControlArgs, opts?: CustomResourceOptions);
@overload
def SourceControl(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  auto_sync: Optional[bool] = None,
                  automation_account_name: Optional[str] = None,
                  branch: Optional[str] = None,
                  description: Optional[str] = None,
                  folder_path: Optional[str] = None,
                  publish_runbook: Optional[bool] = None,
                  repo_url: Optional[str] = None,
                  resource_group_name: Optional[str] = None,
                  security_token: Optional[SourceControlSecurityTokenPropertiesArgs] = None,
                  source_control_name: Optional[str] = None,
                  source_type: Optional[Union[str, SourceType]] = 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:automation: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:

AutomationAccountName string

The name of the automation account.

ResourceGroupName string

Name of an Azure Resource group.

AutoSync bool

The auto async of the source control. Default is false.

Branch string

The repo branch of the source control. Include branch as empty string for VsoTfvc.

Description string

The user description of the source control.

FolderPath string

The folder path of the source control. Path must be relative.

PublishRunbook bool

The auto publish of the source control. Default is true.

RepoUrl string

The repo url of the source control.

SecurityToken Pulumi.AzureNative.Automation.Inputs.SourceControlSecurityTokenPropertiesArgs

The authorization token for the repo of the source control.

SourceControlName string

The source control name.

SourceType string | Pulumi.AzureNative.Automation.SourceType

The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.

AutomationAccountName string

The name of the automation account.

ResourceGroupName string

Name of an Azure Resource group.

AutoSync bool

The auto async of the source control. Default is false.

Branch string

The repo branch of the source control. Include branch as empty string for VsoTfvc.

Description string

The user description of the source control.

FolderPath string

The folder path of the source control. Path must be relative.

PublishRunbook bool

The auto publish of the source control. Default is true.

RepoUrl string

The repo url of the source control.

SecurityToken SourceControlSecurityTokenPropertiesArgs

The authorization token for the repo of the source control.

SourceControlName string

The source control name.

SourceType string | SourceType

The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.

automationAccountName String

The name of the automation account.

resourceGroupName String

Name of an Azure Resource group.

autoSync Boolean

The auto async of the source control. Default is false.

branch String

The repo branch of the source control. Include branch as empty string for VsoTfvc.

description String

The user description of the source control.

folderPath String

The folder path of the source control. Path must be relative.

publishRunbook Boolean

The auto publish of the source control. Default is true.

repoUrl String

The repo url of the source control.

securityToken SourceControlSecurityTokenPropertiesArgs

The authorization token for the repo of the source control.

sourceControlName String

The source control name.

sourceType String | SourceType

The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.

automationAccountName string

The name of the automation account.

resourceGroupName string

Name of an Azure Resource group.

autoSync boolean

The auto async of the source control. Default is false.

branch string

The repo branch of the source control. Include branch as empty string for VsoTfvc.

description string

The user description of the source control.

folderPath string

The folder path of the source control. Path must be relative.

publishRunbook boolean

The auto publish of the source control. Default is true.

repoUrl string

The repo url of the source control.

securityToken SourceControlSecurityTokenPropertiesArgs

The authorization token for the repo of the source control.

sourceControlName string

The source control name.

sourceType string | SourceType

The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.

automation_account_name str

The name of the automation account.

resource_group_name str

Name of an Azure Resource group.

auto_sync bool

The auto async of the source control. Default is false.

branch str

The repo branch of the source control. Include branch as empty string for VsoTfvc.

description str

The user description of the source control.

folder_path str

The folder path of the source control. Path must be relative.

publish_runbook bool

The auto publish of the source control. Default is true.

repo_url str

The repo url of the source control.

security_token SourceControlSecurityTokenPropertiesArgs

The authorization token for the repo of the source control.

source_control_name str

The source control name.

source_type str | SourceType

The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.

automationAccountName String

The name of the automation account.

resourceGroupName String

Name of an Azure Resource group.

autoSync Boolean

The auto async of the source control. Default is false.

branch String

The repo branch of the source control. Include branch as empty string for VsoTfvc.

description String

The user description of the source control.

folderPath String

The folder path of the source control. Path must be relative.

publishRunbook Boolean

The auto publish of the source control. Default is true.

repoUrl String

The repo url of the source control.

securityToken Property Map

The authorization token for the repo of the source control.

sourceControlName String

The source control name.

sourceType String | "VsoGit" | "VsoTfvc" | "GitHub"

The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.

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

The name of the resource

Type string

The type of the resource.

CreationTime string

The creation time.

LastModifiedTime string

The last modified time.

Id string

The provider-assigned unique ID for this managed resource.

Name string

The name of the resource

Type string

The type of the resource.

CreationTime string

The creation time.

LastModifiedTime string

The last modified time.

id String

The provider-assigned unique ID for this managed resource.

name String

The name of the resource

type String

The type of the resource.

creationTime String

The creation time.

lastModifiedTime String

The last modified time.

id string

The provider-assigned unique ID for this managed resource.

name string

The name of the resource

type string

The type of the resource.

creationTime string

The creation time.

lastModifiedTime string

The last modified time.

id str

The provider-assigned unique ID for this managed resource.

name str

The name of the resource

type str

The type of the resource.

creation_time str

The creation time.

last_modified_time str

The last modified time.

id String

The provider-assigned unique ID for this managed resource.

name String

The name of the resource

type String

The type of the resource.

creationTime String

The creation time.

lastModifiedTime String

The last modified time.

Supporting Types

SourceControlSecurityTokenProperties

AccessToken string

The access token.

RefreshToken string

The refresh token.

TokenType string | Pulumi.AzureNative.Automation.TokenType

The token type. Must be either PersonalAccessToken or Oauth.

AccessToken string

The access token.

RefreshToken string

The refresh token.

TokenType string | TokenType

The token type. Must be either PersonalAccessToken or Oauth.

accessToken String

The access token.

refreshToken String

The refresh token.

tokenType String | TokenType

The token type. Must be either PersonalAccessToken or Oauth.

accessToken string

The access token.

refreshToken string

The refresh token.

tokenType string | TokenType

The token type. Must be either PersonalAccessToken or Oauth.

access_token str

The access token.

refresh_token str

The refresh token.

token_type str | TokenType

The token type. Must be either PersonalAccessToken or Oauth.

accessToken String

The access token.

refreshToken String

The refresh token.

tokenType String | "PersonalAccessToken" | "Oauth"

The token type. Must be either PersonalAccessToken or Oauth.

SourceType

VsoGit
VsoGit
VsoTfvc
VsoTfvc
GitHub
GitHub
SourceTypeVsoGit
VsoGit
SourceTypeVsoTfvc
VsoTfvc
SourceTypeGitHub
GitHub
VsoGit
VsoGit
VsoTfvc
VsoTfvc
GitHub
GitHub
VsoGit
VsoGit
VsoTfvc
VsoTfvc
GitHub
GitHub
VSO_GIT
VsoGit
VSO_TFVC
VsoTfvc
GIT_HUB
GitHub
"VsoGit"
VsoGit
"VsoTfvc"
VsoTfvc
"GitHub"
GitHub

TokenType

PersonalAccessToken
PersonalAccessToken
Oauth
Oauth
TokenTypePersonalAccessToken
PersonalAccessToken
TokenTypeOauth
Oauth
PersonalAccessToken
PersonalAccessToken
Oauth
Oauth
PersonalAccessToken
PersonalAccessToken
Oauth
Oauth
PERSONAL_ACCESS_TOKEN
PersonalAccessToken
OAUTH
Oauth
"PersonalAccessToken"
PersonalAccessToken
"Oauth"
Oauth

Import

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

$ pulumi import azure-native:automation:SourceControl sampleSourceControl /subscriptions/subid/resourceGroups/rg/providers/Microsoft.Automation/automationAccounts/sampleAccount9/sourcecontrols/sampleSourceControl 

Package Details

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