Expand description
A rule for the OrganizationSecurityPolicy.
To get more information about OrganizationSecurityPolicyRule, see:
- API documentation
- How-to Guides
§Example Usage
§Organization Security Policy Rule Basic
ⓘ
use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
let policy = organization_security_policy::create(
"policy",
OrganizationSecurityPolicyArgs::builder()
.display_name("tf-test")
.parent("organizations/123456789")
.build_struct(),
);
let policyOrganizationSecurityPolicyRule = organization_security_policy_rule::create(
"policyOrganizationSecurityPolicyRule",
OrganizationSecurityPolicyRuleArgs::builder()
.action("allow")
.direction("INGRESS")
.enable_logging(true)
.match_(
OrganizationSecurityPolicyRuleMatch::builder()
.config(
OrganizationSecurityPolicyRuleMatchConfig::builder()
.layer4Configs(
vec![
OrganizationSecurityPolicyRuleMatchConfigLayer4Config::builder()
.ipProtocol("tcp").ports(vec!["22",]).build_struct(),
OrganizationSecurityPolicyRuleMatchConfigLayer4Config::builder()
.ipProtocol("icmp").build_struct(),
],
)
.srcIpRanges(vec!["192.168.0.0/16", "10.0.0.0/8",])
.build_struct(),
)
.build_struct(),
)
.policy_id("${policy.id}")
.priority(100)
.build_struct(),
);
}
§Import
OrganizationSecurityPolicyRule can be imported using any of these accepted formats:
{{policy_id}}/priority/{{priority}}
When using the pulumi import
command, OrganizationSecurityPolicyRule can be imported using one of the formats above. For example:
$ pulumi import gcp:compute/organizationSecurityPolicyRule:OrganizationSecurityPolicyRule default {{policy_id}}/priority/{{priority}}
Structs§
- Use builder syntax to set the inputs and finish with
build_struct()
.
Functions§
- Registers a new resource with the given unique name and arguments