incapsula.PolicyAssetAssociation
Explore with Pulumi AI
Provides an Incapsula Policy Asset Association resource. This resource enables you to apply existing policies to assets in your account.
Dependency is on existing policies, created using the incapsula.Policy
resource.
To simplify the use of policies, you can utilize this cloud-waf Module along with its submodules.
For full feature documentation, see Create and Manage Policies.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as incapsula from "@pulumi/incapsula";
const example_policy_asset_association = new incapsula.PolicyAssetAssociation("example-policy-asset-association", {
policyId: incapsula_policy["example-policy"].id,
assetId: incapsula_site["example-site-dns"].id,
assetType: "WEBSITE",
});
import pulumi
import pulumi_incapsula as incapsula
example_policy_asset_association = incapsula.PolicyAssetAssociation("example-policy-asset-association",
policy_id=incapsula_policy["example-policy"]["id"],
asset_id=incapsula_site["example-site-dns"]["id"],
asset_type="WEBSITE")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/incapsula/v3/incapsula"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := incapsula.NewPolicyAssetAssociation(ctx, "example-policy-asset-association", &incapsula.PolicyAssetAssociationArgs{
PolicyId: pulumi.Any(incapsula_policy.ExamplePolicy.Id),
AssetId: pulumi.Any(incapsula_site.ExampleSiteDns.Id),
AssetType: pulumi.String("WEBSITE"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Incapsula = Pulumi.Incapsula;
return await Deployment.RunAsync(() =>
{
var example_policy_asset_association = new Incapsula.PolicyAssetAssociation("example-policy-asset-association", new()
{
PolicyId = incapsula_policy.Example_policy.Id,
AssetId = incapsula_site.Example_site_dns.Id,
AssetType = "WEBSITE",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.incapsula.PolicyAssetAssociation;
import com.pulumi.incapsula.PolicyAssetAssociationArgs;
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_policy_asset_association = new PolicyAssetAssociation("example-policy-asset-association", PolicyAssetAssociationArgs.builder()
.policyId(incapsula_policy.example-policy().id())
.assetId(incapsula_site.example-site-dns().id())
.assetType("WEBSITE")
.build());
}
}
resources:
example-policy-asset-association:
type: incapsula:PolicyAssetAssociation
properties:
policyId: ${incapsula_policy"example-policy"[%!s(MISSING)].id}
assetId: ${incapsula_site"example-site-dns"[%!s(MISSING)].id}
assetType: WEBSITE
Create PolicyAssetAssociation Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new PolicyAssetAssociation(name: string, args: PolicyAssetAssociationArgs, opts?: CustomResourceOptions);
@overload
def PolicyAssetAssociation(resource_name: str,
args: PolicyAssetAssociationArgs,
opts: Optional[ResourceOptions] = None)
@overload
def PolicyAssetAssociation(resource_name: str,
opts: Optional[ResourceOptions] = None,
asset_id: Optional[str] = None,
asset_type: Optional[str] = None,
policy_id: Optional[str] = None,
account_id: Optional[float] = None,
policy_asset_association_id: Optional[str] = None)
func NewPolicyAssetAssociation(ctx *Context, name string, args PolicyAssetAssociationArgs, opts ...ResourceOption) (*PolicyAssetAssociation, error)
public PolicyAssetAssociation(string name, PolicyAssetAssociationArgs args, CustomResourceOptions? opts = null)
public PolicyAssetAssociation(String name, PolicyAssetAssociationArgs args)
public PolicyAssetAssociation(String name, PolicyAssetAssociationArgs args, CustomResourceOptions options)
type: incapsula:PolicyAssetAssociation
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 PolicyAssetAssociationArgs
- 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 PolicyAssetAssociationArgs
- 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 PolicyAssetAssociationArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args PolicyAssetAssociationArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args PolicyAssetAssociationArgs
- 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 policyAssetAssociationResource = new Incapsula.PolicyAssetAssociation("policyAssetAssociationResource", new()
{
AssetId = "string",
AssetType = "string",
PolicyId = "string",
AccountId = 0,
PolicyAssetAssociationId = "string",
});
example, err := incapsula.NewPolicyAssetAssociation(ctx, "policyAssetAssociationResource", &incapsula.PolicyAssetAssociationArgs{
AssetId: pulumi.String("string"),
AssetType: pulumi.String("string"),
PolicyId: pulumi.String("string"),
AccountId: pulumi.Float64(0),
PolicyAssetAssociationId: pulumi.String("string"),
})
var policyAssetAssociationResource = new PolicyAssetAssociation("policyAssetAssociationResource", PolicyAssetAssociationArgs.builder()
.assetId("string")
.assetType("string")
.policyId("string")
.accountId(0)
.policyAssetAssociationId("string")
.build());
policy_asset_association_resource = incapsula.PolicyAssetAssociation("policyAssetAssociationResource",
asset_id="string",
asset_type="string",
policy_id="string",
account_id=0,
policy_asset_association_id="string")
const policyAssetAssociationResource = new incapsula.PolicyAssetAssociation("policyAssetAssociationResource", {
assetId: "string",
assetType: "string",
policyId: "string",
accountId: 0,
policyAssetAssociationId: "string",
});
type: incapsula:PolicyAssetAssociation
properties:
accountId: 0
assetId: string
assetType: string
policyAssetAssociationId: string
policyId: string
PolicyAssetAssociation 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 PolicyAssetAssociation resource accepts the following input properties:
- Asset
Id string - The Asset ID for the asset association. Only type of asset supported at the moment is site.
- Asset
Type string - The Policy type for the asset association. Only value at the moment is
WEBSITE
. - Policy
Id string - The Policy ID for the asset association.
- Account
Id double - The account ID of the asset. Set this field if the asset's account is different than the account used in the credentials. For example, when setting a sub account’s asset association from the parent account.
- Policy
Asset stringAssociation Id - Unique identifier in the API for the policy asset association.
- Asset
Id string - The Asset ID for the asset association. Only type of asset supported at the moment is site.
- Asset
Type string - The Policy type for the asset association. Only value at the moment is
WEBSITE
. - Policy
Id string - The Policy ID for the asset association.
- Account
Id float64 - The account ID of the asset. Set this field if the asset's account is different than the account used in the credentials. For example, when setting a sub account’s asset association from the parent account.
- Policy
Asset stringAssociation Id - Unique identifier in the API for the policy asset association.
- asset
Id String - The Asset ID for the asset association. Only type of asset supported at the moment is site.
- asset
Type String - The Policy type for the asset association. Only value at the moment is
WEBSITE
. - policy
Id String - The Policy ID for the asset association.
- account
Id Double - The account ID of the asset. Set this field if the asset's account is different than the account used in the credentials. For example, when setting a sub account’s asset association from the parent account.
- policy
Asset StringAssociation Id - Unique identifier in the API for the policy asset association.
- asset
Id string - The Asset ID for the asset association. Only type of asset supported at the moment is site.
- asset
Type string - The Policy type for the asset association. Only value at the moment is
WEBSITE
. - policy
Id string - The Policy ID for the asset association.
- account
Id number - The account ID of the asset. Set this field if the asset's account is different than the account used in the credentials. For example, when setting a sub account’s asset association from the parent account.
- policy
Asset stringAssociation Id - Unique identifier in the API for the policy asset association.
- asset_
id str - The Asset ID for the asset association. Only type of asset supported at the moment is site.
- asset_
type str - The Policy type for the asset association. Only value at the moment is
WEBSITE
. - policy_
id str - The Policy ID for the asset association.
- account_
id float - The account ID of the asset. Set this field if the asset's account is different than the account used in the credentials. For example, when setting a sub account’s asset association from the parent account.
- policy_
asset_ strassociation_ id - Unique identifier in the API for the policy asset association.
- asset
Id String - The Asset ID for the asset association. Only type of asset supported at the moment is site.
- asset
Type String - The Policy type for the asset association. Only value at the moment is
WEBSITE
. - policy
Id String - The Policy ID for the asset association.
- account
Id Number - The account ID of the asset. Set this field if the asset's account is different than the account used in the credentials. For example, when setting a sub account’s asset association from the parent account.
- policy
Asset StringAssociation Id - Unique identifier in the API for the policy asset association.
Outputs
All input properties are implicitly available as output properties. Additionally, the PolicyAssetAssociation resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing PolicyAssetAssociation Resource
Get an existing PolicyAssetAssociation 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?: PolicyAssetAssociationState, opts?: CustomResourceOptions): PolicyAssetAssociation
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[float] = None,
asset_id: Optional[str] = None,
asset_type: Optional[str] = None,
policy_asset_association_id: Optional[str] = None,
policy_id: Optional[str] = None) -> PolicyAssetAssociation
func GetPolicyAssetAssociation(ctx *Context, name string, id IDInput, state *PolicyAssetAssociationState, opts ...ResourceOption) (*PolicyAssetAssociation, error)
public static PolicyAssetAssociation Get(string name, Input<string> id, PolicyAssetAssociationState? state, CustomResourceOptions? opts = null)
public static PolicyAssetAssociation get(String name, Output<String> id, PolicyAssetAssociationState state, CustomResourceOptions options)
resources: _: type: incapsula:PolicyAssetAssociation 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.
- Account
Id double - The account ID of the asset. Set this field if the asset's account is different than the account used in the credentials. For example, when setting a sub account’s asset association from the parent account.
- Asset
Id string - The Asset ID for the asset association. Only type of asset supported at the moment is site.
- Asset
Type string - The Policy type for the asset association. Only value at the moment is
WEBSITE
. - Policy
Asset stringAssociation Id - Unique identifier in the API for the policy asset association.
- Policy
Id string - The Policy ID for the asset association.
- Account
Id float64 - The account ID of the asset. Set this field if the asset's account is different than the account used in the credentials. For example, when setting a sub account’s asset association from the parent account.
- Asset
Id string - The Asset ID for the asset association. Only type of asset supported at the moment is site.
- Asset
Type string - The Policy type for the asset association. Only value at the moment is
WEBSITE
. - Policy
Asset stringAssociation Id - Unique identifier in the API for the policy asset association.
- Policy
Id string - The Policy ID for the asset association.
- account
Id Double - The account ID of the asset. Set this field if the asset's account is different than the account used in the credentials. For example, when setting a sub account’s asset association from the parent account.
- asset
Id String - The Asset ID for the asset association. Only type of asset supported at the moment is site.
- asset
Type String - The Policy type for the asset association. Only value at the moment is
WEBSITE
. - policy
Asset StringAssociation Id - Unique identifier in the API for the policy asset association.
- policy
Id String - The Policy ID for the asset association.
- account
Id number - The account ID of the asset. Set this field if the asset's account is different than the account used in the credentials. For example, when setting a sub account’s asset association from the parent account.
- asset
Id string - The Asset ID for the asset association. Only type of asset supported at the moment is site.
- asset
Type string - The Policy type for the asset association. Only value at the moment is
WEBSITE
. - policy
Asset stringAssociation Id - Unique identifier in the API for the policy asset association.
- policy
Id string - The Policy ID for the asset association.
- account_
id float - The account ID of the asset. Set this field if the asset's account is different than the account used in the credentials. For example, when setting a sub account’s asset association from the parent account.
- asset_
id str - The Asset ID for the asset association. Only type of asset supported at the moment is site.
- asset_
type str - The Policy type for the asset association. Only value at the moment is
WEBSITE
. - policy_
asset_ strassociation_ id - Unique identifier in the API for the policy asset association.
- policy_
id str - The Policy ID for the asset association.
- account
Id Number - The account ID of the asset. Set this field if the asset's account is different than the account used in the credentials. For example, when setting a sub account’s asset association from the parent account.
- asset
Id String - The Asset ID for the asset association. Only type of asset supported at the moment is site.
- asset
Type String - The Policy type for the asset association. Only value at the moment is
WEBSITE
. - policy
Asset StringAssociation Id - Unique identifier in the API for the policy asset association.
- policy
Id String - The Policy ID for the asset association.
Import
Policy can be imported using the policy_id
, asset_id
and asset_type
e.g.:
$ pulumi import incapsula:index/policyAssetAssociation:PolicyAssetAssociation example-policy-asset-association policy_id/asset_id/asset_type
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- incapsula imperva/terraform-provider-incapsula
- License
- Notes
- This Pulumi package is based on the
incapsula
Terraform Provider.