Azure DevOps v2.7.0, Mar 27 23
Azure DevOps v2.7.0, Mar 27 23
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
hcl resource “azuredevops_project” “example” {
name
= “Example Project”
visibility
= “private”
version_control
= “Git”
work_item_template = “Agile” } resource “azuredevops_git_repository” “example” {
project_id
= azuredevops_project.example.id
name
= “Example Git Repository”
default_branch = “refs/heads/main”
initialization {
init_type = “Clean”
}
lifecycle {
ignore_changes = [
Ignore changes to initialization to support importing existing repositories
Given that a repo now exists, either imported into terraform state or created by terraform,
we don’t care for the configuration of initialization against the existing resource
initialization,
]
} }
Create Git Resource
new Git(name: string, args: GitArgs, opts?: CustomResourceOptions);
@overload
def Git(resource_name: str,
opts: Optional[ResourceOptions] = None,
default_branch: Optional[str] = None,
initialization: Optional[GitInitializationArgs] = None,
name: Optional[str] = None,
parent_repository_id: Optional[str] = None,
project_id: Optional[str] = None)
@overload
def Git(resource_name: str,
args: GitArgs,
opts: Optional[ResourceOptions] = 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.
- 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.
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
The Git resource accepts the following input properties:
- Initialization
Pulumi.
Azure Dev Ops. Inputs. 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- 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,
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.
- Initialization
Pulumi.
Azure Dev Ops. Inputs. 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.
- 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.
- initialization
Git
Initialization Args 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.
- initialization
Git
Initialization Args 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.
- 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.
- 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
- 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.