1. Packages
  2. CrowdStrike
  3. API Docs
  4. PreventionPolicyAttachment
CrowdStrike v0.0.13 published on Tuesday, Apr 22, 2025 by CrowdStrike

crowdstrike.PreventionPolicyAttachment

Explore with Pulumi AI

crowdstrike logo
CrowdStrike v0.0.13 published on Tuesday, Apr 22, 2025 by CrowdStrike

    This resource allows managing the host groups and ioa rule groups attached to a prevention policy. This resource takes exclusive ownership over the host groups and ioa rule groups assigned to a prevention policy. If you want to fully create or manage a prevention policy please use the prevention_policy_* resource for the platform you want to manage.

    API Scopes

    The following API scopes are required:

    • Prevention policies | Read & Write

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as crowdstrike from "@crowdstrike/pulumi";
    
    const example = new crowdstrike.PreventionPolicyAttachment("example", {
        idProperty: "16c0eecfeebb47ce95185fda2e5b3112",
        hostGroups: ["df868c936cd443e5a95b2603e2483602"],
        ioaRuleGroups: ["507117bc669d41bb93d0a009f557bb23"],
    });
    export const preventionPolicyAttachment = example;
    
    import pulumi
    import crowdstrike_pulumi as crowdstrike
    
    example = crowdstrike.PreventionPolicyAttachment("example",
        id_property="16c0eecfeebb47ce95185fda2e5b3112",
        host_groups=["df868c936cd443e5a95b2603e2483602"],
        ioa_rule_groups=["507117bc669d41bb93d0a009f557bb23"])
    pulumi.export("preventionPolicyAttachment", example)
    
    package main
    
    import (
    	"github.com/crowdstrike/pulumi-crowdstrike/sdk/go/crowdstrike"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := crowdstrike.NewPreventionPolicyAttachment(ctx, "example", &crowdstrike.PreventionPolicyAttachmentArgs{
    			IdProperty: pulumi.String("16c0eecfeebb47ce95185fda2e5b3112"),
    			HostGroups: pulumi.StringArray{
    				pulumi.String("df868c936cd443e5a95b2603e2483602"),
    			},
    			IoaRuleGroups: pulumi.StringArray{
    				pulumi.String("507117bc669d41bb93d0a009f557bb23"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		ctx.Export("preventionPolicyAttachment", example)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Crowdstrike = CrowdStrike.Crowdstrike;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Crowdstrike.PreventionPolicyAttachment("example", new()
        {
            IdProperty = "16c0eecfeebb47ce95185fda2e5b3112",
            HostGroups = new[]
            {
                "df868c936cd443e5a95b2603e2483602",
            },
            IoaRuleGroups = new[]
            {
                "507117bc669d41bb93d0a009f557bb23",
            },
        });
    
        return new Dictionary<string, object?>
        {
            ["preventionPolicyAttachment"] = example,
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.crowdstrike.crowdstrike.PreventionPolicyAttachment;
    import com.crowdstrike.crowdstrike.PreventionPolicyAttachmentArgs;
    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 PreventionPolicyAttachment("example", PreventionPolicyAttachmentArgs.builder()
                .idProperty("16c0eecfeebb47ce95185fda2e5b3112")
                .hostGroups("df868c936cd443e5a95b2603e2483602")
                .ioaRuleGroups("507117bc669d41bb93d0a009f557bb23")
                .build());
    
            ctx.export("preventionPolicyAttachment", example);
        }
    }
    
    resources:
      example:
        type: crowdstrike:PreventionPolicyAttachment
        properties:
          idProperty: 16c0eecfeebb47ce95185fda2e5b3112
          hostGroups:
            - df868c936cd443e5a95b2603e2483602
          ioaRuleGroups:
            - 507117bc669d41bb93d0a009f557bb23
    outputs:
      preventionPolicyAttachment: ${example}
    

    Create PreventionPolicyAttachment Resource

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

    Constructor syntax

    new PreventionPolicyAttachment(name: string, args: PreventionPolicyAttachmentArgs, opts?: CustomResourceOptions);
    @overload
    def PreventionPolicyAttachment(resource_name: str,
                                   args: PreventionPolicyAttachmentArgs,
                                   opts: Optional[ResourceOptions] = None)
    
    @overload
    def PreventionPolicyAttachment(resource_name: str,
                                   opts: Optional[ResourceOptions] = None,
                                   id_property: Optional[str] = None,
                                   host_groups: Optional[Sequence[str]] = None,
                                   ioa_rule_groups: Optional[Sequence[str]] = None)
    func NewPreventionPolicyAttachment(ctx *Context, name string, args PreventionPolicyAttachmentArgs, opts ...ResourceOption) (*PreventionPolicyAttachment, error)
    public PreventionPolicyAttachment(string name, PreventionPolicyAttachmentArgs args, CustomResourceOptions? opts = null)
    public PreventionPolicyAttachment(String name, PreventionPolicyAttachmentArgs args)
    public PreventionPolicyAttachment(String name, PreventionPolicyAttachmentArgs args, CustomResourceOptions options)
    
    type: crowdstrike:PreventionPolicyAttachment
    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 PreventionPolicyAttachmentArgs
    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 PreventionPolicyAttachmentArgs
    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 PreventionPolicyAttachmentArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PreventionPolicyAttachmentArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PreventionPolicyAttachmentArgs
    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 preventionPolicyAttachmentResource = new Crowdstrike.PreventionPolicyAttachment("preventionPolicyAttachmentResource", new()
    {
        IdProperty = "string",
        HostGroups = new[]
        {
            "string",
        },
        IoaRuleGroups = new[]
        {
            "string",
        },
    });
    
    example, err := crowdstrike.NewPreventionPolicyAttachment(ctx, "preventionPolicyAttachmentResource", &crowdstrike.PreventionPolicyAttachmentArgs{
    	IdProperty: pulumi.String("string"),
    	HostGroups: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    	IoaRuleGroups: pulumi.StringArray{
    		pulumi.String("string"),
    	},
    })
    
    var preventionPolicyAttachmentResource = new PreventionPolicyAttachment("preventionPolicyAttachmentResource", PreventionPolicyAttachmentArgs.builder()
        .idProperty("string")
        .hostGroups("string")
        .ioaRuleGroups("string")
        .build());
    
    prevention_policy_attachment_resource = crowdstrike.PreventionPolicyAttachment("preventionPolicyAttachmentResource",
        id_property="string",
        host_groups=["string"],
        ioa_rule_groups=["string"])
    
    const preventionPolicyAttachmentResource = new crowdstrike.PreventionPolicyAttachment("preventionPolicyAttachmentResource", {
        idProperty: "string",
        hostGroups: ["string"],
        ioaRuleGroups: ["string"],
    });
    
    type: crowdstrike:PreventionPolicyAttachment
    properties:
        hostGroups:
            - string
        idProperty: string
        ioaRuleGroups:
            - string
    

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

    IdProperty string
    The prevention policy id you want to attach to.
    HostGroups List<string>
    Host Group ids to attach to the prevention policy.
    IoaRuleGroups List<string>
    IOA Rule Group to attach to the prevention policy.
    IdProperty string
    The prevention policy id you want to attach to.
    HostGroups []string
    Host Group ids to attach to the prevention policy.
    IoaRuleGroups []string
    IOA Rule Group to attach to the prevention policy.
    idProperty String
    The prevention policy id you want to attach to.
    hostGroups List<String>
    Host Group ids to attach to the prevention policy.
    ioaRuleGroups List<String>
    IOA Rule Group to attach to the prevention policy.
    idProperty string
    The prevention policy id you want to attach to.
    hostGroups string[]
    Host Group ids to attach to the prevention policy.
    ioaRuleGroups string[]
    IOA Rule Group to attach to the prevention policy.
    id_property str
    The prevention policy id you want to attach to.
    host_groups Sequence[str]
    Host Group ids to attach to the prevention policy.
    ioa_rule_groups Sequence[str]
    IOA Rule Group to attach to the prevention policy.
    idProperty String
    The prevention policy id you want to attach to.
    hostGroups List<String>
    Host Group ids to attach to the prevention policy.
    ioaRuleGroups List<String>
    IOA Rule Group to attach to the prevention policy.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdated string
    Id string
    The provider-assigned unique ID for this managed resource.
    LastUpdated string
    id String
    The provider-assigned unique ID for this managed resource.
    lastUpdated String
    id string
    The provider-assigned unique ID for this managed resource.
    lastUpdated string
    id str
    The provider-assigned unique ID for this managed resource.
    last_updated str
    id String
    The provider-assigned unique ID for this managed resource.
    lastUpdated String

    Look up Existing PreventionPolicyAttachment Resource

    Get an existing PreventionPolicyAttachment 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?: PreventionPolicyAttachmentState, opts?: CustomResourceOptions): PreventionPolicyAttachment
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            host_groups: Optional[Sequence[str]] = None,
            id_property: Optional[str] = None,
            ioa_rule_groups: Optional[Sequence[str]] = None,
            last_updated: Optional[str] = None) -> PreventionPolicyAttachment
    func GetPreventionPolicyAttachment(ctx *Context, name string, id IDInput, state *PreventionPolicyAttachmentState, opts ...ResourceOption) (*PreventionPolicyAttachment, error)
    public static PreventionPolicyAttachment Get(string name, Input<string> id, PreventionPolicyAttachmentState? state, CustomResourceOptions? opts = null)
    public static PreventionPolicyAttachment get(String name, Output<String> id, PreventionPolicyAttachmentState state, CustomResourceOptions options)
    resources:  _:    type: crowdstrike:PreventionPolicyAttachment    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.
    The following state arguments are supported:
    HostGroups List<string>
    Host Group ids to attach to the prevention policy.
    IdProperty string
    The prevention policy id you want to attach to.
    IoaRuleGroups List<string>
    IOA Rule Group to attach to the prevention policy.
    LastUpdated string
    HostGroups []string
    Host Group ids to attach to the prevention policy.
    IdProperty string
    The prevention policy id you want to attach to.
    IoaRuleGroups []string
    IOA Rule Group to attach to the prevention policy.
    LastUpdated string
    hostGroups List<String>
    Host Group ids to attach to the prevention policy.
    idProperty String
    The prevention policy id you want to attach to.
    ioaRuleGroups List<String>
    IOA Rule Group to attach to the prevention policy.
    lastUpdated String
    hostGroups string[]
    Host Group ids to attach to the prevention policy.
    idProperty string
    The prevention policy id you want to attach to.
    ioaRuleGroups string[]
    IOA Rule Group to attach to the prevention policy.
    lastUpdated string
    host_groups Sequence[str]
    Host Group ids to attach to the prevention policy.
    id_property str
    The prevention policy id you want to attach to.
    ioa_rule_groups Sequence[str]
    IOA Rule Group to attach to the prevention policy.
    last_updated str
    hostGroups List<String>
    Host Group ids to attach to the prevention policy.
    idProperty String
    The prevention policy id you want to attach to.
    ioaRuleGroups List<String>
    IOA Rule Group to attach to the prevention policy.
    lastUpdated String

    Import

    Prevention Policy Attachment can be imported by specifying the id.

    $ pulumi import crowdstrike:index/preventionPolicyAttachment:PreventionPolicyAttachment example 7fb858a949034a0cbca175f660f1e769
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    crowdstrike crowdstrike/pulumi-crowdstrike
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the crowdstrike Terraform Provider.
    crowdstrike logo
    CrowdStrike v0.0.13 published on Tuesday, Apr 22, 2025 by CrowdStrike