pulumi_wasm_providers_aws_mini::ec2

Module network_acl_rule

source
Expand description

Creates an entry (a rule) in a network ACL with the specified rule number.

NOTE on Network ACLs and Network ACL Rules: This provider currently provides both a standalone Network ACL Rule resource and a Network ACL resource with rules defined in-line. At this time you cannot use a Network ACL with in-line rules in conjunction with any Network ACL Rule resources. Doing so will cause a conflict of rule settings and will overwrite rules.

§Example Usage

use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
    let bar = network_acl::create(
        "bar",
        NetworkAclArgs::builder().vpc_id("${foo.id}").build_struct(),
    );
    let barNetworkAclRule = network_acl_rule::create(
        "barNetworkAclRule",
        NetworkAclRuleArgs::builder()
            .cidr_block("${foo.cidrBlock}")
            .egress(false)
            .from_port(22)
            .network_acl_id("${bar.id}")
            .protocol("tcp")
            .rule_action("allow")
            .rule_number(200)
            .to_port(22)
            .build_struct(),
    );
}

Note: One of either cidr_block or ipv6_cidr_block is required.

§Import

Using the procotol’s decimal value:

Using pulumi import to import individual rules using NETWORK_ACL_ID:RULE_NUMBER:PROTOCOL:EGRESS, where PROTOCOL can be a decimal (such as “6”) or string (such as “tcp”) value. For example:

Using the procotol’s string value:

$ pulumi import aws:ec2/networkAclRule:NetworkAclRule my_rule acl-7aaabd18:100:tcp:false

Using the procotol’s decimal value:

$ pulumi import aws:ec2/networkAclRule:NetworkAclRule my_rule acl-7aaabd18:100:6:false

Structs§

Functions§

  • Registers a new resource with the given unique name and arguments