Harness v0.4.4 published on Tuesday, Nov 12, 2024 by Pulumi
harness.platform.getPolicySet
Explore with Pulumi AI
Data source for retrieving a Harness policyset.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as harness from "@pulumi/harness";
const test = harness.platform.getPolicySet({
identifier: "harness_platform_policyset.test.identifier",
name: "harness_platform_policyset.test.name",
action: "onrun",
type: "pipeline",
enabled: true,
policies: [{
identifier: "always_run",
severity: "warning",
}],
});
import pulumi
import pulumi_harness as harness
test = harness.platform.get_policy_set(identifier="harness_platform_policyset.test.identifier",
name="harness_platform_policyset.test.name",
action="onrun",
type="pipeline",
enabled=True,
policies=[{
"identifier": "always_run",
"severity": "warning",
}])
package main
import (
"github.com/pulumi/pulumi-harness/sdk/go/harness/platform"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := platform.LookupPolicySet(ctx, &platform.LookupPolicySetArgs{
Identifier: "harness_platform_policyset.test.identifier",
Name: pulumi.StringRef("harness_platform_policyset.test.name"),
Action: "onrun",
Type: "pipeline",
Enabled: pulumi.BoolRef(true),
Policies: []platform.GetPolicySetPolicy{
{
Identifier: "always_run",
Severity: "warning",
},
},
}, nil)
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.Platform.GetPolicySet.Invoke(new()
{
Identifier = "harness_platform_policyset.test.identifier",
Name = "harness_platform_policyset.test.name",
Action = "onrun",
Type = "pipeline",
Enabled = true,
Policies = new[]
{
new Harness.Platform.Inputs.GetPolicySetPolicyInputArgs
{
Identifier = "always_run",
Severity = "warning",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.harness.platform.PlatformFunctions;
import com.pulumi.harness.platform.inputs.GetPolicySetArgs;
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 = PlatformFunctions.getPolicySet(GetPolicySetArgs.builder()
.identifier("harness_platform_policyset.test.identifier")
.name("harness_platform_policyset.test.name")
.action("onrun")
.type("pipeline")
.enabled(true)
.policies(GetPolicySetPolicyArgs.builder()
.identifier("always_run")
.severity("warning")
.build())
.build());
}
}
variables:
test:
fn::invoke:
Function: harness:platform:getPolicySet
Arguments:
identifier: harness_platform_policyset.test.identifier
name: harness_platform_policyset.test.name
action: onrun
type: pipeline
enabled: true
policies:
- identifier: always_run
severity: warning
Using getPolicySet
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getPolicySet(args: GetPolicySetArgs, opts?: InvokeOptions): Promise<GetPolicySetResult>
function getPolicySetOutput(args: GetPolicySetOutputArgs, opts?: InvokeOptions): Output<GetPolicySetResult>
def get_policy_set(action: Optional[str] = None,
enabled: Optional[bool] = None,
identifier: Optional[str] = None,
name: Optional[str] = None,
org_id: Optional[str] = None,
policies: Optional[Sequence[GetPolicySetPolicy]] = None,
project_id: Optional[str] = None,
type: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetPolicySetResult
def get_policy_set_output(action: Optional[pulumi.Input[str]] = None,
enabled: Optional[pulumi.Input[bool]] = None,
identifier: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
org_id: Optional[pulumi.Input[str]] = None,
policies: Optional[pulumi.Input[Sequence[pulumi.Input[GetPolicySetPolicyArgs]]]] = None,
project_id: Optional[pulumi.Input[str]] = None,
type: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetPolicySetResult]
func LookupPolicySet(ctx *Context, args *LookupPolicySetArgs, opts ...InvokeOption) (*LookupPolicySetResult, error)
func LookupPolicySetOutput(ctx *Context, args *LookupPolicySetOutputArgs, opts ...InvokeOption) LookupPolicySetResultOutput
> Note: This function is named LookupPolicySet
in the Go SDK.
public static class GetPolicySet
{
public static Task<GetPolicySetResult> InvokeAsync(GetPolicySetArgs args, InvokeOptions? opts = null)
public static Output<GetPolicySetResult> Invoke(GetPolicySetInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetPolicySetResult> getPolicySet(GetPolicySetArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: harness:platform/getPolicySet:getPolicySet
arguments:
# arguments dictionary
The following arguments are supported:
- Action string
- Action code for the policyset.
- Identifier string
- Unique identifier of the resource.
- Type string
- Type of the policyset.
- Enabled bool
- Enabled for the policyset.
- Name string
- Name of the resource.
- Org
Id string - Unique identifier of the organization.
- Policies
List<Get
Policy Set Policy> - List of policy identifiers / severity for the policyset.
- Project
Id string - Unique identifier of the project.
- Action string
- Action code for the policyset.
- Identifier string
- Unique identifier of the resource.
- Type string
- Type of the policyset.
- Enabled bool
- Enabled for the policyset.
- Name string
- Name of the resource.
- Org
Id string - Unique identifier of the organization.
- Policies
[]Get
Policy Set Policy - List of policy identifiers / severity for the policyset.
- Project
Id string - Unique identifier of the project.
- action String
- Action code for the policyset.
- identifier String
- Unique identifier of the resource.
- type String
- Type of the policyset.
- enabled Boolean
- Enabled for the policyset.
- name String
- Name of the resource.
- org
Id String - Unique identifier of the organization.
- policies
List<Get
Policy Set Policy> - List of policy identifiers / severity for the policyset.
- project
Id String - Unique identifier of the project.
- action string
- Action code for the policyset.
- identifier string
- Unique identifier of the resource.
- type string
- Type of the policyset.
- enabled boolean
- Enabled for the policyset.
- name string
- Name of the resource.
- org
Id string - Unique identifier of the organization.
- policies
Get
Policy Set Policy[] - List of policy identifiers / severity for the policyset.
- project
Id string - Unique identifier of the project.
- action str
- Action code for the policyset.
- identifier str
- Unique identifier of the resource.
- type str
- Type of the policyset.
- enabled bool
- Enabled for the policyset.
- name str
- Name of the resource.
- org_
id str - Unique identifier of the organization.
- policies
Sequence[Get
Policy Set Policy] - List of policy identifiers / severity for the policyset.
- project_
id str - Unique identifier of the project.
- action String
- Action code for the policyset.
- identifier String
- Unique identifier of the resource.
- type String
- Type of the policyset.
- enabled Boolean
- Enabled for the policyset.
- name String
- Name of the resource.
- org
Id String - Unique identifier of the organization.
- policies List<Property Map>
- List of policy identifiers / severity for the policyset.
- project
Id String - Unique identifier of the project.
getPolicySet Result
The following output properties are available:
- Action string
- Action code for the policyset.
- Description string
- Description of the resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- Identifier string
- Unique identifier of the resource.
- List<string>
- Tags to associate with the resource.
- Type string
- Type of the policyset.
- Enabled bool
- Enabled for the policyset.
- Name string
- Name of the resource.
- Org
Id string - Unique identifier of the organization.
- Policies
List<Get
Policy Set Policy> - List of policy identifiers / severity for the policyset.
- Project
Id string - Unique identifier of the project.
- Action string
- Action code for the policyset.
- Description string
- Description of the resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- Identifier string
- Unique identifier of the resource.
- []string
- Tags to associate with the resource.
- Type string
- Type of the policyset.
- Enabled bool
- Enabled for the policyset.
- Name string
- Name of the resource.
- Org
Id string - Unique identifier of the organization.
- Policies
[]Get
Policy Set Policy - List of policy identifiers / severity for the policyset.
- Project
Id string - Unique identifier of the project.
- action String
- Action code for the policyset.
- description String
- Description of the resource.
- id String
- The provider-assigned unique ID for this managed resource.
- identifier String
- Unique identifier of the resource.
- List<String>
- Tags to associate with the resource.
- type String
- Type of the policyset.
- enabled Boolean
- Enabled for the policyset.
- name String
- Name of the resource.
- org
Id String - Unique identifier of the organization.
- policies
List<Get
Policy Set Policy> - List of policy identifiers / severity for the policyset.
- project
Id String - Unique identifier of the project.
- action string
- Action code for the policyset.
- description string
- Description of the resource.
- id string
- The provider-assigned unique ID for this managed resource.
- identifier string
- Unique identifier of the resource.
- string[]
- Tags to associate with the resource.
- type string
- Type of the policyset.
- enabled boolean
- Enabled for the policyset.
- name string
- Name of the resource.
- org
Id string - Unique identifier of the organization.
- policies
Get
Policy Set Policy[] - List of policy identifiers / severity for the policyset.
- project
Id string - Unique identifier of the project.
- action str
- Action code for the policyset.
- description str
- Description of the resource.
- id str
- The provider-assigned unique ID for this managed resource.
- identifier str
- Unique identifier of the resource.
- Sequence[str]
- Tags to associate with the resource.
- type str
- Type of the policyset.
- enabled bool
- Enabled for the policyset.
- name str
- Name of the resource.
- org_
id str - Unique identifier of the organization.
- policies
Sequence[Get
Policy Set Policy] - List of policy identifiers / severity for the policyset.
- project_
id str - Unique identifier of the project.
- action String
- Action code for the policyset.
- description String
- Description of the resource.
- id String
- The provider-assigned unique ID for this managed resource.
- identifier String
- Unique identifier of the resource.
- List<String>
- Tags to associate with the resource.
- type String
- Type of the policyset.
- enabled Boolean
- Enabled for the policyset.
- name String
- Name of the resource.
- org
Id String - Unique identifier of the organization.
- policies List<Property Map>
- List of policy identifiers / severity for the policyset.
- project
Id String - Unique identifier of the project.
Supporting Types
GetPolicySetPolicy
- Identifier string
- Account Identifier of the account
- Severity string
- Policy failure response - 'warning' for continuation, 'error' for exit
- Identifier string
- Account Identifier of the account
- Severity string
- Policy failure response - 'warning' for continuation, 'error' for exit
- identifier String
- Account Identifier of the account
- severity String
- Policy failure response - 'warning' for continuation, 'error' for exit
- identifier string
- Account Identifier of the account
- severity string
- Policy failure response - 'warning' for continuation, 'error' for exit
- identifier str
- Account Identifier of the account
- severity str
- Policy failure response - 'warning' for continuation, 'error' for exit
- identifier String
- Account Identifier of the account
- severity String
- Policy failure response - 'warning' for continuation, 'error' for exit
Package Details
- Repository
- harness pulumi/pulumi-harness
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
harness
Terraform Provider.