ibm.CisWafRule
Explore with Pulumi AI
Create, update, or delete an IBM Cloud Internet Services WAF rule settings resource. This resource is associated with an IBM Cloud Internet Services instance and a CIS Domain resource. It allows to change WAF rule settings of a domain of a CIS instance. For more information, refer to IBM Cloud Internet Services rule sets.
Example Usage
The following example shows how you can add a WAF rule resource to an IBM Cloud Internet Services domain.
import * as pulumi from "@pulumi/pulumi";
import * as ibm from "@pulumi/ibm";
const test = new ibm.CisWafRule("test", {
cisId: data.ibm_cis.cis.id,
domainId: data.ibm_cis_domain.cis_domain.id,
packageId: "c504870194831cd12c3fc0284f294abb",
ruleId: "100000356",
mode: "on",
});
import pulumi
import pulumi_ibm as ibm
test = ibm.CisWafRule("test",
cis_id=data["ibm_cis"]["cis"]["id"],
domain_id=data["ibm_cis_domain"]["cis_domain"]["id"],
package_id="c504870194831cd12c3fc0284f294abb",
rule_id="100000356",
mode="on")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/ibm"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := ibm.NewCisWafRule(ctx, "test", &ibm.CisWafRuleArgs{
CisId: pulumi.Any(data.Ibm_cis.Cis.Id),
DomainId: pulumi.Any(data.Ibm_cis_domain.Cis_domain.Id),
PackageId: pulumi.String("c504870194831cd12c3fc0284f294abb"),
RuleId: pulumi.String("100000356"),
Mode: pulumi.String("on"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Ibm = Pulumi.Ibm;
return await Deployment.RunAsync(() =>
{
var test = new Ibm.CisWafRule("test", new()
{
CisId = data.Ibm_cis.Cis.Id,
DomainId = data.Ibm_cis_domain.Cis_domain.Id,
PackageId = "c504870194831cd12c3fc0284f294abb",
RuleId = "100000356",
Mode = "on",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ibm.CisWafRule;
import com.pulumi.ibm.CisWafRuleArgs;
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 test = new CisWafRule("test", CisWafRuleArgs.builder()
.cisId(data.ibm_cis().cis().id())
.domainId(data.ibm_cis_domain().cis_domain().id())
.packageId("c504870194831cd12c3fc0284f294abb")
.ruleId("100000356")
.mode("on")
.build());
}
}
resources:
test:
type: ibm:CisWafRule
properties:
cisId: ${data.ibm_cis.cis.id}
domainId: ${data.ibm_cis_domain.cis_domain.id}
packageId: c504870194831cd12c3fc0284f294abb
ruleId: '100000356'
mode: on
Create CisWafRule Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new CisWafRule(name: string, args: CisWafRuleArgs, opts?: CustomResourceOptions);
@overload
def CisWafRule(resource_name: str,
args: CisWafRuleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def CisWafRule(resource_name: str,
opts: Optional[ResourceOptions] = None,
cis_id: Optional[str] = None,
domain_id: Optional[str] = None,
mode: Optional[str] = None,
package_id: Optional[str] = None,
rule_id: Optional[str] = None,
cis_waf_rule_id: Optional[str] = None)
func NewCisWafRule(ctx *Context, name string, args CisWafRuleArgs, opts ...ResourceOption) (*CisWafRule, error)
public CisWafRule(string name, CisWafRuleArgs args, CustomResourceOptions? opts = null)
public CisWafRule(String name, CisWafRuleArgs args)
public CisWafRule(String name, CisWafRuleArgs args, CustomResourceOptions options)
type: ibm:CisWafRule
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 CisWafRuleArgs
- 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 CisWafRuleArgs
- 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 CisWafRuleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args CisWafRuleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args CisWafRuleArgs
- 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 cisWafRuleResource = new Ibm.CisWafRule("cisWafRuleResource", new()
{
CisId = "string",
DomainId = "string",
Mode = "string",
PackageId = "string",
RuleId = "string",
CisWafRuleId = "string",
});
example, err := ibm.NewCisWafRule(ctx, "cisWafRuleResource", &ibm.CisWafRuleArgs{
CisId: pulumi.String("string"),
DomainId: pulumi.String("string"),
Mode: pulumi.String("string"),
PackageId: pulumi.String("string"),
RuleId: pulumi.String("string"),
CisWafRuleId: pulumi.String("string"),
})
var cisWafRuleResource = new CisWafRule("cisWafRuleResource", CisWafRuleArgs.builder()
.cisId("string")
.domainId("string")
.mode("string")
.packageId("string")
.ruleId("string")
.cisWafRuleId("string")
.build());
cis_waf_rule_resource = ibm.CisWafRule("cisWafRuleResource",
cis_id="string",
domain_id="string",
mode="string",
package_id="string",
rule_id="string",
cis_waf_rule_id="string")
const cisWafRuleResource = new ibm.CisWafRule("cisWafRuleResource", {
cisId: "string",
domainId: "string",
mode: "string",
packageId: "string",
ruleId: "string",
cisWafRuleId: "string",
});
type: ibm:CisWafRule
properties:
cisId: string
cisWafRuleId: string
domainId: string
mode: string
packageId: string
ruleId: string
CisWafRule 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 CisWafRule resource accepts the following input properties:
- Cis
Id string - The ID of the IBM Cloud Internet Services instance.
- Domain
Id string - The ID of the domain where you want to change TLS settings.
- Mode string
- The mode to use when the rule is triggered. Value is restricted based on the allowed_modes of the rule. Valid values are
on
,off
,default
,disable
,simulate
,block
,challenge
. - Package
Id string - The WAF rule package ID. This cannot be modified.
- Rule
Id string - The WAF rule ID. The filed cannot be modified.
- Cis
Waf stringRule Id - (String) The WAF package ID. It is a combination of
<rule_id>,<package_id>,<domain_id>,<cis_id>
attributes concatenated with:
.
- Cis
Id string - The ID of the IBM Cloud Internet Services instance.
- Domain
Id string - The ID of the domain where you want to change TLS settings.
- Mode string
- The mode to use when the rule is triggered. Value is restricted based on the allowed_modes of the rule. Valid values are
on
,off
,default
,disable
,simulate
,block
,challenge
. - Package
Id string - The WAF rule package ID. This cannot be modified.
- Rule
Id string - The WAF rule ID. The filed cannot be modified.
- Cis
Waf stringRule Id - (String) The WAF package ID. It is a combination of
<rule_id>,<package_id>,<domain_id>,<cis_id>
attributes concatenated with:
.
- cis
Id String - The ID of the IBM Cloud Internet Services instance.
- domain
Id String - The ID of the domain where you want to change TLS settings.
- mode String
- The mode to use when the rule is triggered. Value is restricted based on the allowed_modes of the rule. Valid values are
on
,off
,default
,disable
,simulate
,block
,challenge
. - package
Id String - The WAF rule package ID. This cannot be modified.
- rule
Id String - The WAF rule ID. The filed cannot be modified.
- cis
Waf StringRule Id - (String) The WAF package ID. It is a combination of
<rule_id>,<package_id>,<domain_id>,<cis_id>
attributes concatenated with:
.
- cis
Id string - The ID of the IBM Cloud Internet Services instance.
- domain
Id string - The ID of the domain where you want to change TLS settings.
- mode string
- The mode to use when the rule is triggered. Value is restricted based on the allowed_modes of the rule. Valid values are
on
,off
,default
,disable
,simulate
,block
,challenge
. - package
Id string - The WAF rule package ID. This cannot be modified.
- rule
Id string - The WAF rule ID. The filed cannot be modified.
- cis
Waf stringRule Id - (String) The WAF package ID. It is a combination of
<rule_id>,<package_id>,<domain_id>,<cis_id>
attributes concatenated with:
.
- cis_
id str - The ID of the IBM Cloud Internet Services instance.
- domain_
id str - The ID of the domain where you want to change TLS settings.
- mode str
- The mode to use when the rule is triggered. Value is restricted based on the allowed_modes of the rule. Valid values are
on
,off
,default
,disable
,simulate
,block
,challenge
. - package_
id str - The WAF rule package ID. This cannot be modified.
- rule_
id str - The WAF rule ID. The filed cannot be modified.
- cis_
waf_ strrule_ id - (String) The WAF package ID. It is a combination of
<rule_id>,<package_id>,<domain_id>,<cis_id>
attributes concatenated with:
.
- cis
Id String - The ID of the IBM Cloud Internet Services instance.
- domain
Id String - The ID of the domain where you want to change TLS settings.
- mode String
- The mode to use when the rule is triggered. Value is restricted based on the allowed_modes of the rule. Valid values are
on
,off
,default
,disable
,simulate
,block
,challenge
. - package
Id String - The WAF rule package ID. This cannot be modified.
- rule
Id String - The WAF rule ID. The filed cannot be modified.
- cis
Waf StringRule Id - (String) The WAF package ID. It is a combination of
<rule_id>,<package_id>,<domain_id>,<cis_id>
attributes concatenated with:
.
Outputs
All input properties are implicitly available as output properties. Additionally, the CisWafRule resource produces the following output properties:
- Allowed
Modes string - (String) The allowed modes for setting the WAF rule mode.
- Description string
- (String) The WAF rule description.
- Groups
List<Cis
Waf Rule Group> - (String) The WAF rule group.
- Id string
- The provider-assigned unique ID for this managed resource.
- Priority double
- (String) The WAF rule priority.
- Allowed
Modes string - (String) The allowed modes for setting the WAF rule mode.
- Description string
- (String) The WAF rule description.
- Groups
[]Cis
Waf Rule Group - (String) The WAF rule group.
- Id string
- The provider-assigned unique ID for this managed resource.
- Priority float64
- (String) The WAF rule priority.
- allowed
Modes String - (String) The allowed modes for setting the WAF rule mode.
- description String
- (String) The WAF rule description.
- groups
List<Cis
Waf Rule Group> - (String) The WAF rule group.
- id String
- The provider-assigned unique ID for this managed resource.
- priority Double
- (String) The WAF rule priority.
- allowed
Modes string - (String) The allowed modes for setting the WAF rule mode.
- description string
- (String) The WAF rule description.
- groups
Cis
Waf Rule Group[] - (String) The WAF rule group.
- id string
- The provider-assigned unique ID for this managed resource.
- priority number
- (String) The WAF rule priority.
- allowed_
modes str - (String) The allowed modes for setting the WAF rule mode.
- description str
- (String) The WAF rule description.
- groups
Sequence[Cis
Waf Rule Group] - (String) The WAF rule group.
- id str
- The provider-assigned unique ID for this managed resource.
- priority float
- (String) The WAF rule priority.
- allowed
Modes String - (String) The allowed modes for setting the WAF rule mode.
- description String
- (String) The WAF rule description.
- groups List<Property Map>
- (String) The WAF rule group.
- id String
- The provider-assigned unique ID for this managed resource.
- priority Number
- (String) The WAF rule priority.
Look up Existing CisWafRule Resource
Get an existing CisWafRule 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?: CisWafRuleState, opts?: CustomResourceOptions): CisWafRule
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
allowed_modes: Optional[str] = None,
cis_id: Optional[str] = None,
cis_waf_rule_id: Optional[str] = None,
description: Optional[str] = None,
domain_id: Optional[str] = None,
groups: Optional[Sequence[CisWafRuleGroupArgs]] = None,
mode: Optional[str] = None,
package_id: Optional[str] = None,
priority: Optional[float] = None,
rule_id: Optional[str] = None) -> CisWafRule
func GetCisWafRule(ctx *Context, name string, id IDInput, state *CisWafRuleState, opts ...ResourceOption) (*CisWafRule, error)
public static CisWafRule Get(string name, Input<string> id, CisWafRuleState? state, CustomResourceOptions? opts = null)
public static CisWafRule get(String name, Output<String> id, CisWafRuleState state, CustomResourceOptions options)
resources: _: type: ibm:CisWafRule 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.
- Allowed
Modes string - (String) The allowed modes for setting the WAF rule mode.
- Cis
Id string - The ID of the IBM Cloud Internet Services instance.
- Cis
Waf stringRule Id - (String) The WAF package ID. It is a combination of
<rule_id>,<package_id>,<domain_id>,<cis_id>
attributes concatenated with:
. - Description string
- (String) The WAF rule description.
- Domain
Id string - The ID of the domain where you want to change TLS settings.
- Groups
List<Cis
Waf Rule Group> - (String) The WAF rule group.
- Mode string
- The mode to use when the rule is triggered. Value is restricted based on the allowed_modes of the rule. Valid values are
on
,off
,default
,disable
,simulate
,block
,challenge
. - Package
Id string - The WAF rule package ID. This cannot be modified.
- Priority double
- (String) The WAF rule priority.
- Rule
Id string - The WAF rule ID. The filed cannot be modified.
- Allowed
Modes string - (String) The allowed modes for setting the WAF rule mode.
- Cis
Id string - The ID of the IBM Cloud Internet Services instance.
- Cis
Waf stringRule Id - (String) The WAF package ID. It is a combination of
<rule_id>,<package_id>,<domain_id>,<cis_id>
attributes concatenated with:
. - Description string
- (String) The WAF rule description.
- Domain
Id string - The ID of the domain where you want to change TLS settings.
- Groups
[]Cis
Waf Rule Group Args - (String) The WAF rule group.
- Mode string
- The mode to use when the rule is triggered. Value is restricted based on the allowed_modes of the rule. Valid values are
on
,off
,default
,disable
,simulate
,block
,challenge
. - Package
Id string - The WAF rule package ID. This cannot be modified.
- Priority float64
- (String) The WAF rule priority.
- Rule
Id string - The WAF rule ID. The filed cannot be modified.
- allowed
Modes String - (String) The allowed modes for setting the WAF rule mode.
- cis
Id String - The ID of the IBM Cloud Internet Services instance.
- cis
Waf StringRule Id - (String) The WAF package ID. It is a combination of
<rule_id>,<package_id>,<domain_id>,<cis_id>
attributes concatenated with:
. - description String
- (String) The WAF rule description.
- domain
Id String - The ID of the domain where you want to change TLS settings.
- groups
List<Cis
Waf Rule Group> - (String) The WAF rule group.
- mode String
- The mode to use when the rule is triggered. Value is restricted based on the allowed_modes of the rule. Valid values are
on
,off
,default
,disable
,simulate
,block
,challenge
. - package
Id String - The WAF rule package ID. This cannot be modified.
- priority Double
- (String) The WAF rule priority.
- rule
Id String - The WAF rule ID. The filed cannot be modified.
- allowed
Modes string - (String) The allowed modes for setting the WAF rule mode.
- cis
Id string - The ID of the IBM Cloud Internet Services instance.
- cis
Waf stringRule Id - (String) The WAF package ID. It is a combination of
<rule_id>,<package_id>,<domain_id>,<cis_id>
attributes concatenated with:
. - description string
- (String) The WAF rule description.
- domain
Id string - The ID of the domain where you want to change TLS settings.
- groups
Cis
Waf Rule Group[] - (String) The WAF rule group.
- mode string
- The mode to use when the rule is triggered. Value is restricted based on the allowed_modes of the rule. Valid values are
on
,off
,default
,disable
,simulate
,block
,challenge
. - package
Id string - The WAF rule package ID. This cannot be modified.
- priority number
- (String) The WAF rule priority.
- rule
Id string - The WAF rule ID. The filed cannot be modified.
- allowed_
modes str - (String) The allowed modes for setting the WAF rule mode.
- cis_
id str - The ID of the IBM Cloud Internet Services instance.
- cis_
waf_ strrule_ id - (String) The WAF package ID. It is a combination of
<rule_id>,<package_id>,<domain_id>,<cis_id>
attributes concatenated with:
. - description str
- (String) The WAF rule description.
- domain_
id str - The ID of the domain where you want to change TLS settings.
- groups
Sequence[Cis
Waf Rule Group Args] - (String) The WAF rule group.
- mode str
- The mode to use when the rule is triggered. Value is restricted based on the allowed_modes of the rule. Valid values are
on
,off
,default
,disable
,simulate
,block
,challenge
. - package_
id str - The WAF rule package ID. This cannot be modified.
- priority float
- (String) The WAF rule priority.
- rule_
id str - The WAF rule ID. The filed cannot be modified.
- allowed
Modes String - (String) The allowed modes for setting the WAF rule mode.
- cis
Id String - The ID of the IBM Cloud Internet Services instance.
- cis
Waf StringRule Id - (String) The WAF package ID. It is a combination of
<rule_id>,<package_id>,<domain_id>,<cis_id>
attributes concatenated with:
. - description String
- (String) The WAF rule description.
- domain
Id String - The ID of the domain where you want to change TLS settings.
- groups List<Property Map>
- (String) The WAF rule group.
- mode String
- The mode to use when the rule is triggered. Value is restricted based on the allowed_modes of the rule. Valid values are
on
,off
,default
,disable
,simulate
,block
,challenge
. - package
Id String - The WAF rule package ID. This cannot be modified.
- priority Number
- (String) The WAF rule priority.
- rule
Id String - The WAF rule ID. The filed cannot be modified.
Supporting Types
CisWafRuleGroup, CisWafRuleGroupArgs
Import
The ibm_cis_waf_rule
resource can be imported by using the ID. The ID is formed from the rule_id, <package_id>, <domain ID>, <package ID>
of the domain and the CRN (Cloud Resource Name) Concatenated by using a :
character.
The domain ID and CRN will be located on the Overview page of the Internet Services instance of the domain heading of the console, or by using the ibmcloud cis
command line commands.
Rule ID is a digit character string of the form:
100000356
Package ID is a 32 digit character string of the form:
c504870194831cd12c3fc0284f294abb
Domain ID is a 32 digit character string of the form:
9caf68812ae9b3f0377fdf986751a78f
CRN is a 120 digit character string of the form:
crn:v1:bluemix:public:internet-svcs:global:a/4ea1882a2d3401ed1e459979941966ea:31fa970d-51d0-4b05-893e-251cba75a7b3::
Syntax
$ pulumi import ibm:index/cisWafRule:CisWafRule waf_rule <rule_id>:<package_id>:<domain-id>:<crn>
Example
$ pulumi import ibm:index/cisWafRule:CisWafRule waf_rule 100000356:c504870194831cd12c3fc0284f294abb:9caf68812ae9b3f0377fdf986751a78f:crn:v1:bluemix:public:internet-svcs:global:a/4ea1882a2d3401ed1e459979941966ea:31fa970d-51d0-4b05-893e-251cba75a7b3::
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- ibm ibm-cloud/terraform-provider-ibm
- License
- Notes
- This Pulumi package is based on the
ibm
Terraform Provider.