1. Packages
  2. Harness Provider
  3. API Docs
  4. DelegateApproval
Harness v0.7.2 published on Tuesday, Apr 15, 2025 by Pulumi

harness.DelegateApproval

Explore with Pulumi AI

Resource for approving or rejecting delegates.

Example Usage

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

const test = harness.getDelegate({
    name: "my-delegate",
});
const testDelegateApproval = new harness.DelegateApproval("test", {
    delegateId: test.then(test => test.id),
    approve: true,
});
Copy
import pulumi
import pulumi_harness as harness

test = harness.get_delegate(name="my-delegate")
test_delegate_approval = harness.DelegateApproval("test",
    delegate_id=test.id,
    approve=True)
Copy
package main

import (
	"github.com/pulumi/pulumi-harness/sdk/go/harness"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		test, err := harness.GetDelegate(ctx, &harness.GetDelegateArgs{
			Name: pulumi.StringRef("my-delegate"),
		}, nil)
		if err != nil {
			return err
		}
		_, err = harness.NewDelegateApproval(ctx, "test", &harness.DelegateApprovalArgs{
			DelegateId: pulumi.String(test.Id),
			Approve:    pulumi.Bool(true),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Harness = Pulumi.Harness;

return await Deployment.RunAsync(() => 
{
    var test = Harness.GetDelegate.Invoke(new()
    {
        Name = "my-delegate",
    });

    var testDelegateApproval = new Harness.DelegateApproval("test", new()
    {
        DelegateId = test.Apply(getDelegateResult => getDelegateResult.Id),
        Approve = true,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.harness.HarnessFunctions;
import com.pulumi.harness.inputs.GetDelegateArgs;
import com.pulumi.harness.DelegateApproval;
import com.pulumi.harness.DelegateApprovalArgs;
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) {
        final var test = HarnessFunctions.getDelegate(GetDelegateArgs.builder()
            .name("my-delegate")
            .build());

        var testDelegateApproval = new DelegateApproval("testDelegateApproval", DelegateApprovalArgs.builder()
            .delegateId(test.id())
            .approve(true)
            .build());

    }
}
Copy
resources:
  testDelegateApproval:
    type: harness:DelegateApproval
    name: test
    properties:
      delegateId: ${test.id}
      approve: true
variables:
  test:
    fn::invoke:
      function: harness:getDelegate
      arguments:
        name: my-delegate
Copy

Create DelegateApproval Resource

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

Constructor syntax

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

@overload
def DelegateApproval(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     approve: Optional[bool] = None,
                     delegate_id: Optional[str] = None)
func NewDelegateApproval(ctx *Context, name string, args DelegateApprovalArgs, opts ...ResourceOption) (*DelegateApproval, error)
public DelegateApproval(string name, DelegateApprovalArgs args, CustomResourceOptions? opts = null)
public DelegateApproval(String name, DelegateApprovalArgs args)
public DelegateApproval(String name, DelegateApprovalArgs args, CustomResourceOptions options)
type: harness:DelegateApproval
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. DelegateApprovalArgs
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. DelegateApprovalArgs
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. DelegateApprovalArgs
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. DelegateApprovalArgs
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. DelegateApprovalArgs
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 delegateApprovalResource = new Harness.DelegateApproval("delegateApprovalResource", new()
{
    Approve = false,
    DelegateId = "string",
});
Copy
example, err := harness.NewDelegateApproval(ctx, "delegateApprovalResource", &harness.DelegateApprovalArgs{
	Approve:    pulumi.Bool(false),
	DelegateId: pulumi.String("string"),
})
Copy
var delegateApprovalResource = new DelegateApproval("delegateApprovalResource", DelegateApprovalArgs.builder()
    .approve(false)
    .delegateId("string")
    .build());
Copy
delegate_approval_resource = harness.DelegateApproval("delegateApprovalResource",
    approve=False,
    delegate_id="string")
Copy
const delegateApprovalResource = new harness.DelegateApproval("delegateApprovalResource", {
    approve: false,
    delegateId: "string",
});
Copy
type: harness:DelegateApproval
properties:
    approve: false
    delegateId: string
Copy

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

Approve
This property is required.
Changes to this property will trigger replacement.
bool
Whether or not to approve the delegate.
DelegateId
This property is required.
Changes to this property will trigger replacement.
string
The id of the delegate.
Approve
This property is required.
Changes to this property will trigger replacement.
bool
Whether or not to approve the delegate.
DelegateId
This property is required.
Changes to this property will trigger replacement.
string
The id of the delegate.
approve
This property is required.
Changes to this property will trigger replacement.
Boolean
Whether or not to approve the delegate.
delegateId
This property is required.
Changes to this property will trigger replacement.
String
The id of the delegate.
approve
This property is required.
Changes to this property will trigger replacement.
boolean
Whether or not to approve the delegate.
delegateId
This property is required.
Changes to this property will trigger replacement.
string
The id of the delegate.
approve
This property is required.
Changes to this property will trigger replacement.
bool
Whether or not to approve the delegate.
delegate_id
This property is required.
Changes to this property will trigger replacement.
str
The id of the delegate.
approve
This property is required.
Changes to this property will trigger replacement.
Boolean
Whether or not to approve the delegate.
delegateId
This property is required.
Changes to this property will trigger replacement.
String
The id of the delegate.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
Status string
The status of the delegate.
Id string
The provider-assigned unique ID for this managed resource.
Status string
The status of the delegate.
id String
The provider-assigned unique ID for this managed resource.
status String
The status of the delegate.
id string
The provider-assigned unique ID for this managed resource.
status string
The status of the delegate.
id str
The provider-assigned unique ID for this managed resource.
status str
The status of the delegate.
id String
The provider-assigned unique ID for this managed resource.
status String
The status of the delegate.

Look up Existing DelegateApproval Resource

Get an existing DelegateApproval 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?: DelegateApprovalState, opts?: CustomResourceOptions): DelegateApproval
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        approve: Optional[bool] = None,
        delegate_id: Optional[str] = None,
        status: Optional[str] = None) -> DelegateApproval
func GetDelegateApproval(ctx *Context, name string, id IDInput, state *DelegateApprovalState, opts ...ResourceOption) (*DelegateApproval, error)
public static DelegateApproval Get(string name, Input<string> id, DelegateApprovalState? state, CustomResourceOptions? opts = null)
public static DelegateApproval get(String name, Output<String> id, DelegateApprovalState state, CustomResourceOptions options)
resources:  _:    type: harness:DelegateApproval    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:
Approve Changes to this property will trigger replacement. bool
Whether or not to approve the delegate.
DelegateId Changes to this property will trigger replacement. string
The id of the delegate.
Status string
The status of the delegate.
Approve Changes to this property will trigger replacement. bool
Whether or not to approve the delegate.
DelegateId Changes to this property will trigger replacement. string
The id of the delegate.
Status string
The status of the delegate.
approve Changes to this property will trigger replacement. Boolean
Whether or not to approve the delegate.
delegateId Changes to this property will trigger replacement. String
The id of the delegate.
status String
The status of the delegate.
approve Changes to this property will trigger replacement. boolean
Whether or not to approve the delegate.
delegateId Changes to this property will trigger replacement. string
The id of the delegate.
status string
The status of the delegate.
approve Changes to this property will trigger replacement. bool
Whether or not to approve the delegate.
delegate_id Changes to this property will trigger replacement. str
The id of the delegate.
status str
The status of the delegate.
approve Changes to this property will trigger replacement. Boolean
Whether or not to approve the delegate.
delegateId Changes to this property will trigger replacement. String
The id of the delegate.
status String
The status of the delegate.

Import

Import the status of the delegate approval.

$ pulumi import harness:index/delegateApproval:DelegateApproval example <delegate_id>
Copy

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

Package Details

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