Source Control Args
data class SourceControlArgs(val automaticSync: Output<Boolean>? = null, val automationAccountId: Output<String>? = null, val branch: Output<String>? = null, val description: Output<String>? = null, val folderPath: Output<String>? = null, val name: Output<String>? = null, val publishRunbookEnabled: Output<Boolean>? = null, val repositoryUrl: Output<String>? = null, val security: Output<SourceControlSecurityArgs>? = null, val sourceControlType: Output<String>? = null) : ConvertibleToJava<SourceControlArgs>
Manages an Automation Source Control.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";
const example = new azure.core.ResourceGroup("example", {
name: "example-resources",
location: "West Europe",
});
const exampleAccount = new azure.automation.Account("example", {
name: "example-account",
location: example.location,
resourceGroupName: example.name,
skuName: "Basic",
});
const exampleSourceControl = new azure.automation.SourceControl("example", {
name: "example",
automationAccountId: exampleAccount.id,
folderPath: "runbook",
security: {
token: "ghp_xxx",
tokenType: "PersonalAccessToken",
},
repositoryUrl: "https://github.com/foo/bat.git",
sourceControlType: "GitHub",
branch: "main",
});
Content copied to clipboard
import pulumi
import pulumi_azure as azure
example = azure.core.ResourceGroup("example",
name="example-resources",
location="West Europe")
example_account = azure.automation.Account("example",
name="example-account",
location=example.location,
resource_group_name=example.name,
sku_name="Basic")
example_source_control = azure.automation.SourceControl("example",
name="example",
automation_account_id=example_account.id,
folder_path="runbook",
security={
"token": "ghp_xxx",
"token_type": "PersonalAccessToken",
},
repository_url="https://github.com/foo/bat.git",
source_control_type="GitHub",
branch="main")
Content copied to clipboard
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Azure = Pulumi.Azure;
return await Deployment.RunAsync(() =>
{
var example = new Azure.Core.ResourceGroup("example", new()
{
Name = "example-resources",
Location = "West Europe",
});
var exampleAccount = new Azure.Automation.Account("example", new()
{
Name = "example-account",
Location = example.Location,
ResourceGroupName = example.Name,
SkuName = "Basic",
});
var exampleSourceControl = new Azure.Automation.SourceControl("example", new()
{
Name = "example",
AutomationAccountId = exampleAccount.Id,
FolderPath = "runbook",
Security = new Azure.Automation.Inputs.SourceControlSecurityArgs
{
Token = "ghp_xxx",
TokenType = "PersonalAccessToken",
},
RepositoryUrl = "https://github.com/foo/bat.git",
SourceControlType = "GitHub",
Branch = "main",
});
});
Content copied to clipboard
package main
import (
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/automation"
"github.com/pulumi/pulumi-azure/sdk/v6/go/azure/core"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
example, err := core.NewResourceGroup(ctx, "example", &core.ResourceGroupArgs{
Name: pulumi.String("example-resources"),
Location: pulumi.String("West Europe"),
})
if err != nil {
return err
}
exampleAccount, err := automation.NewAccount(ctx, "example", &automation.AccountArgs{
Name: pulumi.String("example-account"),
Location: example.Location,
ResourceGroupName: example.Name,
SkuName: pulumi.String("Basic"),
})
if err != nil {
return err
}
_, err = automation.NewSourceControl(ctx, "example", &automation.SourceControlArgs{
Name: pulumi.String("example"),
AutomationAccountId: exampleAccount.ID(),
FolderPath: pulumi.String("runbook"),
Security: &automation.SourceControlSecurityArgs{
Token: pulumi.String("ghp_xxx"),
TokenType: pulumi.String("PersonalAccessToken"),
},
RepositoryUrl: pulumi.String("https://github.com/foo/bat.git"),
SourceControlType: pulumi.String("GitHub"),
Branch: pulumi.String("main"),
})
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.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.automation.Account;
import com.pulumi.azure.automation.AccountArgs;
import com.pulumi.azure.automation.SourceControl;
import com.pulumi.azure.automation.SourceControlArgs;
import com.pulumi.azure.automation.inputs.SourceControlSecurityArgs;
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 example = new ResourceGroup("example", ResourceGroupArgs.builder()
.name("example-resources")
.location("West Europe")
.build());
var exampleAccount = new Account("exampleAccount", AccountArgs.builder()
.name("example-account")
.location(example.location())
.resourceGroupName(example.name())
.skuName("Basic")
.build());
var exampleSourceControl = new SourceControl("exampleSourceControl", SourceControlArgs.builder()
.name("example")
.automationAccountId(exampleAccount.id())
.folderPath("runbook")
.security(SourceControlSecurityArgs.builder()
.token("ghp_xxx")
.tokenType("PersonalAccessToken")
.build())
.repositoryUrl("https://github.com/foo/bat.git")
.sourceControlType("GitHub")
.branch("main")
.build());
}
}
Content copied to clipboard
resources:
example:
type: azure:core:ResourceGroup
properties:
name: example-resources
location: West Europe
exampleAccount:
type: azure:automation:Account
name: example
properties:
name: example-account
location: ${example.location}
resourceGroupName: ${example.name}
skuName: Basic
exampleSourceControl:
type: azure:automation:SourceControl
name: example
properties:
name: example
automationAccountId: ${exampleAccount.id}
folderPath: runbook
security:
token: ghp_xxx
tokenType: PersonalAccessToken
repositoryUrl: https://github.com/foo/bat.git
sourceControlType: GitHub
branch: main
Content copied to clipboard
API Providers
This resource uses the following Azure API Providers:
Microsoft.Automation
: 2023-11-01
Import
Automations can be imported using the resource id
, e.g.
$ pulumi import azure:automation/sourceControl:SourceControl example /subscriptions/12345678-1234-9876-4563-123456789012/resourceGroups/group1/providers/Microsoft.Automation/automationAccounts/account1/sourceControls/sc1
Content copied to clipboard
Constructors
Link copied to clipboard
constructor(automaticSync: Output<Boolean>? = null, automationAccountId: Output<String>? = null, branch: Output<String>? = null, description: Output<String>? = null, folderPath: Output<String>? = null, name: Output<String>? = null, publishRunbookEnabled: Output<Boolean>? = null, repositoryUrl: Output<String>? = null, security: Output<SourceControlSecurityArgs>? = null, sourceControlType: Output<String>? = null)
Properties
Link copied to clipboard
Whether auto async the Source Control.
Link copied to clipboard
The ID of Automation Account to manage this Source Control. Changing this forces a new Automation Source Control to be created.
Link copied to clipboard
A short description of the Source Control.
Link copied to clipboard
The folder path of the source control. This Path must be relative.
Link copied to clipboard
Whether auto publish the Source Control. Defaults to true
.
Link copied to clipboard
The Repository URL of the source control.
Link copied to clipboard
A security
block as defined below.
Link copied to clipboard
The source type of Source Control, possible vaules are VsoGit
, VsoTfvc
and GitHub
, and the value is case sensitive.