1. Packages
  2. AWS Classic
  3. API Docs
  4. ec2
  5. NetworkAclAssociation

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.2.1 published on Friday, Sep 22, 2023 by Pulumi

aws.ec2.NetworkAclAssociation

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.2.1 published on Friday, Sep 22, 2023 by Pulumi

    Provides an network ACL association resource which allows you to associate your network ACL with any subnet(s).

    NOTE on Network ACLs and Network ACL Associations: the provider provides both a standalone network ACL association resource and a network ACL resource with a subnet_ids attribute. Do not use the same subnet ID in both a network ACL resource and a network ACL association resource. Doing so will cause a conflict of associations and will overwrite the association.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var main = new Aws.Ec2.NetworkAclAssociation("main", new()
        {
            NetworkAclId = aws_network_acl.Main.Id,
            SubnetId = aws_subnet.Main.Id,
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/ec2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ec2.NewNetworkAclAssociation(ctx, "main", &ec2.NetworkAclAssociationArgs{
    			NetworkAclId: pulumi.Any(aws_network_acl.Main.Id),
    			SubnetId:     pulumi.Any(aws_subnet.Main.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.ec2.NetworkAclAssociation;
    import com.pulumi.aws.ec2.NetworkAclAssociationArgs;
    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 main = new NetworkAclAssociation("main", NetworkAclAssociationArgs.builder()        
                .networkAclId(aws_network_acl.main().id())
                .subnetId(aws_subnet.main().id())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    main = aws.ec2.NetworkAclAssociation("main",
        network_acl_id=aws_network_acl["main"]["id"],
        subnet_id=aws_subnet["main"]["id"])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const main = new aws.ec2.NetworkAclAssociation("main", {
        networkAclId: aws_network_acl.main.id,
        subnetId: aws_subnet.main.id,
    });
    
    resources:
      main:
        type: aws:ec2:NetworkAclAssociation
        properties:
          networkAclId: ${aws_network_acl.main.id}
          subnetId: ${aws_subnet.main.id}
    

    Create NetworkAclAssociation Resource

    new NetworkAclAssociation(name: string, args: NetworkAclAssociationArgs, opts?: CustomResourceOptions);
    @overload
    def NetworkAclAssociation(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              network_acl_id: Optional[str] = None,
                              subnet_id: Optional[str] = None)
    @overload
    def NetworkAclAssociation(resource_name: str,
                              args: NetworkAclAssociationArgs,
                              opts: Optional[ResourceOptions] = None)
    func NewNetworkAclAssociation(ctx *Context, name string, args NetworkAclAssociationArgs, opts ...ResourceOption) (*NetworkAclAssociation, error)
    public NetworkAclAssociation(string name, NetworkAclAssociationArgs args, CustomResourceOptions? opts = null)
    public NetworkAclAssociation(String name, NetworkAclAssociationArgs args)
    public NetworkAclAssociation(String name, NetworkAclAssociationArgs args, CustomResourceOptions options)
    
    type: aws:ec2:NetworkAclAssociation
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args NetworkAclAssociationArgs
    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 NetworkAclAssociationArgs
    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 NetworkAclAssociationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args NetworkAclAssociationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args NetworkAclAssociationArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    NetworkAclAssociation Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    The NetworkAclAssociation resource accepts the following input properties:

    NetworkAclId string

    The ID of the network ACL.

    SubnetId string

    The ID of the associated Subnet.

    NetworkAclId string

    The ID of the network ACL.

    SubnetId string

    The ID of the associated Subnet.

    networkAclId String

    The ID of the network ACL.

    subnetId String

    The ID of the associated Subnet.

    networkAclId string

    The ID of the network ACL.

    subnetId string

    The ID of the associated Subnet.

    network_acl_id str

    The ID of the network ACL.

    subnet_id str

    The ID of the associated Subnet.

    networkAclId String

    The ID of the network ACL.

    subnetId String

    The ID of the associated Subnet.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the NetworkAclAssociation 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 NetworkAclAssociation Resource

    Get an existing NetworkAclAssociation 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?: NetworkAclAssociationState, opts?: CustomResourceOptions): NetworkAclAssociation
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            network_acl_id: Optional[str] = None,
            subnet_id: Optional[str] = None) -> NetworkAclAssociation
    func GetNetworkAclAssociation(ctx *Context, name string, id IDInput, state *NetworkAclAssociationState, opts ...ResourceOption) (*NetworkAclAssociation, error)
    public static NetworkAclAssociation Get(string name, Input<string> id, NetworkAclAssociationState? state, CustomResourceOptions? opts = null)
    public static NetworkAclAssociation get(String name, Output<String> id, NetworkAclAssociationState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    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.
    The following state arguments are supported:
    NetworkAclId string

    The ID of the network ACL.

    SubnetId string

    The ID of the associated Subnet.

    NetworkAclId string

    The ID of the network ACL.

    SubnetId string

    The ID of the associated Subnet.

    networkAclId String

    The ID of the network ACL.

    subnetId String

    The ID of the associated Subnet.

    networkAclId string

    The ID of the network ACL.

    subnetId string

    The ID of the associated Subnet.

    network_acl_id str

    The ID of the network ACL.

    subnet_id str

    The ID of the associated Subnet.

    networkAclId String

    The ID of the network ACL.

    subnetId String

    The ID of the associated Subnet.

    Package Details

    Repository
    AWS Classic pulumi/pulumi-aws
    License
    Apache-2.0
    Notes

    This Pulumi package is based on the aws Terraform Provider.

    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.2.1 published on Friday, Sep 22, 2023 by Pulumi