1. Packages
  2. AWS
  3. API Docs
  4. ec2
  5. SecondarySubnet
AWS v7.20.0 published on Thursday, Feb 19, 2026 by Pulumi
aws logo
AWS v7.20.0 published on Thursday, Feb 19, 2026 by Pulumi

    Provides an EC2 Secondary Subnet resource.

    A secondary subnet is a subnet within a secondary network that provides high-performance networking capabilities for specialized workloads such as RDMA (Remote Direct Memory Access) applications.

    Example Usage

    Basic Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.ec2.SecondaryNetwork("example", {
        ipv4CidrBlock: "10.0.0.0/16",
        networkType: "rdma",
        tags: {
            Name: "example-secondary-network",
        },
    });
    const exampleSecondarySubnet = new aws.ec2.SecondarySubnet("example", {
        secondaryNetworkId: example.id,
        ipv4CidrBlock: "10.0.1.0/24",
        availabilityZone: "us-west-2a",
        tags: {
            Name: "example-secondary-subnet",
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ec2.SecondaryNetwork("example",
        ipv4_cidr_block="10.0.0.0/16",
        network_type="rdma",
        tags={
            "Name": "example-secondary-network",
        })
    example_secondary_subnet = aws.ec2.SecondarySubnet("example",
        secondary_network_id=example.id,
        ipv4_cidr_block="10.0.1.0/24",
        availability_zone="us-west-2a",
        tags={
            "Name": "example-secondary-subnet",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/ec2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := ec2.NewSecondaryNetwork(ctx, "example", &ec2.SecondaryNetworkArgs{
    			Ipv4CidrBlock: pulumi.String("10.0.0.0/16"),
    			NetworkType:   pulumi.String("rdma"),
    			Tags: pulumi.StringMap{
    				"Name": pulumi.String("example-secondary-network"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ec2.NewSecondarySubnet(ctx, "example", &ec2.SecondarySubnetArgs{
    			SecondaryNetworkId: example.ID(),
    			Ipv4CidrBlock:      pulumi.String("10.0.1.0/24"),
    			AvailabilityZone:   pulumi.String("us-west-2a"),
    			Tags: pulumi.StringMap{
    				"Name": pulumi.String("example-secondary-subnet"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.Ec2.SecondaryNetwork("example", new()
        {
            Ipv4CidrBlock = "10.0.0.0/16",
            NetworkType = "rdma",
            Tags = 
            {
                { "Name", "example-secondary-network" },
            },
        });
    
        var exampleSecondarySubnet = new Aws.Ec2.SecondarySubnet("example", new()
        {
            SecondaryNetworkId = example.Id,
            Ipv4CidrBlock = "10.0.1.0/24",
            AvailabilityZone = "us-west-2a",
            Tags = 
            {
                { "Name", "example-secondary-subnet" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.ec2.SecondaryNetwork;
    import com.pulumi.aws.ec2.SecondaryNetworkArgs;
    import com.pulumi.aws.ec2.SecondarySubnet;
    import com.pulumi.aws.ec2.SecondarySubnetArgs;
    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 example = new SecondaryNetwork("example", SecondaryNetworkArgs.builder()
                .ipv4CidrBlock("10.0.0.0/16")
                .networkType("rdma")
                .tags(Map.of("Name", "example-secondary-network"))
                .build());
    
            var exampleSecondarySubnet = new SecondarySubnet("exampleSecondarySubnet", SecondarySubnetArgs.builder()
                .secondaryNetworkId(example.id())
                .ipv4CidrBlock("10.0.1.0/24")
                .availabilityZone("us-west-2a")
                .tags(Map.of("Name", "example-secondary-subnet"))
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:ec2:SecondaryNetwork
        properties:
          ipv4CidrBlock: 10.0.0.0/16
          networkType: rdma
          tags:
            Name: example-secondary-network
      exampleSecondarySubnet:
        type: aws:ec2:SecondarySubnet
        name: example
        properties:
          secondaryNetworkId: ${example.id}
          ipv4CidrBlock: 10.0.1.0/24
          availabilityZone: us-west-2a
          tags:
            Name: example-secondary-subnet
    

    Using Availability Zone ID

    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const available = aws.getAvailabilityZones({
        state: "available",
        filters: [{
            name: "opt-in-status",
            values: ["opt-in-not-required"],
        }],
    });
    const example = new aws.ec2.SecondaryNetwork("example", {
        ipv4CidrBlock: "10.0.0.0/16",
        networkType: "rdma",
        tags: {
            Name: "example-secondary-network",
        },
    });
    const exampleSecondarySubnet = new aws.ec2.SecondarySubnet("example", {
        secondaryNetworkId: example.id,
        ipv4CidrBlock: "10.0.1.0/24",
        availabilityZoneId: available.then(available => available.zoneIds?.[0]),
        tags: {
            Name: "example-secondary-subnet",
        },
    });
    
    import pulumi
    import pulumi_aws as aws
    
    available = aws.get_availability_zones(state="available",
        filters=[{
            "name": "opt-in-status",
            "values": ["opt-in-not-required"],
        }])
    example = aws.ec2.SecondaryNetwork("example",
        ipv4_cidr_block="10.0.0.0/16",
        network_type="rdma",
        tags={
            "Name": "example-secondary-network",
        })
    example_secondary_subnet = aws.ec2.SecondarySubnet("example",
        secondary_network_id=example.id,
        ipv4_cidr_block="10.0.1.0/24",
        availability_zone_id=available.zone_ids[0],
        tags={
            "Name": "example-secondary-subnet",
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws"
    	"github.com/pulumi/pulumi-aws/sdk/v7/go/aws/ec2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		available, err := aws.GetAvailabilityZones(ctx, &aws.GetAvailabilityZonesArgs{
    			State: pulumi.StringRef("available"),
    			Filters: []aws.GetAvailabilityZonesFilter{
    				{
    					Name: "opt-in-status",
    					Values: []string{
    						"opt-in-not-required",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		example, err := ec2.NewSecondaryNetwork(ctx, "example", &ec2.SecondaryNetworkArgs{
    			Ipv4CidrBlock: pulumi.String("10.0.0.0/16"),
    			NetworkType:   pulumi.String("rdma"),
    			Tags: pulumi.StringMap{
    				"Name": pulumi.String("example-secondary-network"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		_, err = ec2.NewSecondarySubnet(ctx, "example", &ec2.SecondarySubnetArgs{
    			SecondaryNetworkId: example.ID(),
    			Ipv4CidrBlock:      pulumi.String("10.0.1.0/24"),
    			AvailabilityZoneId: pulumi.String(available.ZoneIds[0]),
    			Tags: pulumi.StringMap{
    				"Name": pulumi.String("example-secondary-subnet"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var available = Aws.GetAvailabilityZones.Invoke(new()
        {
            State = "available",
            Filters = new[]
            {
                new Aws.Inputs.GetAvailabilityZonesFilterInputArgs
                {
                    Name = "opt-in-status",
                    Values = new[]
                    {
                        "opt-in-not-required",
                    },
                },
            },
        });
    
        var example = new Aws.Ec2.SecondaryNetwork("example", new()
        {
            Ipv4CidrBlock = "10.0.0.0/16",
            NetworkType = "rdma",
            Tags = 
            {
                { "Name", "example-secondary-network" },
            },
        });
    
        var exampleSecondarySubnet = new Aws.Ec2.SecondarySubnet("example", new()
        {
            SecondaryNetworkId = example.Id,
            Ipv4CidrBlock = "10.0.1.0/24",
            AvailabilityZoneId = available.Apply(getAvailabilityZonesResult => getAvailabilityZonesResult.ZoneIds[0]),
            Tags = 
            {
                { "Name", "example-secondary-subnet" },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.aws.AwsFunctions;
    import com.pulumi.aws.inputs.GetAvailabilityZonesArgs;
    import com.pulumi.aws.ec2.SecondaryNetwork;
    import com.pulumi.aws.ec2.SecondaryNetworkArgs;
    import com.pulumi.aws.ec2.SecondarySubnet;
    import com.pulumi.aws.ec2.SecondarySubnetArgs;
    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) {
            final var available = AwsFunctions.getAvailabilityZones(GetAvailabilityZonesArgs.builder()
                .state("available")
                .filters(GetAvailabilityZonesFilterArgs.builder()
                    .name("opt-in-status")
                    .values("opt-in-not-required")
                    .build())
                .build());
    
            var example = new SecondaryNetwork("example", SecondaryNetworkArgs.builder()
                .ipv4CidrBlock("10.0.0.0/16")
                .networkType("rdma")
                .tags(Map.of("Name", "example-secondary-network"))
                .build());
    
            var exampleSecondarySubnet = new SecondarySubnet("exampleSecondarySubnet", SecondarySubnetArgs.builder()
                .secondaryNetworkId(example.id())
                .ipv4CidrBlock("10.0.1.0/24")
                .availabilityZoneId(available.zoneIds()[0])
                .tags(Map.of("Name", "example-secondary-subnet"))
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:ec2:SecondaryNetwork
        properties:
          ipv4CidrBlock: 10.0.0.0/16
          networkType: rdma
          tags:
            Name: example-secondary-network
      exampleSecondarySubnet:
        type: aws:ec2:SecondarySubnet
        name: example
        properties:
          secondaryNetworkId: ${example.id}
          ipv4CidrBlock: 10.0.1.0/24
          availabilityZoneId: ${available.zoneIds[0]}
          tags:
            Name: example-secondary-subnet
    variables:
      available:
        fn::invoke:
          function: aws:getAvailabilityZones
          arguments:
            state: available
            filters:
              - name: opt-in-status
                values:
                  - opt-in-not-required
    

    Create SecondarySubnet Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new SecondarySubnet(name: string, args: SecondarySubnetArgs, opts?: CustomResourceOptions);
    @overload
    def SecondarySubnet(resource_name: str,
                        args: SecondarySubnetArgs,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def SecondarySubnet(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        ipv4_cidr_block: Optional[str] = None,
                        secondary_network_id: Optional[str] = None,
                        availability_zone: Optional[str] = None,
                        availability_zone_id: Optional[str] = None,
                        region: Optional[str] = None,
                        tags: Optional[Mapping[str, str]] = None,
                        timeouts: Optional[SecondarySubnetTimeoutsArgs] = None)
    func NewSecondarySubnet(ctx *Context, name string, args SecondarySubnetArgs, opts ...ResourceOption) (*SecondarySubnet, error)
    public SecondarySubnet(string name, SecondarySubnetArgs args, CustomResourceOptions? opts = null)
    public SecondarySubnet(String name, SecondarySubnetArgs args)
    public SecondarySubnet(String name, SecondarySubnetArgs args, CustomResourceOptions options)
    
    type: aws:ec2:SecondarySubnet
    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 SecondarySubnetArgs
    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 SecondarySubnetArgs
    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 SecondarySubnetArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SecondarySubnetArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SecondarySubnetArgs
    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 secondarySubnetResource = new Aws.Ec2.SecondarySubnet("secondarySubnetResource", new()
    {
        Ipv4CidrBlock = "string",
        SecondaryNetworkId = "string",
        AvailabilityZone = "string",
        AvailabilityZoneId = "string",
        Region = "string",
        Tags = 
        {
            { "string", "string" },
        },
        Timeouts = new Aws.Ec2.Inputs.SecondarySubnetTimeoutsArgs
        {
            Create = "string",
            Delete = "string",
            Update = "string",
        },
    });
    
    example, err := ec2.NewSecondarySubnet(ctx, "secondarySubnetResource", &ec2.SecondarySubnetArgs{
    	Ipv4CidrBlock:      pulumi.String("string"),
    	SecondaryNetworkId: pulumi.String("string"),
    	AvailabilityZone:   pulumi.String("string"),
    	AvailabilityZoneId: pulumi.String("string"),
    	Region:             pulumi.String("string"),
    	Tags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Timeouts: &ec2.SecondarySubnetTimeoutsArgs{
    		Create: pulumi.String("string"),
    		Delete: pulumi.String("string"),
    		Update: pulumi.String("string"),
    	},
    })
    
    var secondarySubnetResource = new SecondarySubnet("secondarySubnetResource", SecondarySubnetArgs.builder()
        .ipv4CidrBlock("string")
        .secondaryNetworkId("string")
        .availabilityZone("string")
        .availabilityZoneId("string")
        .region("string")
        .tags(Map.of("string", "string"))
        .timeouts(SecondarySubnetTimeoutsArgs.builder()
            .create("string")
            .delete("string")
            .update("string")
            .build())
        .build());
    
    secondary_subnet_resource = aws.ec2.SecondarySubnet("secondarySubnetResource",
        ipv4_cidr_block="string",
        secondary_network_id="string",
        availability_zone="string",
        availability_zone_id="string",
        region="string",
        tags={
            "string": "string",
        },
        timeouts={
            "create": "string",
            "delete": "string",
            "update": "string",
        })
    
    const secondarySubnetResource = new aws.ec2.SecondarySubnet("secondarySubnetResource", {
        ipv4CidrBlock: "string",
        secondaryNetworkId: "string",
        availabilityZone: "string",
        availabilityZoneId: "string",
        region: "string",
        tags: {
            string: "string",
        },
        timeouts: {
            create: "string",
            "delete": "string",
            update: "string",
        },
    });
    
    type: aws:ec2:SecondarySubnet
    properties:
        availabilityZone: string
        availabilityZoneId: string
        ipv4CidrBlock: string
        region: string
        secondaryNetworkId: string
        tags:
            string: string
        timeouts:
            create: string
            delete: string
            update: string
    

    SecondarySubnet 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 SecondarySubnet resource accepts the following input properties:

    Ipv4CidrBlock string
    IPv4 CIDR block for the secondary subnet. The CIDR block size must be between /12 and /28.
    SecondaryNetworkId string
    ID of the secondary network in which to create the secondary subnet.
    AvailabilityZone string
    Availability Zone for the secondary subnet. Cannot be specified with availability_zone_id.
    AvailabilityZoneId string
    ID of the Availability Zone for the secondary subnet. This option is preferred over availability_zone as it provides a consistent identifier across AWS accounts. Cannot be specified with availability_zone.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    Tags Dictionary<string, string>
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    Timeouts SecondarySubnetTimeouts
    Ipv4CidrBlock string
    IPv4 CIDR block for the secondary subnet. The CIDR block size must be between /12 and /28.
    SecondaryNetworkId string
    ID of the secondary network in which to create the secondary subnet.
    AvailabilityZone string
    Availability Zone for the secondary subnet. Cannot be specified with availability_zone_id.
    AvailabilityZoneId string
    ID of the Availability Zone for the secondary subnet. This option is preferred over availability_zone as it provides a consistent identifier across AWS accounts. Cannot be specified with availability_zone.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    Tags map[string]string
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    Timeouts SecondarySubnetTimeoutsArgs
    ipv4CidrBlock String
    IPv4 CIDR block for the secondary subnet. The CIDR block size must be between /12 and /28.
    secondaryNetworkId String
    ID of the secondary network in which to create the secondary subnet.
    availabilityZone String
    Availability Zone for the secondary subnet. Cannot be specified with availability_zone_id.
    availabilityZoneId String
    ID of the Availability Zone for the secondary subnet. This option is preferred over availability_zone as it provides a consistent identifier across AWS accounts. Cannot be specified with availability_zone.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags Map<String,String>
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    timeouts SecondarySubnetTimeouts
    ipv4CidrBlock string
    IPv4 CIDR block for the secondary subnet. The CIDR block size must be between /12 and /28.
    secondaryNetworkId string
    ID of the secondary network in which to create the secondary subnet.
    availabilityZone string
    Availability Zone for the secondary subnet. Cannot be specified with availability_zone_id.
    availabilityZoneId string
    ID of the Availability Zone for the secondary subnet. This option is preferred over availability_zone as it provides a consistent identifier across AWS accounts. Cannot be specified with availability_zone.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags {[key: string]: string}
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    timeouts SecondarySubnetTimeouts
    ipv4_cidr_block str
    IPv4 CIDR block for the secondary subnet. The CIDR block size must be between /12 and /28.
    secondary_network_id str
    ID of the secondary network in which to create the secondary subnet.
    availability_zone str
    Availability Zone for the secondary subnet. Cannot be specified with availability_zone_id.
    availability_zone_id str
    ID of the Availability Zone for the secondary subnet. This option is preferred over availability_zone as it provides a consistent identifier across AWS accounts. Cannot be specified with availability_zone.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags Mapping[str, str]
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    timeouts SecondarySubnetTimeoutsArgs
    ipv4CidrBlock String
    IPv4 CIDR block for the secondary subnet. The CIDR block size must be between /12 and /28.
    secondaryNetworkId String
    ID of the secondary network in which to create the secondary subnet.
    availabilityZone String
    Availability Zone for the secondary subnet. Cannot be specified with availability_zone_id.
    availabilityZoneId String
    ID of the Availability Zone for the secondary subnet. This option is preferred over availability_zone as it provides a consistent identifier across AWS accounts. Cannot be specified with availability_zone.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    tags Map<String>
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    timeouts Property Map

    Outputs

    All input properties are implicitly available as output properties. Additionally, the SecondarySubnet resource produces the following output properties:

    Arn string
    ARN of the secondary subnet.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ipv4CidrBlockAssociations List<SecondarySubnetIpv4CidrBlockAssociation>
    A list of IPv4 CIDR block associations for the secondary network.
    OwnerId string
    ID of the AWS account that owns the secondary subnet.
    SecondaryNetworkType string
    Type of the secondary network (e.g., rdma).
    SecondarySubnetId string
    ID of the secondary subnet.
    State string
    State of the IPv4 CIDR block association.
    TagsAll Dictionary<string, string>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    Arn string
    ARN of the secondary subnet.
    Id string
    The provider-assigned unique ID for this managed resource.
    Ipv4CidrBlockAssociations []SecondarySubnetIpv4CidrBlockAssociation
    A list of IPv4 CIDR block associations for the secondary network.
    OwnerId string
    ID of the AWS account that owns the secondary subnet.
    SecondaryNetworkType string
    Type of the secondary network (e.g., rdma).
    SecondarySubnetId string
    ID of the secondary subnet.
    State string
    State of the IPv4 CIDR block association.
    TagsAll map[string]string
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    arn String
    ARN of the secondary subnet.
    id String
    The provider-assigned unique ID for this managed resource.
    ipv4CidrBlockAssociations List<SecondarySubnetIpv4CidrBlockAssociation>
    A list of IPv4 CIDR block associations for the secondary network.
    ownerId String
    ID of the AWS account that owns the secondary subnet.
    secondaryNetworkType String
    Type of the secondary network (e.g., rdma).
    secondarySubnetId String
    ID of the secondary subnet.
    state String
    State of the IPv4 CIDR block association.
    tagsAll Map<String,String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    arn string
    ARN of the secondary subnet.
    id string
    The provider-assigned unique ID for this managed resource.
    ipv4CidrBlockAssociations SecondarySubnetIpv4CidrBlockAssociation[]
    A list of IPv4 CIDR block associations for the secondary network.
    ownerId string
    ID of the AWS account that owns the secondary subnet.
    secondaryNetworkType string
    Type of the secondary network (e.g., rdma).
    secondarySubnetId string
    ID of the secondary subnet.
    state string
    State of the IPv4 CIDR block association.
    tagsAll {[key: string]: string}
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    arn str
    ARN of the secondary subnet.
    id str
    The provider-assigned unique ID for this managed resource.
    ipv4_cidr_block_associations Sequence[SecondarySubnetIpv4CidrBlockAssociation]
    A list of IPv4 CIDR block associations for the secondary network.
    owner_id str
    ID of the AWS account that owns the secondary subnet.
    secondary_network_type str
    Type of the secondary network (e.g., rdma).
    secondary_subnet_id str
    ID of the secondary subnet.
    state str
    State of the IPv4 CIDR block association.
    tags_all Mapping[str, str]
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    arn String
    ARN of the secondary subnet.
    id String
    The provider-assigned unique ID for this managed resource.
    ipv4CidrBlockAssociations List<Property Map>
    A list of IPv4 CIDR block associations for the secondary network.
    ownerId String
    ID of the AWS account that owns the secondary subnet.
    secondaryNetworkType String
    Type of the secondary network (e.g., rdma).
    secondarySubnetId String
    ID of the secondary subnet.
    state String
    State of the IPv4 CIDR block association.
    tagsAll Map<String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

    Look up Existing SecondarySubnet Resource

    Get an existing SecondarySubnet 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?: SecondarySubnetState, opts?: CustomResourceOptions): SecondarySubnet
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            arn: Optional[str] = None,
            availability_zone: Optional[str] = None,
            availability_zone_id: Optional[str] = None,
            ipv4_cidr_block: Optional[str] = None,
            ipv4_cidr_block_associations: Optional[Sequence[SecondarySubnetIpv4CidrBlockAssociationArgs]] = None,
            owner_id: Optional[str] = None,
            region: Optional[str] = None,
            secondary_network_id: Optional[str] = None,
            secondary_network_type: Optional[str] = None,
            secondary_subnet_id: Optional[str] = None,
            state: Optional[str] = None,
            tags: Optional[Mapping[str, str]] = None,
            tags_all: Optional[Mapping[str, str]] = None,
            timeouts: Optional[SecondarySubnetTimeoutsArgs] = None) -> SecondarySubnet
    func GetSecondarySubnet(ctx *Context, name string, id IDInput, state *SecondarySubnetState, opts ...ResourceOption) (*SecondarySubnet, error)
    public static SecondarySubnet Get(string name, Input<string> id, SecondarySubnetState? state, CustomResourceOptions? opts = null)
    public static SecondarySubnet get(String name, Output<String> id, SecondarySubnetState state, CustomResourceOptions options)
    resources:  _:    type: aws:ec2:SecondarySubnet    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.
    The following state arguments are supported:
    Arn string
    ARN of the secondary subnet.
    AvailabilityZone string
    Availability Zone for the secondary subnet. Cannot be specified with availability_zone_id.
    AvailabilityZoneId string
    ID of the Availability Zone for the secondary subnet. This option is preferred over availability_zone as it provides a consistent identifier across AWS accounts. Cannot be specified with availability_zone.
    Ipv4CidrBlock string
    IPv4 CIDR block for the secondary subnet. The CIDR block size must be between /12 and /28.
    Ipv4CidrBlockAssociations List<SecondarySubnetIpv4CidrBlockAssociation>
    A list of IPv4 CIDR block associations for the secondary network.
    OwnerId string
    ID of the AWS account that owns the secondary subnet.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    SecondaryNetworkId string
    ID of the secondary network in which to create the secondary subnet.
    SecondaryNetworkType string
    Type of the secondary network (e.g., rdma).
    SecondarySubnetId string
    ID of the secondary subnet.
    State string
    State of the IPv4 CIDR block association.
    Tags Dictionary<string, string>
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll Dictionary<string, string>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    Timeouts SecondarySubnetTimeouts
    Arn string
    ARN of the secondary subnet.
    AvailabilityZone string
    Availability Zone for the secondary subnet. Cannot be specified with availability_zone_id.
    AvailabilityZoneId string
    ID of the Availability Zone for the secondary subnet. This option is preferred over availability_zone as it provides a consistent identifier across AWS accounts. Cannot be specified with availability_zone.
    Ipv4CidrBlock string
    IPv4 CIDR block for the secondary subnet. The CIDR block size must be between /12 and /28.
    Ipv4CidrBlockAssociations []SecondarySubnetIpv4CidrBlockAssociationArgs
    A list of IPv4 CIDR block associations for the secondary network.
    OwnerId string
    ID of the AWS account that owns the secondary subnet.
    Region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    SecondaryNetworkId string
    ID of the secondary network in which to create the secondary subnet.
    SecondaryNetworkType string
    Type of the secondary network (e.g., rdma).
    SecondarySubnetId string
    ID of the secondary subnet.
    State string
    State of the IPv4 CIDR block association.
    Tags map[string]string
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    TagsAll map[string]string
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    Timeouts SecondarySubnetTimeoutsArgs
    arn String
    ARN of the secondary subnet.
    availabilityZone String
    Availability Zone for the secondary subnet. Cannot be specified with availability_zone_id.
    availabilityZoneId String
    ID of the Availability Zone for the secondary subnet. This option is preferred over availability_zone as it provides a consistent identifier across AWS accounts. Cannot be specified with availability_zone.
    ipv4CidrBlock String
    IPv4 CIDR block for the secondary subnet. The CIDR block size must be between /12 and /28.
    ipv4CidrBlockAssociations List<SecondarySubnetIpv4CidrBlockAssociation>
    A list of IPv4 CIDR block associations for the secondary network.
    ownerId String
    ID of the AWS account that owns the secondary subnet.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    secondaryNetworkId String
    ID of the secondary network in which to create the secondary subnet.
    secondaryNetworkType String
    Type of the secondary network (e.g., rdma).
    secondarySubnetId String
    ID of the secondary subnet.
    state String
    State of the IPv4 CIDR block association.
    tags Map<String,String>
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String,String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    timeouts SecondarySubnetTimeouts
    arn string
    ARN of the secondary subnet.
    availabilityZone string
    Availability Zone for the secondary subnet. Cannot be specified with availability_zone_id.
    availabilityZoneId string
    ID of the Availability Zone for the secondary subnet. This option is preferred over availability_zone as it provides a consistent identifier across AWS accounts. Cannot be specified with availability_zone.
    ipv4CidrBlock string
    IPv4 CIDR block for the secondary subnet. The CIDR block size must be between /12 and /28.
    ipv4CidrBlockAssociations SecondarySubnetIpv4CidrBlockAssociation[]
    A list of IPv4 CIDR block associations for the secondary network.
    ownerId string
    ID of the AWS account that owns the secondary subnet.
    region string
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    secondaryNetworkId string
    ID of the secondary network in which to create the secondary subnet.
    secondaryNetworkType string
    Type of the secondary network (e.g., rdma).
    secondarySubnetId string
    ID of the secondary subnet.
    state string
    State of the IPv4 CIDR block association.
    tags {[key: string]: string}
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll {[key: string]: string}
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    timeouts SecondarySubnetTimeouts
    arn str
    ARN of the secondary subnet.
    availability_zone str
    Availability Zone for the secondary subnet. Cannot be specified with availability_zone_id.
    availability_zone_id str
    ID of the Availability Zone for the secondary subnet. This option is preferred over availability_zone as it provides a consistent identifier across AWS accounts. Cannot be specified with availability_zone.
    ipv4_cidr_block str
    IPv4 CIDR block for the secondary subnet. The CIDR block size must be between /12 and /28.
    ipv4_cidr_block_associations Sequence[SecondarySubnetIpv4CidrBlockAssociationArgs]
    A list of IPv4 CIDR block associations for the secondary network.
    owner_id str
    ID of the AWS account that owns the secondary subnet.
    region str
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    secondary_network_id str
    ID of the secondary network in which to create the secondary subnet.
    secondary_network_type str
    Type of the secondary network (e.g., rdma).
    secondary_subnet_id str
    ID of the secondary subnet.
    state str
    State of the IPv4 CIDR block association.
    tags Mapping[str, str]
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tags_all Mapping[str, str]
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    timeouts SecondarySubnetTimeoutsArgs
    arn String
    ARN of the secondary subnet.
    availabilityZone String
    Availability Zone for the secondary subnet. Cannot be specified with availability_zone_id.
    availabilityZoneId String
    ID of the Availability Zone for the secondary subnet. This option is preferred over availability_zone as it provides a consistent identifier across AWS accounts. Cannot be specified with availability_zone.
    ipv4CidrBlock String
    IPv4 CIDR block for the secondary subnet. The CIDR block size must be between /12 and /28.
    ipv4CidrBlockAssociations List<Property Map>
    A list of IPv4 CIDR block associations for the secondary network.
    ownerId String
    ID of the AWS account that owns the secondary subnet.
    region String
    Region where this resource will be managed. Defaults to the Region set in the provider configuration.
    secondaryNetworkId String
    ID of the secondary network in which to create the secondary subnet.
    secondaryNetworkType String
    Type of the secondary network (e.g., rdma).
    secondarySubnetId String
    ID of the secondary subnet.
    state String
    State of the IPv4 CIDR block association.
    tags Map<String>
    A map of tags to assign to the resource. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
    tagsAll Map<String>
    A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.
    timeouts Property Map

    Supporting Types

    SecondarySubnetIpv4CidrBlockAssociation, SecondarySubnetIpv4CidrBlockAssociationArgs

    AssociationId string
    Association ID for the IPv4 CIDR block.
    CidrBlock string
    IPv4 CIDR block.
    State string
    State of the IPv4 CIDR block association.
    AssociationId string
    Association ID for the IPv4 CIDR block.
    CidrBlock string
    IPv4 CIDR block.
    State string
    State of the IPv4 CIDR block association.
    associationId String
    Association ID for the IPv4 CIDR block.
    cidrBlock String
    IPv4 CIDR block.
    state String
    State of the IPv4 CIDR block association.
    associationId string
    Association ID for the IPv4 CIDR block.
    cidrBlock string
    IPv4 CIDR block.
    state string
    State of the IPv4 CIDR block association.
    association_id str
    Association ID for the IPv4 CIDR block.
    cidr_block str
    IPv4 CIDR block.
    state str
    State of the IPv4 CIDR block association.
    associationId String
    Association ID for the IPv4 CIDR block.
    cidrBlock String
    IPv4 CIDR block.
    state String
    State of the IPv4 CIDR block association.

    SecondarySubnetTimeouts, SecondarySubnetTimeoutsArgs

    Create string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    Delete string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    Update string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    Create string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    Delete string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    Update string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    create String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    delete String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    update String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    create string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    delete string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    update string
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    create str
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    delete str
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    update str
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    create String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
    delete String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours). Setting a timeout for a Delete operation is only applicable if changes are saved into state before the destroy operation occurs.
    update String
    A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).

    Import

    Identity Schema

    Required

    • id - (String) ID of the secondary subnet.

    Optional

    • account_id (String) AWS Account where this resource is managed.
    • region (String) Region where this resource is managed.

    Using pulumi import, import EC2 Secondary Subnets using the secondary subnet ID. For example:

    $ pulumi import aws:ec2/secondarySubnet:SecondarySubnet example ss-0123456789abcdef0
    

    To learn more about importing existing cloud resources, see Importing resources.

    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
    AWS v7.20.0 published on Thursday, Feb 19, 2026 by Pulumi
      Meet Neo: Your AI Platform Teammate