harness.governance.RuleEnforcement
Explore with Pulumi AI
Resource for creating, updating, and managing rule enforcement.
Create RuleEnforcement Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new RuleEnforcement(name: string, args: RuleEnforcementArgs, opts?: CustomResourceOptions);
@overload
def RuleEnforcement(resource_name: str,
args: RuleEnforcementArgs,
opts: Optional[ResourceOptions] = None)
@overload
def RuleEnforcement(resource_name: str,
opts: Optional[ResourceOptions] = None,
cloud_provider: Optional[str] = None,
execution_schedule: Optional[str] = None,
execution_timezone: Optional[str] = None,
target_accounts: Optional[Sequence[str]] = None,
description: Optional[str] = None,
is_dry_run: Optional[bool] = None,
is_enabled: Optional[bool] = None,
name: Optional[str] = None,
rule_ids: Optional[Sequence[str]] = None,
rule_set_ids: Optional[Sequence[str]] = None,
target_regions: Optional[Sequence[str]] = None)
func NewRuleEnforcement(ctx *Context, name string, args RuleEnforcementArgs, opts ...ResourceOption) (*RuleEnforcement, error)
public RuleEnforcement(string name, RuleEnforcementArgs args, CustomResourceOptions? opts = null)
public RuleEnforcement(String name, RuleEnforcementArgs args)
public RuleEnforcement(String name, RuleEnforcementArgs args, CustomResourceOptions options)
type: harness:governance:RuleEnforcement
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 RuleEnforcementArgs
- 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 RuleEnforcementArgs
- 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 RuleEnforcementArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RuleEnforcementArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RuleEnforcementArgs
- 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 ruleEnforcementResource = new Harness.Governance.RuleEnforcement("ruleEnforcementResource", new()
{
CloudProvider = "string",
ExecutionSchedule = "string",
ExecutionTimezone = "string",
TargetAccounts = new[]
{
"string",
},
Description = "string",
IsDryRun = false,
IsEnabled = false,
Name = "string",
RuleIds = new[]
{
"string",
},
RuleSetIds = new[]
{
"string",
},
TargetRegions = new[]
{
"string",
},
});
example, err := governance.NewRuleEnforcement(ctx, "ruleEnforcementResource", &governance.RuleEnforcementArgs{
CloudProvider: pulumi.String("string"),
ExecutionSchedule: pulumi.String("string"),
ExecutionTimezone: pulumi.String("string"),
TargetAccounts: pulumi.StringArray{
pulumi.String("string"),
},
Description: pulumi.String("string"),
IsDryRun: pulumi.Bool(false),
IsEnabled: pulumi.Bool(false),
Name: pulumi.String("string"),
RuleIds: pulumi.StringArray{
pulumi.String("string"),
},
RuleSetIds: pulumi.StringArray{
pulumi.String("string"),
},
TargetRegions: pulumi.StringArray{
pulumi.String("string"),
},
})
var ruleEnforcementResource = new RuleEnforcement("ruleEnforcementResource", RuleEnforcementArgs.builder()
.cloudProvider("string")
.executionSchedule("string")
.executionTimezone("string")
.targetAccounts("string")
.description("string")
.isDryRun(false)
.isEnabled(false)
.name("string")
.ruleIds("string")
.ruleSetIds("string")
.targetRegions("string")
.build());
rule_enforcement_resource = harness.governance.RuleEnforcement("ruleEnforcementResource",
cloud_provider="string",
execution_schedule="string",
execution_timezone="string",
target_accounts=["string"],
description="string",
is_dry_run=False,
is_enabled=False,
name="string",
rule_ids=["string"],
rule_set_ids=["string"],
target_regions=["string"])
const ruleEnforcementResource = new harness.governance.RuleEnforcement("ruleEnforcementResource", {
cloudProvider: "string",
executionSchedule: "string",
executionTimezone: "string",
targetAccounts: ["string"],
description: "string",
isDryRun: false,
isEnabled: false,
name: "string",
ruleIds: ["string"],
ruleSetIds: ["string"],
targetRegions: ["string"],
});
type: harness:governance:RuleEnforcement
properties:
cloudProvider: string
description: string
executionSchedule: string
executionTimezone: string
isDryRun: false
isEnabled: false
name: string
ruleIds:
- string
ruleSetIds:
- string
targetAccounts:
- string
targetRegions:
- string
RuleEnforcement 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 RuleEnforcement resource accepts the following input properties:
- Cloud
Provider string - The cloud provider for the rule enforcement. It should be either AWS, AZURE or GCP.
- Execution
Schedule string - Execution schedule in cron format.
- Execution
Timezone string - Timezone for the execution schedule.
- Target
Accounts List<string> - List of target account which can be either AWS Account Ids or Azure Subscription Ids or Gcp Project Ids.
- Description string
- Description for rule enforcement.
- Is
Dry boolRun - Indicates if the rule enforcement is a dry run. This by default is set to false.
- Is
Enabled bool - Indicates if the rule enforcement is enabled. This by default is set to true.
- Name string
- Name of the rule enforcement.
- Rule
Ids List<string> - List of rule IDs. Either ruleids or ruleset_ids should be provided.
- Rule
Set List<string>Ids - List of rule set IDs. Either ruleids or ruleset_ids should be provided.
- Target
Regions List<string> - List of target regions. For GCP it should be left empty but is required in case of AWS or Azure.
- Cloud
Provider string - The cloud provider for the rule enforcement. It should be either AWS, AZURE or GCP.
- Execution
Schedule string - Execution schedule in cron format.
- Execution
Timezone string - Timezone for the execution schedule.
- Target
Accounts []string - List of target account which can be either AWS Account Ids or Azure Subscription Ids or Gcp Project Ids.
- Description string
- Description for rule enforcement.
- Is
Dry boolRun - Indicates if the rule enforcement is a dry run. This by default is set to false.
- Is
Enabled bool - Indicates if the rule enforcement is enabled. This by default is set to true.
- Name string
- Name of the rule enforcement.
- Rule
Ids []string - List of rule IDs. Either ruleids or ruleset_ids should be provided.
- Rule
Set []stringIds - List of rule set IDs. Either ruleids or ruleset_ids should be provided.
- Target
Regions []string - List of target regions. For GCP it should be left empty but is required in case of AWS or Azure.
- cloud
Provider String - The cloud provider for the rule enforcement. It should be either AWS, AZURE or GCP.
- execution
Schedule String - Execution schedule in cron format.
- execution
Timezone String - Timezone for the execution schedule.
- target
Accounts List<String> - List of target account which can be either AWS Account Ids or Azure Subscription Ids or Gcp Project Ids.
- description String
- Description for rule enforcement.
- is
Dry BooleanRun - Indicates if the rule enforcement is a dry run. This by default is set to false.
- is
Enabled Boolean - Indicates if the rule enforcement is enabled. This by default is set to true.
- name String
- Name of the rule enforcement.
- rule
Ids List<String> - List of rule IDs. Either ruleids or ruleset_ids should be provided.
- rule
Set List<String>Ids - List of rule set IDs. Either ruleids or ruleset_ids should be provided.
- target
Regions List<String> - List of target regions. For GCP it should be left empty but is required in case of AWS or Azure.
- cloud
Provider string - The cloud provider for the rule enforcement. It should be either AWS, AZURE or GCP.
- execution
Schedule string - Execution schedule in cron format.
- execution
Timezone string - Timezone for the execution schedule.
- target
Accounts string[] - List of target account which can be either AWS Account Ids or Azure Subscription Ids or Gcp Project Ids.
- description string
- Description for rule enforcement.
- is
Dry booleanRun - Indicates if the rule enforcement is a dry run. This by default is set to false.
- is
Enabled boolean - Indicates if the rule enforcement is enabled. This by default is set to true.
- name string
- Name of the rule enforcement.
- rule
Ids string[] - List of rule IDs. Either ruleids or ruleset_ids should be provided.
- rule
Set string[]Ids - List of rule set IDs. Either ruleids or ruleset_ids should be provided.
- target
Regions string[] - List of target regions. For GCP it should be left empty but is required in case of AWS or Azure.
- cloud_
provider str - The cloud provider for the rule enforcement. It should be either AWS, AZURE or GCP.
- execution_
schedule str - Execution schedule in cron format.
- execution_
timezone str - Timezone for the execution schedule.
- target_
accounts Sequence[str] - List of target account which can be either AWS Account Ids or Azure Subscription Ids or Gcp Project Ids.
- description str
- Description for rule enforcement.
- is_
dry_ boolrun - Indicates if the rule enforcement is a dry run. This by default is set to false.
- is_
enabled bool - Indicates if the rule enforcement is enabled. This by default is set to true.
- name str
- Name of the rule enforcement.
- rule_
ids Sequence[str] - List of rule IDs. Either ruleids or ruleset_ids should be provided.
- rule_
set_ Sequence[str]ids - List of rule set IDs. Either ruleids or ruleset_ids should be provided.
- target_
regions Sequence[str] - List of target regions. For GCP it should be left empty but is required in case of AWS or Azure.
- cloud
Provider String - The cloud provider for the rule enforcement. It should be either AWS, AZURE or GCP.
- execution
Schedule String - Execution schedule in cron format.
- execution
Timezone String - Timezone for the execution schedule.
- target
Accounts List<String> - List of target account which can be either AWS Account Ids or Azure Subscription Ids or Gcp Project Ids.
- description String
- Description for rule enforcement.
- is
Dry BooleanRun - Indicates if the rule enforcement is a dry run. This by default is set to false.
- is
Enabled Boolean - Indicates if the rule enforcement is enabled. This by default is set to true.
- name String
- Name of the rule enforcement.
- rule
Ids List<String> - List of rule IDs. Either ruleids or ruleset_ids should be provided.
- rule
Set List<String>Ids - List of rule set IDs. Either ruleids or ruleset_ids should be provided.
- target
Regions List<String> - List of target regions. For GCP it should be left empty but is required in case of AWS or Azure.
Outputs
All input properties are implicitly available as output properties. Additionally, the RuleEnforcement resource produces the following output properties:
- Enforcement
Id string - Id of the rule enforcement.
- Id string
- The provider-assigned unique ID for this managed resource.
- Enforcement
Id string - Id of the rule enforcement.
- Id string
- The provider-assigned unique ID for this managed resource.
- enforcement
Id String - Id of the rule enforcement.
- id String
- The provider-assigned unique ID for this managed resource.
- enforcement
Id string - Id of the rule enforcement.
- id string
- The provider-assigned unique ID for this managed resource.
- enforcement_
id str - Id of the rule enforcement.
- id str
- The provider-assigned unique ID for this managed resource.
- enforcement
Id String - Id of the rule enforcement.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing RuleEnforcement Resource
Get an existing RuleEnforcement 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?: RuleEnforcementState, opts?: CustomResourceOptions): RuleEnforcement
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
cloud_provider: Optional[str] = None,
description: Optional[str] = None,
enforcement_id: Optional[str] = None,
execution_schedule: Optional[str] = None,
execution_timezone: Optional[str] = None,
is_dry_run: Optional[bool] = None,
is_enabled: Optional[bool] = None,
name: Optional[str] = None,
rule_ids: Optional[Sequence[str]] = None,
rule_set_ids: Optional[Sequence[str]] = None,
target_accounts: Optional[Sequence[str]] = None,
target_regions: Optional[Sequence[str]] = None) -> RuleEnforcement
func GetRuleEnforcement(ctx *Context, name string, id IDInput, state *RuleEnforcementState, opts ...ResourceOption) (*RuleEnforcement, error)
public static RuleEnforcement Get(string name, Input<string> id, RuleEnforcementState? state, CustomResourceOptions? opts = null)
public static RuleEnforcement get(String name, Output<String> id, RuleEnforcementState 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 enforcement. It should be either AWS, AZURE or GCP.
- Description string
- Description for rule enforcement.
- Enforcement
Id string - Id of the rule enforcement.
- Execution
Schedule string - Execution schedule in cron format.
- Execution
Timezone string - Timezone for the execution schedule.
- Is
Dry boolRun - Indicates if the rule enforcement is a dry run. This by default is set to false.
- Is
Enabled bool - Indicates if the rule enforcement is enabled. This by default is set to true.
- Name string
- Name of the rule enforcement.
- Rule
Ids List<string> - List of rule IDs. Either ruleids or ruleset_ids should be provided.
- Rule
Set List<string>Ids - List of rule set IDs. Either ruleids or ruleset_ids should be provided.
- Target
Accounts List<string> - List of target account which can be either AWS Account Ids or Azure Subscription Ids or Gcp Project Ids.
- Target
Regions List<string> - List of target regions. For GCP it should be left empty but is required in case of AWS or Azure.
- Cloud
Provider string - The cloud provider for the rule enforcement. It should be either AWS, AZURE or GCP.
- Description string
- Description for rule enforcement.
- Enforcement
Id string - Id of the rule enforcement.
- Execution
Schedule string - Execution schedule in cron format.
- Execution
Timezone string - Timezone for the execution schedule.
- Is
Dry boolRun - Indicates if the rule enforcement is a dry run. This by default is set to false.
- Is
Enabled bool - Indicates if the rule enforcement is enabled. This by default is set to true.
- Name string
- Name of the rule enforcement.
- Rule
Ids []string - List of rule IDs. Either ruleids or ruleset_ids should be provided.
- Rule
Set []stringIds - List of rule set IDs. Either ruleids or ruleset_ids should be provided.
- Target
Accounts []string - List of target account which can be either AWS Account Ids or Azure Subscription Ids or Gcp Project Ids.
- Target
Regions []string - List of target regions. For GCP it should be left empty but is required in case of AWS or Azure.
- cloud
Provider String - The cloud provider for the rule enforcement. It should be either AWS, AZURE or GCP.
- description String
- Description for rule enforcement.
- enforcement
Id String - Id of the rule enforcement.
- execution
Schedule String - Execution schedule in cron format.
- execution
Timezone String - Timezone for the execution schedule.
- is
Dry BooleanRun - Indicates if the rule enforcement is a dry run. This by default is set to false.
- is
Enabled Boolean - Indicates if the rule enforcement is enabled. This by default is set to true.
- name String
- Name of the rule enforcement.
- rule
Ids List<String> - List of rule IDs. Either ruleids or ruleset_ids should be provided.
- rule
Set List<String>Ids - List of rule set IDs. Either ruleids or ruleset_ids should be provided.
- target
Accounts List<String> - List of target account which can be either AWS Account Ids or Azure Subscription Ids or Gcp Project Ids.
- target
Regions List<String> - List of target regions. For GCP it should be left empty but is required in case of AWS or Azure.
- cloud
Provider string - The cloud provider for the rule enforcement. It should be either AWS, AZURE or GCP.
- description string
- Description for rule enforcement.
- enforcement
Id string - Id of the rule enforcement.
- execution
Schedule string - Execution schedule in cron format.
- execution
Timezone string - Timezone for the execution schedule.
- is
Dry booleanRun - Indicates if the rule enforcement is a dry run. This by default is set to false.
- is
Enabled boolean - Indicates if the rule enforcement is enabled. This by default is set to true.
- name string
- Name of the rule enforcement.
- rule
Ids string[] - List of rule IDs. Either ruleids or ruleset_ids should be provided.
- rule
Set string[]Ids - List of rule set IDs. Either ruleids or ruleset_ids should be provided.
- target
Accounts string[] - List of target account which can be either AWS Account Ids or Azure Subscription Ids or Gcp Project Ids.
- target
Regions string[] - List of target regions. For GCP it should be left empty but is required in case of AWS or Azure.
- cloud_
provider str - The cloud provider for the rule enforcement. It should be either AWS, AZURE or GCP.
- description str
- Description for rule enforcement.
- enforcement_
id str - Id of the rule enforcement.
- execution_
schedule str - Execution schedule in cron format.
- execution_
timezone str - Timezone for the execution schedule.
- is_
dry_ boolrun - Indicates if the rule enforcement is a dry run. This by default is set to false.
- is_
enabled bool - Indicates if the rule enforcement is enabled. This by default is set to true.
- name str
- Name of the rule enforcement.
- rule_
ids Sequence[str] - List of rule IDs. Either ruleids or ruleset_ids should be provided.
- rule_
set_ Sequence[str]ids - List of rule set IDs. Either ruleids or ruleset_ids should be provided.
- target_
accounts Sequence[str] - List of target account which can be either AWS Account Ids or Azure Subscription Ids or Gcp Project Ids.
- target_
regions Sequence[str] - List of target regions. For GCP it should be left empty but is required in case of AWS or Azure.
- cloud
Provider String - The cloud provider for the rule enforcement. It should be either AWS, AZURE or GCP.
- description String
- Description for rule enforcement.
- enforcement
Id String - Id of the rule enforcement.
- execution
Schedule String - Execution schedule in cron format.
- execution
Timezone String - Timezone for the execution schedule.
- is
Dry BooleanRun - Indicates if the rule enforcement is a dry run. This by default is set to false.
- is
Enabled Boolean - Indicates if the rule enforcement is enabled. This by default is set to true.
- name String
- Name of the rule enforcement.
- rule
Ids List<String> - List of rule IDs. Either ruleids or ruleset_ids should be provided.
- rule
Set List<String>Ids - List of rule set IDs. Either ruleids or ruleset_ids should be provided.
- target
Accounts List<String> - List of target account which can be either AWS Account Ids or Azure Subscription Ids or Gcp Project Ids.
- target
Regions List<String> - List of target regions. For GCP it should be left empty but is required in case of AWS or Azure.
Import
Import governance enforcement
$ pulumi import harness:governance/ruleEnforcement:RuleEnforcement example <enforcement_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.