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)
type: harness:governance:Rule
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 RuleArgs
- 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 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 string
- The unique name of the resource.
- args RuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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",
});
example, err := governance.NewRule(ctx, "ruleResource", &governance.RuleArgs{
CloudProvider: pulumi.String("string"),
RulesYaml: pulumi.String("string"),
Description: pulumi.String("string"),
Name: pulumi.String("string"),
})
var ruleResource = new Rule("ruleResource", RuleArgs.builder()
.cloudProvider("string")
.rulesYaml("string")
.description("string")
.name("string")
.build());
rule_resource = harness.governance.Rule("ruleResource",
cloud_provider="string",
rules_yaml="string",
description="string",
name="string")
const ruleResource = new harness.governance.Rule("ruleResource", {
cloudProvider: "string",
rulesYaml: "string",
description: "string",
name: "string",
});
type: harness:governance:Rule
properties:
cloudProvider: string
description: string
name: string
rulesYaml: string
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:
- Cloud
Provider string - The cloud provider for the rule. It should be either AWS, AZURE or GCP.
- Rules
Yaml string - The policy YAML of the rule
- Description string
- Description for rule.
- Name string
- Name of the rule.
- Cloud
Provider string - The cloud provider for the rule. It should be either AWS, AZURE or GCP.
- Rules
Yaml string - The policy YAML of the rule
- Description string
- Description for rule.
- Name string
- Name of the rule.
- cloud
Provider String - The cloud provider for the rule. It should be either AWS, AZURE or GCP.
- rules
Yaml String - The policy YAML of the rule
- description String
- Description for rule.
- name String
- Name of the rule.
- cloud
Provider string - The cloud provider for the rule. It should be either AWS, AZURE or GCP.
- rules
Yaml string - The policy YAML of the rule
- description string
- Description for rule.
- name string
- Name of the rule.
- cloud_
provider str - The cloud provider for the rule. It should be either AWS, AZURE or GCP.
- rules_
yaml str - The policy YAML of the rule
- description str
- Description for rule.
- name str
- Name of the rule.
- cloud
Provider String - The cloud provider for the rule. It should be either AWS, AZURE or GCP.
- rules
Yaml 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:
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)
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.
- Cloud
Provider 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.
- Rule
Id string - Id of the rule.
- Rules
Yaml string - The policy YAML of the rule
- Cloud
Provider 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.
- Rule
Id string - Id of the rule.
- Rules
Yaml string - The policy YAML of the rule
- cloud
Provider 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.
- rule
Id String - Id of the rule.
- rules
Yaml String - The policy YAML of the rule
- cloud
Provider 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.
- rule
Id string - Id of the rule.
- rules
Yaml 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
- cloud
Provider 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.
- rule
Id String - Id of the rule.
- rules
Yaml String - The policy YAML of the rule
Import
Import governance enforcement
$ pulumi import harness:governance/rule:Rule example <rule_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.