azure-native.automation.SourceControl
Explore with Pulumi AI
Definition of the source control. Azure REST API version: 2022-08-08. Prior API version in Azure Native 1.x: 2019-06-01.
Other available API versions: 2023-05-15-preview, 2023-11-01.
Example Usage
Create or update a source control
using System.Collections.Generic;
using System.Linq;
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 = AzureNative.Automation.TokenType.PersonalAccessToken,
},
SourceControlName = "sampleSourceControl",
SourceType = AzureNative.Automation.SourceType.VsoGit,
});
});
package main
import (
automation "github.com/pulumi/pulumi-azure-native-sdk/automation/v2"
"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(automation.TokenTypePersonalAccessToken),
},
SourceControlName: pulumi.String("sampleSourceControl"),
SourceType: pulumi.String(automation.SourceTypeVsoGit),
})
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 com.pulumi.azurenative.automation.inputs.SourceControlSecurityTokenPropertiesArgs;
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(SourceControlSecurityTokenPropertiesArgs.builder()
.accessToken("******")
.tokenType("PersonalAccessToken")
.build())
.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={
"access_token": "******",
"token_type": azure_native.automation.TokenType.PERSONAL_ACCESS_TOKEN,
},
source_control_name="sampleSourceControl",
source_type=azure_native.automation.SourceType.VSO_GIT)
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: azure_native.automation.TokenType.PersonalAccessToken,
},
sourceControlName: "sampleSourceControl",
sourceType: azure_native.automation.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
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new SourceControl(name: string, args: SourceControlArgs, opts?: CustomResourceOptions);
@overload
def SourceControl(resource_name: str,
args: SourceControlArgs,
opts: Optional[ResourceOptions] = None)
@overload
def SourceControl(resource_name: str,
opts: Optional[ResourceOptions] = None,
automation_account_name: Optional[str] = None,
resource_group_name: Optional[str] = None,
auto_sync: Optional[bool] = None,
branch: Optional[str] = None,
description: Optional[str] = None,
folder_path: Optional[str] = None,
publish_runbook: Optional[bool] = None,
repo_url: Optional[str] = None,
security_token: Optional[SourceControlSecurityTokenPropertiesArgs] = None,
source_control_name: Optional[str] = None,
source_type: Optional[Union[str, SourceType]] = 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.
Parameters
- 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.
Constructor example
The following reference example uses placeholder values for all input properties.
var sourceControlResource = new AzureNative.Automation.SourceControl("sourceControlResource", new()
{
AutomationAccountName = "string",
ResourceGroupName = "string",
AutoSync = false,
Branch = "string",
Description = "string",
FolderPath = "string",
PublishRunbook = false,
RepoUrl = "string",
SecurityToken = new AzureNative.Automation.Inputs.SourceControlSecurityTokenPropertiesArgs
{
AccessToken = "string",
RefreshToken = "string",
TokenType = "string",
},
SourceControlName = "string",
SourceType = "string",
});
example, err := automation.NewSourceControl(ctx, "sourceControlResource", &automation.SourceControlArgs{
AutomationAccountName: pulumi.String("string"),
ResourceGroupName: pulumi.String("string"),
AutoSync: pulumi.Bool(false),
Branch: pulumi.String("string"),
Description: pulumi.String("string"),
FolderPath: pulumi.String("string"),
PublishRunbook: pulumi.Bool(false),
RepoUrl: pulumi.String("string"),
SecurityToken: &automation.SourceControlSecurityTokenPropertiesArgs{
AccessToken: pulumi.String("string"),
RefreshToken: pulumi.String("string"),
TokenType: pulumi.String("string"),
},
SourceControlName: pulumi.String("string"),
SourceType: pulumi.String("string"),
})
var sourceControlResource = new SourceControl("sourceControlResource", SourceControlArgs.builder()
.automationAccountName("string")
.resourceGroupName("string")
.autoSync(false)
.branch("string")
.description("string")
.folderPath("string")
.publishRunbook(false)
.repoUrl("string")
.securityToken(SourceControlSecurityTokenPropertiesArgs.builder()
.accessToken("string")
.refreshToken("string")
.tokenType("string")
.build())
.sourceControlName("string")
.sourceType("string")
.build());
source_control_resource = azure_native.automation.SourceControl("sourceControlResource",
automation_account_name="string",
resource_group_name="string",
auto_sync=False,
branch="string",
description="string",
folder_path="string",
publish_runbook=False,
repo_url="string",
security_token={
"accessToken": "string",
"refreshToken": "string",
"tokenType": "string",
},
source_control_name="string",
source_type="string")
const sourceControlResource = new azure_native.automation.SourceControl("sourceControlResource", {
automationAccountName: "string",
resourceGroupName: "string",
autoSync: false,
branch: "string",
description: "string",
folderPath: "string",
publishRunbook: false,
repoUrl: "string",
securityToken: {
accessToken: "string",
refreshToken: "string",
tokenType: "string",
},
sourceControlName: "string",
sourceType: "string",
});
type: azure-native:automation:SourceControl
properties:
autoSync: false
automationAccountName: string
branch: string
description: string
folderPath: string
publishRunbook: false
repoUrl: string
resourceGroupName: string
securityToken:
accessToken: string
refreshToken: string
tokenType: string
sourceControlName: string
sourceType: string
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:
- Automation
Account stringName - The name of the automation account.
- Resource
Group stringName - Name of an Azure Resource group.
- Auto
Sync 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.
- Folder
Path string - 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 string - The repo url of the source control.
- Security
Token Pulumi.Azure Native. Automation. Inputs. Source Control Security Token Properties - The authorization token for the repo of the source control.
- Source
Control stringName - The source control name.
- Source
Type string | Pulumi.Azure Native. Automation. Source Type - The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.
- Automation
Account stringName - The name of the automation account.
- Resource
Group stringName - Name of an Azure Resource group.
- Auto
Sync 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.
- Folder
Path string - 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 string - The repo url of the source control.
- Security
Token SourceControl Security Token Properties Args - The authorization token for the repo of the source control.
- Source
Control stringName - The source control name.
- Source
Type string | SourceType - The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.
- automation
Account StringName - The name of the automation account.
- resource
Group StringName - Name of an Azure Resource group.
- auto
Sync 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.
- folder
Path String - The folder path of the source control. Path must be relative.
- publish
Runbook Boolean - The auto publish of the source control. Default is true.
- repo
Url String - The repo url of the source control.
- security
Token SourceControl Security Token Properties - The authorization token for the repo of the source control.
- source
Control StringName - The source control name.
- source
Type String | SourceType - The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.
- automation
Account stringName - The name of the automation account.
- resource
Group stringName - Name of an Azure Resource group.
- auto
Sync 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.
- folder
Path string - The folder path of the source control. Path must be relative.
- publish
Runbook boolean - The auto publish of the source control. Default is true.
- repo
Url string - The repo url of the source control.
- security
Token SourceControl Security Token Properties - The authorization token for the repo of the source control.
- source
Control stringName - The source control name.
- source
Type string | SourceType - The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.
- automation_
account_ strname - The name of the automation account.
- resource_
group_ strname - 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 SourceControl Security Token Properties Args - The authorization token for the repo of the source control.
- source_
control_ strname - The source control name.
- source_
type str | SourceType - The source type. Must be one of VsoGit, VsoTfvc, GitHub, case sensitive.
- automation
Account StringName - The name of the automation account.
- resource
Group StringName - Name of an Azure Resource group.
- auto
Sync 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.
- folder
Path String - The folder path of the source control. Path must be relative.
- publish
Runbook Boolean - The auto publish of the source control. Default is true.
- repo
Url String - The repo url of the source control.
- security
Token Property Map - The authorization token for the repo of the source control.
- source
Control StringName - The source control name.
- source
Type String | "VsoGit" | "Vso Tfvc" | "Git Hub" - 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.
- Creation
Time string - The creation time.
- Last
Modified stringTime - 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.
- Creation
Time string - The creation time.
- Last
Modified stringTime - 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.
- creation
Time String - The creation time.
- last
Modified StringTime - 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.
- creation
Time string - The creation time.
- last
Modified stringTime - 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_ strtime - 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.
- creation
Time String - The creation time.
- last
Modified StringTime - The last modified time.
Supporting Types
SourceControlSecurityTokenProperties, SourceControlSecurityTokenPropertiesArgs
- Access
Token string - The access token.
- Refresh
Token string - The refresh token.
- Token
Type string | Pulumi.Azure Native. Automation. Token Type - The token type. Must be either PersonalAccessToken or Oauth.
- Access
Token string - The access token.
- Refresh
Token string - The refresh token.
- Token
Type string | TokenType - The token type. Must be either PersonalAccessToken or Oauth.
- access
Token String - The access token.
- refresh
Token String - The refresh token.
- token
Type String | TokenType - The token type. Must be either PersonalAccessToken or Oauth.
- access
Token string - The access token.
- refresh
Token string - The refresh token.
- token
Type 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.
- access
Token String - The access token.
- refresh
Token String - The refresh token.
- token
Type String | "PersonalAccess Token" | "Oauth" - The token type. Must be either PersonalAccessToken or Oauth.
SourceType, SourceTypeArgs
- Vso
Git - VsoGit
- Vso
Tfvc - VsoTfvc
- Git
Hub - GitHub
- Source
Type Vso Git - VsoGit
- Source
Type Vso Tfvc - VsoTfvc
- Source
Type Git Hub - GitHub
- Vso
Git - VsoGit
- Vso
Tfvc - VsoTfvc
- Git
Hub - GitHub
- Vso
Git - VsoGit
- Vso
Tfvc - VsoTfvc
- Git
Hub - GitHub
- VSO_GIT
- VsoGit
- VSO_TFVC
- VsoTfvc
- GIT_HUB
- GitHub
- "Vso
Git" - VsoGit
- "Vso
Tfvc" - VsoTfvc
- "Git
Hub" - GitHub
TokenType, TokenTypeArgs
- Personal
Access Token - PersonalAccessToken
- Oauth
- Oauth
- Token
Type Personal Access Token - PersonalAccessToken
- Token
Type Oauth - Oauth
- Personal
Access Token - PersonalAccessToken
- Oauth
- Oauth
- Personal
Access Token - PersonalAccessToken
- Oauth
- Oauth
- PERSONAL_ACCESS_TOKEN
- PersonalAccessToken
- OAUTH
- Oauth
- "Personal
Access Token" - 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/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Automation/automationAccounts/{automationAccountName}/sourceControls/{sourceControlName}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Azure Native pulumi/pulumi-azure-native
- License
- Apache-2.0