pulumi_wasm_providers_aws_mini::ec2

Module vpc_block_public_access_exclusion

source
Expand description

Resource for managing an AWS EC2 (Elastic Compute Cloud) VPC Block Public Access Exclusion.

§Example Usage

§Basic Usage

use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
    let test = vpc::create(
        "test",
        VpcArgs::builder().cidr_block("10.1.0.0/16").build_struct(),
    );
    let testVpcBlockPublicAccessExclusion = vpc_block_public_access_exclusion::create(
        "testVpcBlockPublicAccessExclusion",
        VpcBlockPublicAccessExclusionArgs::builder()
            .internet_gateway_exclusion_mode("allow-bidirectional")
            .vpc_id("${test.id}")
            .build_struct(),
    );
}

§Usage with subnet id

use pulumi_wasm_rust::Output;
use pulumi_wasm_rust::{add_export, pulumi_main};
#[pulumi_main]
fn test_main() -> Result<(), Error> {
    let test = vpc::create(
        "test",
        VpcArgs::builder().cidr_block("10.1.0.0/16").build_struct(),
    );
    let testSubnet = subnet::create(
        "testSubnet",
        SubnetArgs::builder()
            .cidr_block("10.1.1.0/24")
            .vpc_id("${test.id}")
            .build_struct(),
    );
    let testVpcBlockPublicAccessExclusion = vpc_block_public_access_exclusion::create(
        "testVpcBlockPublicAccessExclusion",
        VpcBlockPublicAccessExclusionArgs::builder()
            .internet_gateway_exclusion_mode("allow-egress")
            .subnet_id("${testSubnet.id}")
            .build_struct(),
    );
}

§Import

Using pulumi import, import EC2 (Elastic Compute Cloud) VPC Block Public Access Exclusion using the id. For example:

$ pulumi import aws:ec2/vpcBlockPublicAccessExclusion:VpcBlockPublicAccessExclusion example vpcbpa-exclude-1234abcd

Structs§

Functions§

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