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,
});
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)
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
})
}
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,
});
});
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.applyValue(getDelegateResult -> getDelegateResult.id()))
.approve(true)
.build());
}
}
resources:
testDelegateApproval:
type: harness:DelegateApproval
name: test
properties:
delegateId: ${test.id}
approve: true
variables:
test:
fn::invoke:
Function: harness:getDelegate
Arguments:
name: my-delegate
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 string
- The unique name of the resource.
- args DelegateApprovalArgs
- 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 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 string
- The unique name of the resource.
- args DelegateApprovalArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args DelegateApprovalArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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",
});
example, err := harness.NewDelegateApproval(ctx, "delegateApprovalResource", &harness.DelegateApprovalArgs{
Approve: pulumi.Bool(false),
DelegateId: pulumi.String("string"),
})
var delegateApprovalResource = new DelegateApproval("delegateApprovalResource", DelegateApprovalArgs.builder()
.approve(false)
.delegateId("string")
.build());
delegate_approval_resource = harness.DelegateApproval("delegateApprovalResource",
approve=False,
delegate_id="string")
const delegateApprovalResource = new harness.DelegateApproval("delegateApprovalResource", {
approve: false,
delegateId: "string",
});
type: harness:DelegateApproval
properties:
approve: false
delegateId: string
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
The DelegateApproval resource accepts the following input properties:
- Approve bool
- Whether or not to approve the delegate.
- Delegate
Id string - The id of the delegate.
- Approve bool
- Whether or not to approve the delegate.
- Delegate
Id string - The id of the delegate.
- approve Boolean
- Whether or not to approve the delegate.
- delegate
Id String - The id of the delegate.
- approve boolean
- Whether or not to approve the delegate.
- delegate
Id string - The id of the delegate.
- approve bool
- Whether or not to approve the delegate.
- delegate_
id str - The id of the delegate.
- approve Boolean
- Whether or not to approve the delegate.
- delegate
Id 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:
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)
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.
- Approve bool
- Whether or not to approve the delegate.
- Delegate
Id string - The id of the delegate.
- Status string
- The status of the delegate.
- Approve bool
- Whether or not to approve the delegate.
- Delegate
Id string - The id of the delegate.
- Status string
- The status of the delegate.
- approve Boolean
- Whether or not to approve the delegate.
- delegate
Id String - The id of the delegate.
- status String
- The status of the delegate.
- approve boolean
- Whether or not to approve the delegate.
- delegate
Id string - The id of the delegate.
- status string
- The status of the delegate.
- approve bool
- Whether or not to approve the delegate.
- delegate_
id str - The id of the delegate.
- status str
- The status of the delegate.
- approve Boolean
- Whether or not to approve the delegate.
- delegate
Id 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>
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.