1. Packages
  2. Harness Provider
  3. API Docs
  4. governance
  5. Rule
Harness v0.7.1 published on Saturday, Mar 29, 2025 by Pulumi

harness.governance.Rule

Explore with Pulumi AI

Resource for creating, updating, and managing rule.

Create Rule Resource

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

Constructor syntax

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

@overload
def Rule(resource_name: str,
         opts: Optional[ResourceOptions] = None,
         cloud_provider: Optional[str] = None,
         rules_yaml: Optional[str] = None,
         description: Optional[str] = None,
         name: Optional[str] = None)
func NewRule(ctx *Context, name string, args RuleArgs, opts ...ResourceOption) (*Rule, error)
public Rule(string name, RuleArgs args, CustomResourceOptions? opts = null)
public Rule(String name, RuleArgs args)
public Rule(String name, RuleArgs args, CustomResourceOptions options)
type: harness:governance:Rule
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. RuleArgs
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. RuleArgs
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. RuleArgs
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. RuleArgs
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. RuleArgs
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 ruleResource = new Harness.Governance.Rule("ruleResource", new()
{
    CloudProvider = "string",
    RulesYaml = "string",
    Description = "string",
    Name = "string",
});
Copy
example, err := governance.NewRule(ctx, "ruleResource", &governance.RuleArgs{
	CloudProvider: pulumi.String("string"),
	RulesYaml:     pulumi.String("string"),
	Description:   pulumi.String("string"),
	Name:          pulumi.String("string"),
})
Copy
var ruleResource = new Rule("ruleResource", RuleArgs.builder()
    .cloudProvider("string")
    .rulesYaml("string")
    .description("string")
    .name("string")
    .build());
Copy
rule_resource = harness.governance.Rule("ruleResource",
    cloud_provider="string",
    rules_yaml="string",
    description="string",
    name="string")
Copy
const ruleResource = new harness.governance.Rule("ruleResource", {
    cloudProvider: "string",
    rulesYaml: "string",
    description: "string",
    name: "string",
});
Copy
type: harness:governance:Rule
properties:
    cloudProvider: string
    description: string
    name: string
    rulesYaml: string
Copy

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

CloudProvider This property is required. string
The cloud provider for the rule. It should be either AWS, AZURE or GCP.
RulesYaml This property is required. string
The policy YAML of the rule
Description string
Description for rule.
Name string
Name of the rule.
CloudProvider This property is required. string
The cloud provider for the rule. It should be either AWS, AZURE or GCP.
RulesYaml This property is required. string
The policy YAML of the rule
Description string
Description for rule.
Name string
Name of the rule.
cloudProvider This property is required. String
The cloud provider for the rule. It should be either AWS, AZURE or GCP.
rulesYaml This property is required. String
The policy YAML of the rule
description String
Description for rule.
name String
Name of the rule.
cloudProvider This property is required. string
The cloud provider for the rule. It should be either AWS, AZURE or GCP.
rulesYaml This property is required. string
The policy YAML of the rule
description string
Description for rule.
name string
Name of the rule.
cloud_provider This property is required. str
The cloud provider for the rule. It should be either AWS, AZURE or GCP.
rules_yaml This property is required. str
The policy YAML of the rule
description str
Description for rule.
name str
Name of the rule.
cloudProvider This property is required. String
The cloud provider for the rule. It should be either AWS, AZURE or GCP.
rulesYaml This property is required. String
The policy YAML of the rule
description String
Description for rule.
name String
Name of the rule.

Outputs

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

Id string
The provider-assigned unique ID for this managed resource.
RuleId string
Id of the rule.
Id string
The provider-assigned unique ID for this managed resource.
RuleId string
Id of the rule.
id String
The provider-assigned unique ID for this managed resource.
ruleId String
Id of the rule.
id string
The provider-assigned unique ID for this managed resource.
ruleId string
Id of the rule.
id str
The provider-assigned unique ID for this managed resource.
rule_id str
Id of the rule.
id String
The provider-assigned unique ID for this managed resource.
ruleId String
Id of the rule.

Look up Existing Rule Resource

Get an existing Rule 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?: RuleState, opts?: CustomResourceOptions): Rule
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        cloud_provider: Optional[str] = None,
        description: Optional[str] = None,
        name: Optional[str] = None,
        rule_id: Optional[str] = None,
        rules_yaml: Optional[str] = None) -> Rule
func GetRule(ctx *Context, name string, id IDInput, state *RuleState, opts ...ResourceOption) (*Rule, error)
public static Rule Get(string name, Input<string> id, RuleState? state, CustomResourceOptions? opts = null)
public static Rule get(String name, Output<String> id, RuleState state, CustomResourceOptions options)
resources:  _:    type: harness:governance:Rule    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:
CloudProvider string
The cloud provider for the rule. It should be either AWS, AZURE or GCP.
Description string
Description for rule.
Name string
Name of the rule.
RuleId string
Id of the rule.
RulesYaml string
The policy YAML of the rule
CloudProvider string
The cloud provider for the rule. It should be either AWS, AZURE or GCP.
Description string
Description for rule.
Name string
Name of the rule.
RuleId string
Id of the rule.
RulesYaml string
The policy YAML of the rule
cloudProvider String
The cloud provider for the rule. It should be either AWS, AZURE or GCP.
description String
Description for rule.
name String
Name of the rule.
ruleId String
Id of the rule.
rulesYaml String
The policy YAML of the rule
cloudProvider string
The cloud provider for the rule. It should be either AWS, AZURE or GCP.
description string
Description for rule.
name string
Name of the rule.
ruleId string
Id of the rule.
rulesYaml string
The policy YAML of the rule
cloud_provider str
The cloud provider for the rule. It should be either AWS, AZURE or GCP.
description str
Description for rule.
name str
Name of the rule.
rule_id str
Id of the rule.
rules_yaml str
The policy YAML of the rule
cloudProvider String
The cloud provider for the rule. It should be either AWS, AZURE or GCP.
description String
Description for rule.
name String
Name of the rule.
ruleId String
Id of the rule.
rulesYaml String
The policy YAML of the rule

Import

Import governance enforcement

$ pulumi import harness:governance/rule:Rule example <rule_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.