lacework.PolicyException
Explore with Pulumi AI
Add exceptions to Lacework policies
For more information, see the Adding Exceptions to a Policy.
Example Usage
Create a Lacework Policy Exception to exempt specified aws account from policy.
import * as pulumi from "@pulumi/pulumi";
import * as lacework from "@pulumi/lacework";
const example = new lacework.PolicyException("example", {
constraints: [{
fieldKey: "accountIds",
fieldValues: ["123456789"],
}],
description: "Exception for account 123456789",
policyId: "lacework-global-73",
});
import pulumi
import pulumi_lacework as lacework
example = lacework.PolicyException("example",
constraints=[{
"field_key": "accountIds",
"field_values": ["123456789"],
}],
description="Exception for account 123456789",
policy_id="lacework-global-73")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/lacework/v2/lacework"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := lacework.NewPolicyException(ctx, "example", &lacework.PolicyExceptionArgs{
Constraints: lacework.PolicyExceptionConstraintArray{
&lacework.PolicyExceptionConstraintArgs{
FieldKey: pulumi.String("accountIds"),
FieldValues: pulumi.StringArray{
pulumi.String("123456789"),
},
},
},
Description: pulumi.String("Exception for account 123456789"),
PolicyId: pulumi.String("lacework-global-73"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Lacework = Pulumi.Lacework;
return await Deployment.RunAsync(() =>
{
var example = new Lacework.PolicyException("example", new()
{
Constraints = new[]
{
new Lacework.Inputs.PolicyExceptionConstraintArgs
{
FieldKey = "accountIds",
FieldValues = new[]
{
"123456789",
},
},
},
Description = "Exception for account 123456789",
PolicyId = "lacework-global-73",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.lacework.PolicyException;
import com.pulumi.lacework.PolicyExceptionArgs;
import com.pulumi.lacework.inputs.PolicyExceptionConstraintArgs;
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) {
var example = new PolicyException("example", PolicyExceptionArgs.builder()
.constraints(PolicyExceptionConstraintArgs.builder()
.fieldKey("accountIds")
.fieldValues("123456789")
.build())
.description("Exception for account 123456789")
.policyId("lacework-global-73")
.build());
}
}
resources:
example:
type: lacework:PolicyException
properties:
constraints:
- fieldKey: accountIds
fieldValues:
- '123456789'
description: Exception for account 123456789
policyId: lacework-global-73
Create a Lacework Policy Exception to exempt specified resourceTags
from policy.
Coming soon!
Coming soon!
Coming soon!
Coming soon!
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.lacework.PolicyException;
import com.pulumi.lacework.PolicyExceptionArgs;
import com.pulumi.lacework.inputs.PolicyExceptionConstraintArgs;
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) {
var example = new PolicyException("example", PolicyExceptionArgs.builder()
.constraints(PolicyExceptionConstraintArgs.builder()
.fieldKey("resourceTags")
.fieldValuesMaps(
PolicyExceptionConstraintFieldValuesMapArgs.builder()
.key("example_tag1")
.value(
"example_value",
"example_value1")
.build(),
PolicyExceptionConstraintFieldValuesMapArgs.builder()
.key("example_tag2")
.value(
"example_value",
"example_value1")
.build())
.build())
.description("Exception for resource tag example1 and example2")
.policyId("lacework-global-73")
.build());
}
}
resources:
example:
type: lacework:PolicyException
properties:
constraints:
- fieldKey: resourceTags
fieldValuesMaps:
- key: example_tag1
value:
- example_value
- example_value1
- key: example_tag2
value:
- example_value
- example_value1
description: Exception for resource tag example1 and example2
policyId: lacework-global-73
Create PolicyException Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new PolicyException(name: string, args: PolicyExceptionArgs, opts?: CustomResourceOptions);
@overload
def PolicyException(resource_name: str,
args: PolicyExceptionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def PolicyException(resource_name: str,
opts: Optional[ResourceOptions] = None,
constraints: Optional[Sequence[PolicyExceptionConstraintArgs]] = None,
description: Optional[str] = None,
policy_id: Optional[str] = None)
func NewPolicyException(ctx *Context, name string, args PolicyExceptionArgs, opts ...ResourceOption) (*PolicyException, error)
public PolicyException(string name, PolicyExceptionArgs args, CustomResourceOptions? opts = null)
public PolicyException(String name, PolicyExceptionArgs args)
public PolicyException(String name, PolicyExceptionArgs args, CustomResourceOptions options)
type: lacework:PolicyException
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 PolicyExceptionArgs
- 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 PolicyExceptionArgs
- 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 PolicyExceptionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PolicyExceptionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PolicyExceptionArgs
- 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 policyExceptionResource = new Lacework.PolicyException("policyExceptionResource", new()
{
Constraints = new[]
{
new Lacework.Inputs.PolicyExceptionConstraintArgs
{
FieldKey = "string",
FieldValues = new[]
{
"string",
},
FieldValuesMaps = new[]
{
new Lacework.Inputs.PolicyExceptionConstraintFieldValuesMapArgs
{
Key = "string",
Values = new[]
{
"string",
},
},
},
},
},
Description = "string",
PolicyId = "string",
});
example, err := lacework.NewPolicyException(ctx, "policyExceptionResource", &lacework.PolicyExceptionArgs{
Constraints: lacework.PolicyExceptionConstraintArray{
&lacework.PolicyExceptionConstraintArgs{
FieldKey: pulumi.String("string"),
FieldValues: pulumi.StringArray{
pulumi.String("string"),
},
FieldValuesMaps: lacework.PolicyExceptionConstraintFieldValuesMapArray{
&lacework.PolicyExceptionConstraintFieldValuesMapArgs{
Key: pulumi.String("string"),
Values: pulumi.StringArray{
pulumi.String("string"),
},
},
},
},
},
Description: pulumi.String("string"),
PolicyId: pulumi.String("string"),
})
var policyExceptionResource = new PolicyException("policyExceptionResource", PolicyExceptionArgs.builder()
.constraints(PolicyExceptionConstraintArgs.builder()
.fieldKey("string")
.fieldValues("string")
.fieldValuesMaps(PolicyExceptionConstraintFieldValuesMapArgs.builder()
.key("string")
.values("string")
.build())
.build())
.description("string")
.policyId("string")
.build());
policy_exception_resource = lacework.PolicyException("policyExceptionResource",
constraints=[{
"field_key": "string",
"field_values": ["string"],
"field_values_maps": [{
"key": "string",
"values": ["string"],
}],
}],
description="string",
policy_id="string")
const policyExceptionResource = new lacework.PolicyException("policyExceptionResource", {
constraints: [{
fieldKey: "string",
fieldValues: ["string"],
fieldValuesMaps: [{
key: "string",
values: ["string"],
}],
}],
description: "string",
policyId: "string",
});
type: lacework:PolicyException
properties:
constraints:
- fieldKey: string
fieldValues:
- string
fieldValuesMaps:
- key: string
values:
- string
description: string
policyId: string
PolicyException 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 PolicyException resource accepts the following input properties:
- Constraints
List<Policy
Exception Constraint> - Constraint. See Constraint below for details.
- Description string
- The description of the policy exception.
- Policy
Id string - The id of the policy the exception is associated.
- Constraints
[]Policy
Exception Constraint Args - Constraint. See Constraint below for details.
- Description string
- The description of the policy exception.
- Policy
Id string - The id of the policy the exception is associated.
- constraints
List<Policy
Exception Constraint> - Constraint. See Constraint below for details.
- description String
- The description of the policy exception.
- policy
Id String - The id of the policy the exception is associated.
- constraints
Policy
Exception Constraint[] - Constraint. See Constraint below for details.
- description string
- The description of the policy exception.
- policy
Id string - The id of the policy the exception is associated.
- constraints
Sequence[Policy
Exception Constraint Args] - Constraint. See Constraint below for details.
- description str
- The description of the policy exception.
- policy_
id str - The id of the policy the exception is associated.
- constraints List<Property Map>
- Constraint. See Constraint below for details.
- description String
- The description of the policy exception.
- policy
Id String - The id of the policy the exception is associated.
Outputs
All input properties are implicitly available as output properties. Additionally, the PolicyException resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Updated
By string - Updated
Time string
- Id string
- The provider-assigned unique ID for this managed resource.
- Updated
By string - Updated
Time string
- id String
- The provider-assigned unique ID for this managed resource.
- updated
By String - updated
Time String
- id string
- The provider-assigned unique ID for this managed resource.
- updated
By string - updated
Time string
- id str
- The provider-assigned unique ID for this managed resource.
- updated_
by str - updated_
time str
- id String
- The provider-assigned unique ID for this managed resource.
- updated
By String - updated
Time String
Look up Existing PolicyException Resource
Get an existing PolicyException 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?: PolicyExceptionState, opts?: CustomResourceOptions): PolicyException
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
constraints: Optional[Sequence[PolicyExceptionConstraintArgs]] = None,
description: Optional[str] = None,
policy_id: Optional[str] = None,
updated_by: Optional[str] = None,
updated_time: Optional[str] = None) -> PolicyException
func GetPolicyException(ctx *Context, name string, id IDInput, state *PolicyExceptionState, opts ...ResourceOption) (*PolicyException, error)
public static PolicyException Get(string name, Input<string> id, PolicyExceptionState? state, CustomResourceOptions? opts = null)
public static PolicyException get(String name, Output<String> id, PolicyExceptionState state, CustomResourceOptions options)
resources: _: type: lacework:PolicyException get: id: ${id}
- 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.
- Constraints
List<Policy
Exception Constraint> - Constraint. See Constraint below for details.
- Description string
- The description of the policy exception.
- Policy
Id string - The id of the policy the exception is associated.
- Updated
By string - Updated
Time string
- Constraints
[]Policy
Exception Constraint Args - Constraint. See Constraint below for details.
- Description string
- The description of the policy exception.
- Policy
Id string - The id of the policy the exception is associated.
- Updated
By string - Updated
Time string
- constraints
List<Policy
Exception Constraint> - Constraint. See Constraint below for details.
- description String
- The description of the policy exception.
- policy
Id String - The id of the policy the exception is associated.
- updated
By String - updated
Time String
- constraints
Policy
Exception Constraint[] - Constraint. See Constraint below for details.
- description string
- The description of the policy exception.
- policy
Id string - The id of the policy the exception is associated.
- updated
By string - updated
Time string
- constraints
Sequence[Policy
Exception Constraint Args] - Constraint. See Constraint below for details.
- description str
- The description of the policy exception.
- policy_
id str - The id of the policy the exception is associated.
- updated_
by str - updated_
time str
- constraints List<Property Map>
- Constraint. See Constraint below for details.
- description String
- The description of the policy exception.
- policy
Id String - The id of the policy the exception is associated.
- updated
By String - updated
Time String
Supporting Types
PolicyExceptionConstraint, PolicyExceptionConstraintArgs
- Field
Key string - The key of the constraint being applied. Example for Aws polices this could be
accountIds
. - Field
Value List<PolicyMaps Exception Constraint Field Value Map> - FieldValueMap. SeeFieldValueMap below for details.
- Field
Values List<string> - The values related to the constraint key.
- Field
Values List<PolicyMaps Exception Constraint Field Values Map> - FieldValueMap. SeeFieldValuesMap below for details.
- Field
Key string - The key of the constraint being applied. Example for Aws polices this could be
accountIds
. - Field
Value []PolicyMaps Exception Constraint Field Value Map - FieldValueMap. SeeFieldValueMap below for details.
- Field
Values []string - The values related to the constraint key.
- Field
Values []PolicyMaps Exception Constraint Field Values Map - FieldValueMap. SeeFieldValuesMap below for details.
- field
Key String - The key of the constraint being applied. Example for Aws polices this could be
accountIds
. - field
Value List<PolicyMaps Exception Constraint Field Value Map> - FieldValueMap. SeeFieldValueMap below for details.
- field
Values List<String> - The values related to the constraint key.
- field
Values List<PolicyMaps Exception Constraint Field Values Map> - FieldValueMap. SeeFieldValuesMap below for details.
- field
Key string - The key of the constraint being applied. Example for Aws polices this could be
accountIds
. - field
Value PolicyMaps Exception Constraint Field Value Map[] - FieldValueMap. SeeFieldValueMap below for details.
- field
Values string[] - The values related to the constraint key.
- field
Values PolicyMaps Exception Constraint Field Values Map[] - FieldValueMap. SeeFieldValuesMap below for details.
- field_
key str - The key of the constraint being applied. Example for Aws polices this could be
accountIds
. - field_
value_ Sequence[Policymaps Exception Constraint Field Value Map] - FieldValueMap. SeeFieldValueMap below for details.
- field_
values Sequence[str] - The values related to the constraint key.
- field_
values_ Sequence[Policymaps Exception Constraint Field Values Map] - FieldValueMap. SeeFieldValuesMap below for details.
- field
Key String - The key of the constraint being applied. Example for Aws polices this could be
accountIds
. - field
Value List<Property Map>Maps - FieldValueMap. SeeFieldValueMap below for details.
- field
Values List<String> - The values related to the constraint key.
- field
Values List<Property Map>Maps - FieldValueMap. SeeFieldValuesMap below for details.
PolicyExceptionConstraintFieldValueMap, PolicyExceptionConstraintFieldValueMapArgs
PolicyExceptionConstraintFieldValuesMap, PolicyExceptionConstraintFieldValuesMapArgs
Import
A Lacework policy can be imported using a POLICY_ID
and EXCEPTION_ID
, e.g.
$ pulumi import lacework:index/policyException:PolicyException example YourLQLPolicyID YourExceptionID
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- lacework lacework/terraform-provider-lacework
- License
- Notes
- This Pulumi package is based on the
lacework
Terraform Provider.