1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. DevOps
  5. RepositoryRef
Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi

oci.DevOps.RepositoryRef

Explore with Pulumi AI

This resource provides the Repository Ref resource in Oracle Cloud Infrastructure Devops service.

Creates a new reference or updates an existing one. This API will be deprecated on Wed, 12 June 2024 01:00:00 GMT as it does not get recognized when refName has ‘/’. This will be replaced by “/repositories/{repositoryId}/actions/createOrUpdateGitRef”

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testRepositoryRef = new oci.devops.RepositoryRef("test_repository_ref", {
    refName: repositoryRefRefName,
    refType: repositoryRefRefType,
    repositoryId: testRepository.id,
    commitId: testCommit.id,
    objectId: testObject.id,
});
Copy
import pulumi
import pulumi_oci as oci

test_repository_ref = oci.dev_ops.RepositoryRef("test_repository_ref",
    ref_name=repository_ref_ref_name,
    ref_type=repository_ref_ref_type,
    repository_id=test_repository["id"],
    commit_id=test_commit["id"],
    object_id=test_object["id"])
Copy
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/devops"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := devops.NewRepositoryRef(ctx, "test_repository_ref", &devops.RepositoryRefArgs{
			RefName:      pulumi.Any(repositoryRefRefName),
			RefType:      pulumi.Any(repositoryRefRefType),
			RepositoryId: pulumi.Any(testRepository.Id),
			CommitId:     pulumi.Any(testCommit.Id),
			ObjectId:     pulumi.Any(testObject.Id),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testRepositoryRef = new Oci.DevOps.RepositoryRef("test_repository_ref", new()
    {
        RefName = repositoryRefRefName,
        RefType = repositoryRefRefType,
        RepositoryId = testRepository.Id,
        CommitId = testCommit.Id,
        ObjectId = testObject.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.DevOps.RepositoryRef;
import com.pulumi.oci.DevOps.RepositoryRefArgs;
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 testRepositoryRef = new RepositoryRef("testRepositoryRef", RepositoryRefArgs.builder()
            .refName(repositoryRefRefName)
            .refType(repositoryRefRefType)
            .repositoryId(testRepository.id())
            .commitId(testCommit.id())
            .objectId(testObject.id())
            .build());

    }
}
Copy
resources:
  testRepositoryRef:
    type: oci:DevOps:RepositoryRef
    name: test_repository_ref
    properties:
      refName: ${repositoryRefRefName}
      refType: ${repositoryRefRefType}
      repositoryId: ${testRepository.id}
      commitId: ${testCommit.id}
      objectId: ${testObject.id}
Copy

Create RepositoryRef Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new RepositoryRef(name: string, args: RepositoryRefArgs, opts?: CustomResourceOptions);
@overload
def RepositoryRef(resource_name: str,
                  args: RepositoryRefArgs,
                  opts: Optional[ResourceOptions] = None)

@overload
def RepositoryRef(resource_name: str,
                  opts: Optional[ResourceOptions] = None,
                  ref_name: Optional[str] = None,
                  ref_type: Optional[str] = None,
                  repository_id: Optional[str] = None,
                  commit_id: Optional[str] = None,
                  object_id: Optional[str] = None)
func NewRepositoryRef(ctx *Context, name string, args RepositoryRefArgs, opts ...ResourceOption) (*RepositoryRef, error)
public RepositoryRef(string name, RepositoryRefArgs args, CustomResourceOptions? opts = null)
public RepositoryRef(String name, RepositoryRefArgs args)
public RepositoryRef(String name, RepositoryRefArgs args, CustomResourceOptions options)
type: oci:DevOps:RepositoryRef
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. RepositoryRefArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. RepositoryRefArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. RepositoryRefArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. RepositoryRefArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. RepositoryRefArgs
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 repositoryRefResource = new Oci.DevOps.RepositoryRef("repositoryRefResource", new()
{
    RefName = "string",
    RefType = "string",
    RepositoryId = "string",
    CommitId = "string",
    ObjectId = "string",
});
Copy
example, err := DevOps.NewRepositoryRef(ctx, "repositoryRefResource", &DevOps.RepositoryRefArgs{
	RefName:      pulumi.String("string"),
	RefType:      pulumi.String("string"),
	RepositoryId: pulumi.String("string"),
	CommitId:     pulumi.String("string"),
	ObjectId:     pulumi.String("string"),
})
Copy
var repositoryRefResource = new RepositoryRef("repositoryRefResource", RepositoryRefArgs.builder()
    .refName("string")
    .refType("string")
    .repositoryId("string")
    .commitId("string")
    .objectId("string")
    .build());
Copy
repository_ref_resource = oci.dev_ops.RepositoryRef("repositoryRefResource",
    ref_name="string",
    ref_type="string",
    repository_id="string",
    commit_id="string",
    object_id="string")
Copy
const repositoryRefResource = new oci.devops.RepositoryRef("repositoryRefResource", {
    refName: "string",
    refType: "string",
    repositoryId: "string",
    commitId: "string",
    objectId: "string",
});
Copy
type: oci:DevOps:RepositoryRef
properties:
    commitId: string
    objectId: string
    refName: string
    refType: string
    repositoryId: string
Copy

RepositoryRef 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 RepositoryRef resource accepts the following input properties:

RefName
This property is required.
Changes to this property will trigger replacement.
string
A filter to return only resources that match the given reference name.
RefType This property is required. string
(Updatable) The type of reference (BRANCH or TAG).
RepositoryId
This property is required.
Changes to this property will trigger replacement.
string

Unique repository identifier.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

CommitId string
(Updatable) Commit ID pointed to by the new branch.
ObjectId string
(Updatable) SHA-1 hash value of the object pointed to by the tag.
RefName
This property is required.
Changes to this property will trigger replacement.
string
A filter to return only resources that match the given reference name.
RefType This property is required. string
(Updatable) The type of reference (BRANCH or TAG).
RepositoryId
This property is required.
Changes to this property will trigger replacement.
string

Unique repository identifier.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

CommitId string
(Updatable) Commit ID pointed to by the new branch.
ObjectId string
(Updatable) SHA-1 hash value of the object pointed to by the tag.
refName
This property is required.
Changes to this property will trigger replacement.
String
A filter to return only resources that match the given reference name.
refType This property is required. String
(Updatable) The type of reference (BRANCH or TAG).
repositoryId
This property is required.
Changes to this property will trigger replacement.
String

Unique repository identifier.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

commitId String
(Updatable) Commit ID pointed to by the new branch.
objectId String
(Updatable) SHA-1 hash value of the object pointed to by the tag.
refName
This property is required.
Changes to this property will trigger replacement.
string
A filter to return only resources that match the given reference name.
refType This property is required. string
(Updatable) The type of reference (BRANCH or TAG).
repositoryId
This property is required.
Changes to this property will trigger replacement.
string

Unique repository identifier.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

commitId string
(Updatable) Commit ID pointed to by the new branch.
objectId string
(Updatable) SHA-1 hash value of the object pointed to by the tag.
ref_name
This property is required.
Changes to this property will trigger replacement.
str
A filter to return only resources that match the given reference name.
ref_type This property is required. str
(Updatable) The type of reference (BRANCH or TAG).
repository_id
This property is required.
Changes to this property will trigger replacement.
str

Unique repository identifier.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

commit_id str
(Updatable) Commit ID pointed to by the new branch.
object_id str
(Updatable) SHA-1 hash value of the object pointed to by the tag.
refName
This property is required.
Changes to this property will trigger replacement.
String
A filter to return only resources that match the given reference name.
refType This property is required. String
(Updatable) The type of reference (BRANCH or TAG).
repositoryId
This property is required.
Changes to this property will trigger replacement.
String

Unique repository identifier.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

commitId String
(Updatable) Commit ID pointed to by the new branch.
objectId String
(Updatable) SHA-1 hash value of the object pointed to by the tag.

Outputs

All input properties are implicitly available as output properties. Additionally, the RepositoryRef resource produces the following output properties:

DefinedTags Dictionary<string, string>
Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags. Example: {"foo-namespace.bar-key": "value"}
FreeformTags Dictionary<string, string>
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See Resource Tags. Example: {"bar-key": "value"}
FullRefName string
Unique full reference name inside a repository.
Id string
The provider-assigned unique ID for this managed resource.
DefinedTags map[string]string
Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags. Example: {"foo-namespace.bar-key": "value"}
FreeformTags map[string]string
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See Resource Tags. Example: {"bar-key": "value"}
FullRefName string
Unique full reference name inside a repository.
Id string
The provider-assigned unique ID for this managed resource.
definedTags Map<String,String>
Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags. Example: {"foo-namespace.bar-key": "value"}
freeformTags Map<String,String>
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See Resource Tags. Example: {"bar-key": "value"}
fullRefName String
Unique full reference name inside a repository.
id String
The provider-assigned unique ID for this managed resource.
definedTags {[key: string]: string}
Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags. Example: {"foo-namespace.bar-key": "value"}
freeformTags {[key: string]: string}
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See Resource Tags. Example: {"bar-key": "value"}
fullRefName string
Unique full reference name inside a repository.
id string
The provider-assigned unique ID for this managed resource.
defined_tags Mapping[str, str]
Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags. Example: {"foo-namespace.bar-key": "value"}
freeform_tags Mapping[str, str]
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See Resource Tags. Example: {"bar-key": "value"}
full_ref_name str
Unique full reference name inside a repository.
id str
The provider-assigned unique ID for this managed resource.
definedTags Map<String>
Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags. Example: {"foo-namespace.bar-key": "value"}
freeformTags Map<String>
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See Resource Tags. Example: {"bar-key": "value"}
fullRefName String
Unique full reference name inside a repository.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing RepositoryRef Resource

Get an existing RepositoryRef 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?: RepositoryRefState, opts?: CustomResourceOptions): RepositoryRef
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        commit_id: Optional[str] = None,
        defined_tags: Optional[Mapping[str, str]] = None,
        freeform_tags: Optional[Mapping[str, str]] = None,
        full_ref_name: Optional[str] = None,
        object_id: Optional[str] = None,
        ref_name: Optional[str] = None,
        ref_type: Optional[str] = None,
        repository_id: Optional[str] = None) -> RepositoryRef
func GetRepositoryRef(ctx *Context, name string, id IDInput, state *RepositoryRefState, opts ...ResourceOption) (*RepositoryRef, error)
public static RepositoryRef Get(string name, Input<string> id, RepositoryRefState? state, CustomResourceOptions? opts = null)
public static RepositoryRef get(String name, Output<String> id, RepositoryRefState state, CustomResourceOptions options)
resources:  _:    type: oci:DevOps:RepositoryRef    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
CommitId string
(Updatable) Commit ID pointed to by the new branch.
DefinedTags Dictionary<string, string>
Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags. Example: {"foo-namespace.bar-key": "value"}
FreeformTags Dictionary<string, string>
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See Resource Tags. Example: {"bar-key": "value"}
FullRefName string
Unique full reference name inside a repository.
ObjectId string
(Updatable) SHA-1 hash value of the object pointed to by the tag.
RefName Changes to this property will trigger replacement. string
A filter to return only resources that match the given reference name.
RefType string
(Updatable) The type of reference (BRANCH or TAG).
RepositoryId Changes to this property will trigger replacement. string

Unique repository identifier.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

CommitId string
(Updatable) Commit ID pointed to by the new branch.
DefinedTags map[string]string
Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags. Example: {"foo-namespace.bar-key": "value"}
FreeformTags map[string]string
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See Resource Tags. Example: {"bar-key": "value"}
FullRefName string
Unique full reference name inside a repository.
ObjectId string
(Updatable) SHA-1 hash value of the object pointed to by the tag.
RefName Changes to this property will trigger replacement. string
A filter to return only resources that match the given reference name.
RefType string
(Updatable) The type of reference (BRANCH or TAG).
RepositoryId Changes to this property will trigger replacement. string

Unique repository identifier.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

commitId String
(Updatable) Commit ID pointed to by the new branch.
definedTags Map<String,String>
Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags. Example: {"foo-namespace.bar-key": "value"}
freeformTags Map<String,String>
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See Resource Tags. Example: {"bar-key": "value"}
fullRefName String
Unique full reference name inside a repository.
objectId String
(Updatable) SHA-1 hash value of the object pointed to by the tag.
refName Changes to this property will trigger replacement. String
A filter to return only resources that match the given reference name.
refType String
(Updatable) The type of reference (BRANCH or TAG).
repositoryId Changes to this property will trigger replacement. String

Unique repository identifier.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

commitId string
(Updatable) Commit ID pointed to by the new branch.
definedTags {[key: string]: string}
Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags. Example: {"foo-namespace.bar-key": "value"}
freeformTags {[key: string]: string}
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See Resource Tags. Example: {"bar-key": "value"}
fullRefName string
Unique full reference name inside a repository.
objectId string
(Updatable) SHA-1 hash value of the object pointed to by the tag.
refName Changes to this property will trigger replacement. string
A filter to return only resources that match the given reference name.
refType string
(Updatable) The type of reference (BRANCH or TAG).
repositoryId Changes to this property will trigger replacement. string

Unique repository identifier.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

commit_id str
(Updatable) Commit ID pointed to by the new branch.
defined_tags Mapping[str, str]
Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags. Example: {"foo-namespace.bar-key": "value"}
freeform_tags Mapping[str, str]
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See Resource Tags. Example: {"bar-key": "value"}
full_ref_name str
Unique full reference name inside a repository.
object_id str
(Updatable) SHA-1 hash value of the object pointed to by the tag.
ref_name Changes to this property will trigger replacement. str
A filter to return only resources that match the given reference name.
ref_type str
(Updatable) The type of reference (BRANCH or TAG).
repository_id Changes to this property will trigger replacement. str

Unique repository identifier.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

commitId String
(Updatable) Commit ID pointed to by the new branch.
definedTags Map<String>
Defined tags for this resource. Each key is predefined and scoped to a namespace. See Resource Tags. Example: {"foo-namespace.bar-key": "value"}
freeformTags Map<String>
Simple key-value pair that is applied without any predefined name, type or scope. Exists for cross-compatibility only. See Resource Tags. Example: {"bar-key": "value"}
fullRefName String
Unique full reference name inside a repository.
objectId String
(Updatable) SHA-1 hash value of the object pointed to by the tag.
refName Changes to this property will trigger replacement. String
A filter to return only resources that match the given reference name.
refType String
(Updatable) The type of reference (BRANCH or TAG).
repositoryId Changes to this property will trigger replacement. String

Unique repository identifier.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

Import

RepositoryRefs can be imported using the id, e.g.

$ pulumi import oci:DevOps/repositoryRef:RepositoryRef test_repository_ref "repositories/{repositoryId}/refs/{refName}"
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes
This Pulumi package is based on the oci Terraform Provider.