ResourceAuthorization

# azuredevops.Security.ResourceAuthorization

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

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

Example Usage

using Pulumi;
using AzureDevOps = Pulumi.AzureDevOps;

class MyStack : Stack
{
    public MyStack()
    {
        var project = new AzureDevOps.Core.Project("project", new AzureDevOps.Core.ProjectArgs
        {
            ProjectName = "Test Project",
        });
        var bitbucketAccount = new AzureDevOps.ServiceEndpoint.BitBucket("bitbucketAccount", new AzureDevOps.ServiceEndpoint.BitBucketArgs
        {
            ProjectId = project.Id,
            Username = "xxxx",
            Password = "xxxx",
            ServiceEndpointName = "test-bitbucket",
            Description = "test",
        });
        var auth = new AzureDevOps.Security.ResourceAuthorization("auth", new AzureDevOps.Security.ResourceAuthorizationArgs
        {
            ProjectId = project.Id,
            ResourceId = bitbucketAccount.Id,
            Authorized = true,
        });
    }

}
package main

import (
    "github.com/pulumi/pulumi-azuredevops/sdk/go/azuredevops/Core"
    "github.com/pulumi/pulumi-azuredevops/sdk/go/azuredevops/Security"
    "github.com/pulumi/pulumi-azuredevops/sdk/go/azuredevops/ServiceEndpoint"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        project, err := Core.NewProject(ctx, "project", &Core.ProjectArgs{
            ProjectName: pulumi.String("Test Project"),
        })
        if err != nil {
            return err
        }
        bitbucketAccount, err := ServiceEndpoint.NewBitBucket(ctx, "bitbucketAccount", &ServiceEndpoint.BitBucketArgs{
            ProjectId:           project.ID(),
            Username:            pulumi.String("xxxx"),
            Password:            pulumi.String("xxxx"),
            ServiceEndpointName: pulumi.String("test-bitbucket"),
            Description:         pulumi.String("test"),
        })
        if err != nil {
            return err
        }
        auth, err := Security.NewResourceAuthorization(ctx, "auth", &Security.ResourceAuthorizationArgs{
            ProjectId:  project.ID(),
            ResourceId: bitbucketAccount.ID(),
            Authorized: pulumi.Bool(true),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
import pulumi
import pulumi_azuredevops as azuredevops

project = azuredevops.core.Project("project", project_name="Test Project")
bitbucket_account = azuredevops.service_endpoint.BitBucket("bitbucketAccount",
    project_id=project.id,
    username="xxxx",
    password="xxxx",
    service_endpoint_name="test-bitbucket",
    description="test")
auth = azuredevops.security.ResourceAuthorization("auth",
    project_id=project.id,
    resource_id=bitbucket_account.id,
    authorized=True)
import * as pulumi from "@pulumi/pulumi";
import * as azuredevops from "@pulumi/azuredevops";

const project = new azuredevops.Core.Project("project", {projectName: "Test Project"});
const bitbucketAccount = new azuredevops.ServiceEndpoint.BitBucket("bitbucketAccount", {
    projectId: project.id,
    username: "xxxx",
    password: "xxxx",
    serviceEndpointName: "test-bitbucket",
    description: "test",
});
const auth = new azuredevops.Security.ResourceAuthorization("auth", {
    projectId: project.id,
    resourceId: bitbucketAccount.id,
    authorized: true,
});

Create a ResourceAuthorization Resource

def ResourceAuthorization(resource_name, opts=None, authorized=None, project_id=None, resource_id=None, type=None, __props__=None);
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.
opts ResourceOptions
A bag of options that control this 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.

ResourceAuthorization Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model docs.

Inputs

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.

Type string

The type of the resource to authorize. Type: string. Valid values: endpoint, queue. 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.

Type string

The type of the resource to authorize. Type: string. Valid values: endpoint, queue. 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.

type string

The type of the resource to authorize. Type: string. Valid values: endpoint, queue. 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.

type str

The type of the resource to authorize. Type: string. Valid values: endpoint, queue. 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 str
The provider-assigned unique ID for this managed resource.

Look up an Existing ResourceAuthorization Resource

Get an existing ResourceAuthorization resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

static get(resource_name, id, opts=None, authorized=None, project_id=None, resource_id=None, type=None, __props__=None);
func GetResourceAuthorization(ctx *Context, name string, id IDInput, state *ResourceAuthorizationState, opts ...ResourceOption) (*ResourceAuthorization, error)
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.

The following state arguments are supported:

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.

Type string

The type of the resource to authorize. Type: string. Valid values: endpoint, queue. 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.

Type string

The type of the resource to authorize. Type: string. Valid values: endpoint, queue. 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.

type string

The type of the resource to authorize. Type: string. Valid values: endpoint, queue. 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.

type str

The type of the resource to authorize. Type: string. Valid values: endpoint, queue. Default value: endpoint.

Package Details

Repository
https://github.com/pulumi/pulumi-azuredevops
License
Apache-2.0
Notes
This Pulumi package is based on the azuredevops Terraform Provider.