1. Packages
  2. Azuredevops Provider
  3. API Docs
  4. ResourceAuthorization
Azure DevOps v3.4.0 published on Wednesday, Oct 30, 2024 by Pulumi

azuredevops.ResourceAuthorization

Explore with Pulumi AI

azuredevops logo
Azure DevOps v3.4.0 published on Wednesday, Oct 30, 2024 by Pulumi

    Manages authorization of resources, e.g. for access in build pipelines.

    Currently supported resources: service endpoint (aka service connection, endpoint).

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as azuredevops from "@pulumi/azuredevops";
    
    const example = new azuredevops.Project("example", {
        name: "Example Project",
        visibility: "private",
        versionControl: "Git",
        workItemTemplate: "Agile",
        description: "Managed by Terraform",
    });
    const exampleServiceEndpointBitBucket = new azuredevops.ServiceEndpointBitBucket("example", {
        projectId: example.id,
        username: "username",
        password: "password",
        serviceEndpointName: "example-bitbucket",
        description: "Managed by Terraform",
    });
    const exampleResourceAuthorization = new azuredevops.ResourceAuthorization("example", {
        projectId: example.id,
        resourceId: exampleServiceEndpointBitBucket.id,
        authorized: true,
    });
    
    import pulumi
    import pulumi_azuredevops as azuredevops
    
    example = azuredevops.Project("example",
        name="Example Project",
        visibility="private",
        version_control="Git",
        work_item_template="Agile",
        description="Managed by Terraform")
    example_service_endpoint_bit_bucket = azuredevops.ServiceEndpointBitBucket("example",
        project_id=example.id,
        username="username",
        password="password",
        service_endpoint_name="example-bitbucket",
        description="Managed by Terraform")
    example_resource_authorization = azuredevops.ResourceAuthorization("example",
        project_id=example.id,
        resource_id=example_service_endpoint_bit_bucket.id,
        authorized=True)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azuredevops/sdk/v3/go/azuredevops"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := azuredevops.NewProject(ctx, "example", &azuredevops.ProjectArgs{
    			Name:             pulumi.String("Example Project"),
    			Visibility:       pulumi.String("private"),
    			VersionControl:   pulumi.String("Git"),
    			WorkItemTemplate: pulumi.String("Agile"),
    			Description:      pulumi.String("Managed by Terraform"),
    		})
    		if err != nil {
    			return err
    		}
    		exampleServiceEndpointBitBucket, err := azuredevops.NewServiceEndpointBitBucket(ctx, "example", &azuredevops.ServiceEndpointBitBucketArgs{
    			ProjectId:           example.ID(),
    			Username:            pulumi.String("username"),
    			Password:            pulumi.String("password"),
    			ServiceEndpointName: pulumi.String("example-bitbucket"),
    			Description:         pulumi.String("Managed by Terraform"),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = azuredevops.NewResourceAuthorization(ctx, "example", &azuredevops.ResourceAuthorizationArgs{
    			ProjectId:  example.ID(),
    			ResourceId: exampleServiceEndpointBitBucket.ID(),
    			Authorized: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureDevOps = Pulumi.AzureDevOps;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new AzureDevOps.Project("example", new()
        {
            Name = "Example Project",
            Visibility = "private",
            VersionControl = "Git",
            WorkItemTemplate = "Agile",
            Description = "Managed by Terraform",
        });
    
        var exampleServiceEndpointBitBucket = new AzureDevOps.ServiceEndpointBitBucket("example", new()
        {
            ProjectId = example.Id,
            Username = "username",
            Password = "password",
            ServiceEndpointName = "example-bitbucket",
            Description = "Managed by Terraform",
        });
    
        var exampleResourceAuthorization = new AzureDevOps.ResourceAuthorization("example", new()
        {
            ProjectId = example.Id,
            ResourceId = exampleServiceEndpointBitBucket.Id,
            Authorized = true,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.azuredevops.Project;
    import com.pulumi.azuredevops.ProjectArgs;
    import com.pulumi.azuredevops.ServiceEndpointBitBucket;
    import com.pulumi.azuredevops.ServiceEndpointBitBucketArgs;
    import com.pulumi.azuredevops.ResourceAuthorization;
    import com.pulumi.azuredevops.ResourceAuthorizationArgs;
    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 Project("example", ProjectArgs.builder()
                .name("Example Project")
                .visibility("private")
                .versionControl("Git")
                .workItemTemplate("Agile")
                .description("Managed by Terraform")
                .build());
    
            var exampleServiceEndpointBitBucket = new ServiceEndpointBitBucket("exampleServiceEndpointBitBucket", ServiceEndpointBitBucketArgs.builder()
                .projectId(example.id())
                .username("username")
                .password("password")
                .serviceEndpointName("example-bitbucket")
                .description("Managed by Terraform")
                .build());
    
            var exampleResourceAuthorization = new ResourceAuthorization("exampleResourceAuthorization", ResourceAuthorizationArgs.builder()
                .projectId(example.id())
                .resourceId(exampleServiceEndpointBitBucket.id())
                .authorized(true)
                .build());
    
        }
    }
    
    resources:
      example:
        type: azuredevops:Project
        properties:
          name: Example Project
          visibility: private
          versionControl: Git
          workItemTemplate: Agile
          description: Managed by Terraform
      exampleServiceEndpointBitBucket:
        type: azuredevops:ServiceEndpointBitBucket
        name: example
        properties:
          projectId: ${example.id}
          username: username
          password: password
          serviceEndpointName: example-bitbucket
          description: Managed by Terraform
      exampleResourceAuthorization:
        type: azuredevops:ResourceAuthorization
        name: example
        properties:
          projectId: ${example.id}
          resourceId: ${exampleServiceEndpointBitBucket.id}
          authorized: true
    

    Create ResourceAuthorization Resource

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

    Constructor syntax

    new ResourceAuthorization(name: string, args: ResourceAuthorizationArgs, opts?: CustomResourceOptions);
    @overload
    def ResourceAuthorization(resource_name: str,
                              args: ResourceAuthorizationArgs,
                              opts: Optional[ResourceOptions] = None)
    
    @overload
    def ResourceAuthorization(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              authorized: Optional[bool] = None,
                              project_id: Optional[str] = None,
                              resource_id: Optional[str] = None,
                              definition_id: Optional[int] = None,
                              type: Optional[str] = None)
    func NewResourceAuthorization(ctx *Context, name string, args ResourceAuthorizationArgs, opts ...ResourceOption) (*ResourceAuthorization, error)
    public ResourceAuthorization(string name, ResourceAuthorizationArgs args, CustomResourceOptions? opts = null)
    public ResourceAuthorization(String name, ResourceAuthorizationArgs args)
    public ResourceAuthorization(String name, ResourceAuthorizationArgs args, CustomResourceOptions options)
    
    type: azuredevops:ResourceAuthorization
    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 ResourceAuthorizationArgs
    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 ResourceAuthorizationArgs
    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 ResourceAuthorizationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ResourceAuthorizationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ResourceAuthorizationArgs
    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 resourceAuthorizationResource = new AzureDevOps.ResourceAuthorization("resourceAuthorizationResource", new()
    {
        Authorized = false,
        ProjectId = "string",
        ResourceId = "string",
        DefinitionId = 0,
        Type = "string",
    });
    
    example, err := azuredevops.NewResourceAuthorization(ctx, "resourceAuthorizationResource", &azuredevops.ResourceAuthorizationArgs{
    	Authorized:   pulumi.Bool(false),
    	ProjectId:    pulumi.String("string"),
    	ResourceId:   pulumi.String("string"),
    	DefinitionId: pulumi.Int(0),
    	Type:         pulumi.String("string"),
    })
    
    var resourceAuthorizationResource = new ResourceAuthorization("resourceAuthorizationResource", ResourceAuthorizationArgs.builder()
        .authorized(false)
        .projectId("string")
        .resourceId("string")
        .definitionId(0)
        .type("string")
        .build());
    
    resource_authorization_resource = azuredevops.ResourceAuthorization("resourceAuthorizationResource",
        authorized=False,
        project_id="string",
        resource_id="string",
        definition_id=0,
        type="string")
    
    const resourceAuthorizationResource = new azuredevops.ResourceAuthorization("resourceAuthorizationResource", {
        authorized: false,
        projectId: "string",
        resourceId: "string",
        definitionId: 0,
        type: "string",
    });
    
    type: azuredevops:ResourceAuthorization
    properties:
        authorized: false
        definitionId: 0
        projectId: string
        resourceId: string
        type: string
    

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

    Authorized bool
    Set to true to allow public access in the project. Type: boolean.
    ProjectId string
    The project ID or project name. Type: string.
    ResourceId string
    The ID of the resource to authorize. Type: string.
    DefinitionId int
    The ID of the build definition to authorize. Type: string.
    Type string
    The type of the resource to authorize. Type: string. Valid values: endpoint, queue, variablegroup. Default value: endpoint.
    Authorized bool
    Set to true to allow public access in the project. Type: boolean.
    ProjectId string
    The project ID or project name. Type: string.
    ResourceId string
    The ID of the resource to authorize. Type: string.
    DefinitionId int
    The ID of the build definition to authorize. Type: string.
    Type string
    The type of the resource to authorize. Type: string. Valid values: endpoint, queue, variablegroup. Default value: endpoint.
    authorized Boolean
    Set to true to allow public access in the project. Type: boolean.
    projectId String
    The project ID or project name. Type: string.
    resourceId String
    The ID of the resource to authorize. Type: string.
    definitionId Integer
    The ID of the build definition to authorize. Type: string.
    type String
    The type of the resource to authorize. Type: string. Valid values: endpoint, queue, variablegroup. Default value: endpoint.
    authorized boolean
    Set to true to allow public access in the project. Type: boolean.
    projectId string
    The project ID or project name. Type: string.
    resourceId string
    The ID of the resource to authorize. Type: string.
    definitionId number
    The ID of the build definition to authorize. Type: string.
    type string
    The type of the resource to authorize. Type: string. Valid values: endpoint, queue, variablegroup. Default value: endpoint.
    authorized bool
    Set to true to allow public access in the project. Type: boolean.
    project_id str
    The project ID or project name. Type: string.
    resource_id str
    The ID of the resource to authorize. Type: string.
    definition_id int
    The ID of the build definition to authorize. Type: string.
    type str
    The type of the resource to authorize. Type: string. Valid values: endpoint, queue, variablegroup. Default value: endpoint.
    authorized Boolean
    Set to true to allow public access in the project. Type: boolean.
    projectId String
    The project ID or project name. Type: string.
    resourceId String
    The ID of the resource to authorize. Type: string.
    definitionId Number
    The ID of the build definition to authorize. Type: string.
    type String
    The type of the resource to authorize. Type: string. Valid values: endpoint, queue, variablegroup. Default value: endpoint.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing ResourceAuthorization Resource

    Get an existing ResourceAuthorization 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?: ResourceAuthorizationState, opts?: CustomResourceOptions): ResourceAuthorization
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            authorized: Optional[bool] = None,
            definition_id: Optional[int] = None,
            project_id: Optional[str] = None,
            resource_id: Optional[str] = None,
            type: Optional[str] = None) -> ResourceAuthorization
    func GetResourceAuthorization(ctx *Context, name string, id IDInput, state *ResourceAuthorizationState, opts ...ResourceOption) (*ResourceAuthorization, error)
    public static ResourceAuthorization Get(string name, Input<string> id, ResourceAuthorizationState? state, CustomResourceOptions? opts = null)
    public static ResourceAuthorization get(String name, Output<String> id, ResourceAuthorizationState 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.
    The following state arguments are supported:
    Authorized bool
    Set to true to allow public access in the project. Type: boolean.
    DefinitionId int
    The ID of the build definition to authorize. Type: string.
    ProjectId string
    The project ID or project name. Type: string.
    ResourceId string
    The ID of the resource to authorize. Type: string.
    Type string
    The type of the resource to authorize. Type: string. Valid values: endpoint, queue, variablegroup. Default value: endpoint.
    Authorized bool
    Set to true to allow public access in the project. Type: boolean.
    DefinitionId int
    The ID of the build definition to authorize. Type: string.
    ProjectId string
    The project ID or project name. Type: string.
    ResourceId string
    The ID of the resource to authorize. Type: string.
    Type string
    The type of the resource to authorize. Type: string. Valid values: endpoint, queue, variablegroup. Default value: endpoint.
    authorized Boolean
    Set to true to allow public access in the project. Type: boolean.
    definitionId Integer
    The ID of the build definition to authorize. Type: string.
    projectId String
    The project ID or project name. Type: string.
    resourceId String
    The ID of the resource to authorize. Type: string.
    type String
    The type of the resource to authorize. Type: string. Valid values: endpoint, queue, variablegroup. Default value: endpoint.
    authorized boolean
    Set to true to allow public access in the project. Type: boolean.
    definitionId number
    The ID of the build definition to authorize. Type: string.
    projectId string
    The project ID or project name. Type: string.
    resourceId string
    The ID of the resource to authorize. Type: string.
    type string
    The type of the resource to authorize. Type: string. Valid values: endpoint, queue, variablegroup. Default value: endpoint.
    authorized bool
    Set to true to allow public access in the project. Type: boolean.
    definition_id int
    The ID of the build definition to authorize. Type: string.
    project_id str
    The project ID or project name. Type: string.
    resource_id str
    The ID of the resource to authorize. Type: string.
    type str
    The type of the resource to authorize. Type: string. Valid values: endpoint, queue, variablegroup. Default value: endpoint.
    authorized Boolean
    Set to true to allow public access in the project. Type: boolean.
    definitionId Number
    The ID of the build definition to authorize. Type: string.
    projectId String
    The project ID or project name. Type: string.
    resourceId String
    The ID of the resource to authorize. Type: string.
    type String
    The type of the resource to authorize. Type: string. Valid values: endpoint, queue, variablegroup. Default value: endpoint.

    Package Details

    Repository
    Azure DevOps pulumi/pulumi-azuredevops
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the azuredevops Terraform Provider.
    azuredevops logo
    Azure DevOps v3.4.0 published on Wednesday, Oct 30, 2024 by Pulumi