azuredevops.Git
Explore with Pulumi AI
Import
Azure DevOps Repositories can be imported using the repo name or by the repo Guid e.g.
$ pulumi import azuredevops:index/git:Git example projectName/repoName
or
$ pulumi import azuredevops:index/git:Git example projectName/00000000-0000-0000-0000-000000000000
Create Git Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Git(name: string, args: GitArgs, opts?: CustomResourceOptions);
@overload
def Git(resource_name: str,
args: GitArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Git(resource_name: str,
opts: Optional[ResourceOptions] = None,
initialization: Optional[GitInitializationArgs] = None,
project_id: Optional[str] = None,
default_branch: Optional[str] = None,
disabled: Optional[bool] = None,
name: Optional[str] = None,
parent_repository_id: Optional[str] = None)
func NewGit(ctx *Context, name string, args GitArgs, opts ...ResourceOption) (*Git, error)
public Git(string name, GitArgs args, CustomResourceOptions? opts = null)
type: azuredevops:Git
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 GitArgs
- 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 GitArgs
- 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 GitArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args GitArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args GitArgs
- 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 gitResource = new AzureDevOps.Git("gitResource", new()
{
Initialization = new AzureDevOps.Inputs.GitInitializationArgs
{
InitType = "string",
ServiceConnectionId = "string",
SourceType = "string",
SourceUrl = "string",
},
ProjectId = "string",
DefaultBranch = "string",
Disabled = false,
Name = "string",
ParentRepositoryId = "string",
});
example, err := azuredevops.NewGit(ctx, "gitResource", &azuredevops.GitArgs{
Initialization: &azuredevops.GitInitializationArgs{
InitType: pulumi.String("string"),
ServiceConnectionId: pulumi.String("string"),
SourceType: pulumi.String("string"),
SourceUrl: pulumi.String("string"),
},
ProjectId: pulumi.String("string"),
DefaultBranch: pulumi.String("string"),
Disabled: pulumi.Bool(false),
Name: pulumi.String("string"),
ParentRepositoryId: pulumi.String("string"),
})
var gitResource = new Git("gitResource", GitArgs.builder()
.initialization(GitInitializationArgs.builder()
.initType("string")
.serviceConnectionId("string")
.sourceType("string")
.sourceUrl("string")
.build())
.projectId("string")
.defaultBranch("string")
.disabled(false)
.name("string")
.parentRepositoryId("string")
.build());
git_resource = azuredevops.Git("gitResource",
initialization={
"init_type": "string",
"service_connection_id": "string",
"source_type": "string",
"source_url": "string",
},
project_id="string",
default_branch="string",
disabled=False,
name="string",
parent_repository_id="string")
const gitResource = new azuredevops.Git("gitResource", {
initialization: {
initType: "string",
serviceConnectionId: "string",
sourceType: "string",
sourceUrl: "string",
},
projectId: "string",
defaultBranch: "string",
disabled: false,
name: "string",
parentRepositoryId: "string",
});
type: azuredevops:Git
properties:
defaultBranch: string
disabled: false
initialization:
initType: string
serviceConnectionId: string
sourceType: string
sourceUrl: string
name: string
parentRepositoryId: string
projectId: string
Git Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The Git resource accepts the following input properties:
- Initialization
Pulumi.
Azure Dev Ops. Inputs. Git Initialization - An
initialization
block as documented below. - Project
Id string - The project ID or project name.
- Default
Branch string - The ref of the default branch. Will be used as the branch name for initialized repositories.
- Disabled bool
- The ability to disable or enable the repository. Defaults to
false
. - Name string
- The name of the git repository.
- Parent
Repository stringId - The ID of a Git project from which a fork is to be created.
- Initialization
Git
Initialization Args - An
initialization
block as documented below. - Project
Id string - The project ID or project name.
- Default
Branch string - The ref of the default branch. Will be used as the branch name for initialized repositories.
- Disabled bool
- The ability to disable or enable the repository. Defaults to
false
. - Name string
- The name of the git repository.
- Parent
Repository stringId - The ID of a Git project from which a fork is to be created.
- initialization
Git
Initialization - An
initialization
block as documented below. - project
Id String - The project ID or project name.
- default
Branch String - The ref of the default branch. Will be used as the branch name for initialized repositories.
- disabled Boolean
- The ability to disable or enable the repository. Defaults to
false
. - name String
- The name of the git repository.
- parent
Repository StringId - The ID of a Git project from which a fork is to be created.
- initialization
Git
Initialization - An
initialization
block as documented below. - project
Id string - The project ID or project name.
- default
Branch string - The ref of the default branch. Will be used as the branch name for initialized repositories.
- disabled boolean
- The ability to disable or enable the repository. Defaults to
false
. - name string
- The name of the git repository.
- parent
Repository stringId - The ID of a Git project from which a fork is to be created.
- initialization
Git
Initialization Args - An
initialization
block as documented below. - project_
id str - The project ID or project name.
- default_
branch str - The ref of the default branch. Will be used as the branch name for initialized repositories.
- disabled bool
- The ability to disable or enable the repository. Defaults to
false
. - name str
- The name of the git repository.
- parent_
repository_ strid - The ID of a Git project from which a fork is to be created.
- initialization Property Map
- An
initialization
block as documented below. - project
Id String - The project ID or project name.
- default
Branch String - The ref of the default branch. Will be used as the branch name for initialized repositories.
- disabled Boolean
- The ability to disable or enable the repository. Defaults to
false
. - name String
- The name of the git repository.
- parent
Repository StringId - The ID of a Git project from which a fork is to be created.
Outputs
All input properties are implicitly available as output properties. Additionally, the Git resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Is
Fork bool - True if the repository was created as a fork.
- Remote
Url string - Git HTTPS URL of the repository
- Size int
- Size in bytes.
- Ssh
Url string - Git SSH URL of the repository.
- Url string
- REST API URL of the repository.
- Web
Url string - Web link to the repository.
- Id string
- The provider-assigned unique ID for this managed resource.
- Is
Fork bool - True if the repository was created as a fork.
- Remote
Url string - Git HTTPS URL of the repository
- Size int
- Size in bytes.
- Ssh
Url string - Git SSH URL of the repository.
- Url string
- REST API URL of the repository.
- Web
Url string - Web link to the repository.
- id String
- The provider-assigned unique ID for this managed resource.
- is
Fork Boolean - True if the repository was created as a fork.
- remote
Url String - Git HTTPS URL of the repository
- size Integer
- Size in bytes.
- ssh
Url String - Git SSH URL of the repository.
- url String
- REST API URL of the repository.
- web
Url String - Web link to the repository.
- id string
- The provider-assigned unique ID for this managed resource.
- is
Fork boolean - True if the repository was created as a fork.
- remote
Url string - Git HTTPS URL of the repository
- size number
- Size in bytes.
- ssh
Url string - Git SSH URL of the repository.
- url string
- REST API URL of the repository.
- web
Url string - Web link to the repository.
- id str
- The provider-assigned unique ID for this managed resource.
- is_
fork bool - True if the repository was created as a fork.
- remote_
url str - Git HTTPS URL of the repository
- size int
- Size in bytes.
- ssh_
url str - Git SSH URL of the repository.
- url str
- REST API URL of the repository.
- web_
url str - Web link to the repository.
- id String
- The provider-assigned unique ID for this managed resource.
- is
Fork Boolean - True if the repository was created as a fork.
- remote
Url String - Git HTTPS URL of the repository
- size Number
- Size in bytes.
- ssh
Url String - Git SSH URL of the repository.
- url String
- REST API URL of the repository.
- web
Url String - Web link to the repository.
Look up Existing Git Resource
Get an existing Git resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: GitState, opts?: CustomResourceOptions): Git
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
default_branch: Optional[str] = None,
disabled: Optional[bool] = None,
initialization: Optional[GitInitializationArgs] = None,
is_fork: Optional[bool] = None,
name: Optional[str] = None,
parent_repository_id: Optional[str] = None,
project_id: Optional[str] = None,
remote_url: Optional[str] = None,
size: Optional[int] = None,
ssh_url: Optional[str] = None,
url: Optional[str] = None,
web_url: Optional[str] = None) -> Git
func GetGit(ctx *Context, name string, id IDInput, state *GitState, opts ...ResourceOption) (*Git, error)
public static Git Get(string name, Input<string> id, GitState? state, CustomResourceOptions? opts = null)
public static Git get(String name, Output<String> id, GitState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Default
Branch string - The ref of the default branch. Will be used as the branch name for initialized repositories.
- Disabled bool
- The ability to disable or enable the repository. Defaults to
false
. - Initialization
Pulumi.
Azure Dev Ops. Inputs. Git Initialization - An
initialization
block as documented below. - Is
Fork bool - True if the repository was created as a fork.
- Name string
- The name of the git repository.
- Parent
Repository stringId - The ID of a Git project from which a fork is to be created.
- Project
Id string - The project ID or project name.
- Remote
Url string - Git HTTPS URL of the repository
- Size int
- Size in bytes.
- Ssh
Url string - Git SSH URL of the repository.
- Url string
- REST API URL of the repository.
- Web
Url string - Web link to the repository.
- Default
Branch string - The ref of the default branch. Will be used as the branch name for initialized repositories.
- Disabled bool
- The ability to disable or enable the repository. Defaults to
false
. - Initialization
Git
Initialization Args - An
initialization
block as documented below. - Is
Fork bool - True if the repository was created as a fork.
- Name string
- The name of the git repository.
- Parent
Repository stringId - The ID of a Git project from which a fork is to be created.
- Project
Id string - The project ID or project name.
- Remote
Url string - Git HTTPS URL of the repository
- Size int
- Size in bytes.
- Ssh
Url string - Git SSH URL of the repository.
- Url string
- REST API URL of the repository.
- Web
Url string - Web link to the repository.
- default
Branch String - The ref of the default branch. Will be used as the branch name for initialized repositories.
- disabled Boolean
- The ability to disable or enable the repository. Defaults to
false
. - initialization
Git
Initialization - An
initialization
block as documented below. - is
Fork Boolean - True if the repository was created as a fork.
- name String
- The name of the git repository.
- parent
Repository StringId - The ID of a Git project from which a fork is to be created.
- project
Id String - The project ID or project name.
- remote
Url String - Git HTTPS URL of the repository
- size Integer
- Size in bytes.
- ssh
Url String - Git SSH URL of the repository.
- url String
- REST API URL of the repository.
- web
Url String - Web link to the repository.
- default
Branch string - The ref of the default branch. Will be used as the branch name for initialized repositories.
- disabled boolean
- The ability to disable or enable the repository. Defaults to
false
. - initialization
Git
Initialization - An
initialization
block as documented below. - is
Fork boolean - True if the repository was created as a fork.
- name string
- The name of the git repository.
- parent
Repository stringId - The ID of a Git project from which a fork is to be created.
- project
Id string - The project ID or project name.
- remote
Url string - Git HTTPS URL of the repository
- size number
- Size in bytes.
- ssh
Url string - Git SSH URL of the repository.
- url string
- REST API URL of the repository.
- web
Url string - Web link to the repository.
- default_
branch str - The ref of the default branch. Will be used as the branch name for initialized repositories.
- disabled bool
- The ability to disable or enable the repository. Defaults to
false
. - initialization
Git
Initialization Args - An
initialization
block as documented below. - is_
fork bool - True if the repository was created as a fork.
- name str
- The name of the git repository.
- parent_
repository_ strid - The ID of a Git project from which a fork is to be created.
- project_
id str - The project ID or project name.
- remote_
url str - Git HTTPS URL of the repository
- size int
- Size in bytes.
- ssh_
url str - Git SSH URL of the repository.
- url str
- REST API URL of the repository.
- web_
url str - Web link to the repository.
- default
Branch String - The ref of the default branch. Will be used as the branch name for initialized repositories.
- disabled Boolean
- The ability to disable or enable the repository. Defaults to
false
. - initialization Property Map
- An
initialization
block as documented below. - is
Fork Boolean - True if the repository was created as a fork.
- name String
- The name of the git repository.
- parent
Repository StringId - The ID of a Git project from which a fork is to be created.
- project
Id String - The project ID or project name.
- remote
Url String - Git HTTPS URL of the repository
- size Number
- Size in bytes.
- ssh
Url String - Git SSH URL of the repository.
- url String
- REST API URL of the repository.
- web
Url String - Web link to the repository.
Supporting Types
GitInitialization, GitInitializationArgs
- Init
Type string - The type of repository to create. Valid values:
Uninitialized
,Clean
orImport
. - Service
Connection stringId - The id of service connection used to authenticate to a private repository for import initialization.
- Source
Type string - Type of the source repository. Used if the
init_type
isImport
. Valid values:Git
. - Source
Url string - The URL of the source repository. Used if the
init_type
isImport
.
- Init
Type string - The type of repository to create. Valid values:
Uninitialized
,Clean
orImport
. - Service
Connection stringId - The id of service connection used to authenticate to a private repository for import initialization.
- Source
Type string - Type of the source repository. Used if the
init_type
isImport
. Valid values:Git
. - Source
Url string - The URL of the source repository. Used if the
init_type
isImport
.
- init
Type String - The type of repository to create. Valid values:
Uninitialized
,Clean
orImport
. - service
Connection StringId - The id of service connection used to authenticate to a private repository for import initialization.
- source
Type String - Type of the source repository. Used if the
init_type
isImport
. Valid values:Git
. - source
Url String - The URL of the source repository. Used if the
init_type
isImport
.
- init
Type string - The type of repository to create. Valid values:
Uninitialized
,Clean
orImport
. - service
Connection stringId - The id of service connection used to authenticate to a private repository for import initialization.
- source
Type string - Type of the source repository. Used if the
init_type
isImport
. Valid values:Git
. - source
Url string - The URL of the source repository. Used if the
init_type
isImport
.
- init_
type str - The type of repository to create. Valid values:
Uninitialized
,Clean
orImport
. - service_
connection_ strid - The id of service connection used to authenticate to a private repository for import initialization.
- source_
type str - Type of the source repository. Used if the
init_type
isImport
. Valid values:Git
. - source_
url str - The URL of the source repository. Used if the
init_type
isImport
.
- init
Type String - The type of repository to create. Valid values:
Uninitialized
,Clean
orImport
. - service
Connection StringId - The id of service connection used to authenticate to a private repository for import initialization.
- source
Type String - Type of the source repository. Used if the
init_type
isImport
. Valid values:Git
. - source
Url String - The URL of the source repository. Used if the
init_type
isImport
.
Package Details
- Repository
- Azure DevOps pulumi/pulumi-azuredevops
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
azuredevops
Terraform Provider.