oci.DevOps.RepositoryProtectedBranchManagement
Explore with Pulumi AI
This resource provides the Repository Protected Branch Management resource in Oracle Cloud Infrastructure Devops service.
Creates a restriction on a branch that prevents certain actions on it.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testRepositoryProtectedBranchManagement = new oci.devops.RepositoryProtectedBranchManagement("test_repository_protected_branch_management", {
branchName: repositoryProtectedBranchManagementBranchName,
repositoryId: testRepository.id,
protectionLevels: repositoryProtectedBranchManagementProtectionLevels,
});
import pulumi
import pulumi_oci as oci
test_repository_protected_branch_management = oci.dev_ops.RepositoryProtectedBranchManagement("test_repository_protected_branch_management",
branch_name=repository_protected_branch_management_branch_name,
repository_id=test_repository["id"],
protection_levels=repository_protected_branch_management_protection_levels)
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.NewRepositoryProtectedBranchManagement(ctx, "test_repository_protected_branch_management", &DevOps.RepositoryProtectedBranchManagementArgs{
BranchName: pulumi.Any(repositoryProtectedBranchManagementBranchName),
RepositoryId: pulumi.Any(testRepository.Id),
ProtectionLevels: pulumi.Any(repositoryProtectedBranchManagementProtectionLevels),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() =>
{
var testRepositoryProtectedBranchManagement = new Oci.DevOps.RepositoryProtectedBranchManagement("test_repository_protected_branch_management", new()
{
BranchName = repositoryProtectedBranchManagementBranchName,
RepositoryId = testRepository.Id,
ProtectionLevels = repositoryProtectedBranchManagementProtectionLevels,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.DevOps.RepositoryProtectedBranchManagement;
import com.pulumi.oci.DevOps.RepositoryProtectedBranchManagementArgs;
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 testRepositoryProtectedBranchManagement = new RepositoryProtectedBranchManagement("testRepositoryProtectedBranchManagement", RepositoryProtectedBranchManagementArgs.builder()
.branchName(repositoryProtectedBranchManagementBranchName)
.repositoryId(testRepository.id())
.protectionLevels(repositoryProtectedBranchManagementProtectionLevels)
.build());
}
}
resources:
testRepositoryProtectedBranchManagement:
type: oci:DevOps:RepositoryProtectedBranchManagement
name: test_repository_protected_branch_management
properties:
branchName: ${repositoryProtectedBranchManagementBranchName}
repositoryId: ${testRepository.id}
protectionLevels: ${repositoryProtectedBranchManagementProtectionLevels}
Create RepositoryProtectedBranchManagement Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RepositoryProtectedBranchManagement(name: string, args: RepositoryProtectedBranchManagementArgs, opts?: CustomResourceOptions);
@overload
def RepositoryProtectedBranchManagement(resource_name: str,
args: RepositoryProtectedBranchManagementArgs,
opts: Optional[ResourceOptions] = None)
@overload
def RepositoryProtectedBranchManagement(resource_name: str,
opts: Optional[ResourceOptions] = None,
branch_name: Optional[str] = None,
repository_id: Optional[str] = None,
protection_levels: Optional[Sequence[str]] = None)
func NewRepositoryProtectedBranchManagement(ctx *Context, name string, args RepositoryProtectedBranchManagementArgs, opts ...ResourceOption) (*RepositoryProtectedBranchManagement, error)
public RepositoryProtectedBranchManagement(string name, RepositoryProtectedBranchManagementArgs args, CustomResourceOptions? opts = null)
public RepositoryProtectedBranchManagement(String name, RepositoryProtectedBranchManagementArgs args)
public RepositoryProtectedBranchManagement(String name, RepositoryProtectedBranchManagementArgs args, CustomResourceOptions options)
type: oci:DevOps:RepositoryProtectedBranchManagement
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 RepositoryProtectedBranchManagementArgs
- 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 RepositoryProtectedBranchManagementArgs
- 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 RepositoryProtectedBranchManagementArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RepositoryProtectedBranchManagementArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RepositoryProtectedBranchManagementArgs
- 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 repositoryProtectedBranchManagementResource = new Oci.DevOps.RepositoryProtectedBranchManagement("repositoryProtectedBranchManagementResource", new()
{
BranchName = "string",
RepositoryId = "string",
ProtectionLevels = new[]
{
"string",
},
});
example, err := DevOps.NewRepositoryProtectedBranchManagement(ctx, "repositoryProtectedBranchManagementResource", &DevOps.RepositoryProtectedBranchManagementArgs{
BranchName: pulumi.String("string"),
RepositoryId: pulumi.String("string"),
ProtectionLevels: pulumi.StringArray{
pulumi.String("string"),
},
})
var repositoryProtectedBranchManagementResource = new RepositoryProtectedBranchManagement("repositoryProtectedBranchManagementResource", RepositoryProtectedBranchManagementArgs.builder()
.branchName("string")
.repositoryId("string")
.protectionLevels("string")
.build());
repository_protected_branch_management_resource = oci.dev_ops.RepositoryProtectedBranchManagement("repositoryProtectedBranchManagementResource",
branch_name="string",
repository_id="string",
protection_levels=["string"])
const repositoryProtectedBranchManagementResource = new oci.devops.RepositoryProtectedBranchManagement("repositoryProtectedBranchManagementResource", {
branchName: "string",
repositoryId: "string",
protectionLevels: ["string"],
});
type: oci:DevOps:RepositoryProtectedBranchManagement
properties:
branchName: string
protectionLevels:
- string
repositoryId: string
RepositoryProtectedBranchManagement 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 RepositoryProtectedBranchManagement resource accepts the following input properties:
- Branch
Name string - Name of a branch to protect.
- Repository
Id 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
- Protection
Levels List<string> - Level of protection to add on a branch.
- Branch
Name string - Name of a branch to protect.
- Repository
Id 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
- Protection
Levels []string - Level of protection to add on a branch.
- branch
Name String - Name of a branch to protect.
- repository
Id 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
- protection
Levels List<String> - Level of protection to add on a branch.
- branch
Name string - Name of a branch to protect.
- repository
Id 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
- protection
Levels string[] - Level of protection to add on a branch.
- branch_
name str - Name of a branch to protect.
- repository_
id 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
- protection_
levels Sequence[str] - Level of protection to add on a branch.
- branch
Name String - Name of a branch to protect.
- repository
Id 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
- protection
Levels List<String> - Level of protection to add on a branch.
Outputs
All input properties are implicitly available as output properties. Additionally, the RepositoryProtectedBranchManagement resource produces the following output properties:
- 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"}
- Id string
- The provider-assigned unique ID for this managed resource.
- 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"}
- Id string
- The provider-assigned unique ID for this managed resource.
- 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"}
- id String
- The provider-assigned unique ID for this managed resource.
- {[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"}
- id string
- The provider-assigned unique ID for this managed resource.
- 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"}
- id str
- The provider-assigned unique ID for this managed resource.
- 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"}
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing RepositoryProtectedBranchManagement Resource
Get an existing RepositoryProtectedBranchManagement 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?: RepositoryProtectedBranchManagementState, opts?: CustomResourceOptions): RepositoryProtectedBranchManagement
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
branch_name: Optional[str] = None,
freeform_tags: Optional[Mapping[str, str]] = None,
protection_levels: Optional[Sequence[str]] = None,
repository_id: Optional[str] = None) -> RepositoryProtectedBranchManagement
func GetRepositoryProtectedBranchManagement(ctx *Context, name string, id IDInput, state *RepositoryProtectedBranchManagementState, opts ...ResourceOption) (*RepositoryProtectedBranchManagement, error)
public static RepositoryProtectedBranchManagement Get(string name, Input<string> id, RepositoryProtectedBranchManagementState? state, CustomResourceOptions? opts = null)
public static RepositoryProtectedBranchManagement get(String name, Output<String> id, RepositoryProtectedBranchManagementState 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.
- Branch
Name string - Name of a branch to protect.
- 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"}
- Protection
Levels List<string> - Level of protection to add on a branch.
- Repository
Id 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
- Branch
Name string - Name of a branch to protect.
- 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"}
- Protection
Levels []string - Level of protection to add on a branch.
- Repository
Id 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
- branch
Name String - Name of a branch to protect.
- 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"}
- protection
Levels List<String> - Level of protection to add on a branch.
- repository
Id 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
- branch
Name string - Name of a branch to protect.
- {[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"}
- protection
Levels string[] - Level of protection to add on a branch.
- repository
Id 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
- branch_
name str - Name of a branch to protect.
- 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"}
- protection_
levels Sequence[str] - Level of protection to add on a branch.
- repository_
id 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
- branch
Name String - Name of a branch to protect.
- 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"}
- protection
Levels List<String> - Level of protection to add on a branch.
- repository
Id 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
Import is not supported for this resource.
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.