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

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.SubnetCidrReservation

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 a subnet CIDR reservation resource.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Aws = Pulumi.Aws;
    
    return await Deployment.RunAsync(() => 
    {
        var example = new Aws.Ec2.SubnetCidrReservation("example", new()
        {
            CidrBlock = "10.0.0.16/28",
            ReservationType = "prefix",
            SubnetId = aws_subnet.Example.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.NewSubnetCidrReservation(ctx, "example", &ec2.SubnetCidrReservationArgs{
    			CidrBlock:       pulumi.String("10.0.0.16/28"),
    			ReservationType: pulumi.String("prefix"),
    			SubnetId:        pulumi.Any(aws_subnet.Example.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.SubnetCidrReservation;
    import com.pulumi.aws.ec2.SubnetCidrReservationArgs;
    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 SubnetCidrReservation("example", SubnetCidrReservationArgs.builder()        
                .cidrBlock("10.0.0.16/28")
                .reservationType("prefix")
                .subnetId(aws_subnet.example().id())
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ec2.SubnetCidrReservation("example",
        cidr_block="10.0.0.16/28",
        reservation_type="prefix",
        subnet_id=aws_subnet["example"]["id"])
    
    import * as pulumi from "@pulumi/pulumi";
    import * as aws from "@pulumi/aws";
    
    const example = new aws.ec2.SubnetCidrReservation("example", {
        cidrBlock: "10.0.0.16/28",
        reservationType: "prefix",
        subnetId: aws_subnet.example.id,
    });
    
    resources:
      example:
        type: aws:ec2:SubnetCidrReservation
        properties:
          cidrBlock: 10.0.0.16/28
          reservationType: prefix
          subnetId: ${aws_subnet.example.id}
    

    Create SubnetCidrReservation Resource

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

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

    CidrBlock string

    The CIDR block for the reservation.

    ReservationType string

    The type of reservation to create. Valid values: explicit, prefix

    SubnetId string

    The ID of the subnet to create the reservation for.

    Description string

    A brief description of the reservation.

    CidrBlock string

    The CIDR block for the reservation.

    ReservationType string

    The type of reservation to create. Valid values: explicit, prefix

    SubnetId string

    The ID of the subnet to create the reservation for.

    Description string

    A brief description of the reservation.

    cidrBlock String

    The CIDR block for the reservation.

    reservationType String

    The type of reservation to create. Valid values: explicit, prefix

    subnetId String

    The ID of the subnet to create the reservation for.

    description String

    A brief description of the reservation.

    cidrBlock string

    The CIDR block for the reservation.

    reservationType string

    The type of reservation to create. Valid values: explicit, prefix

    subnetId string

    The ID of the subnet to create the reservation for.

    description string

    A brief description of the reservation.

    cidr_block str

    The CIDR block for the reservation.

    reservation_type str

    The type of reservation to create. Valid values: explicit, prefix

    subnet_id str

    The ID of the subnet to create the reservation for.

    description str

    A brief description of the reservation.

    cidrBlock String

    The CIDR block for the reservation.

    reservationType String

    The type of reservation to create. Valid values: explicit, prefix

    subnetId String

    The ID of the subnet to create the reservation for.

    description String

    A brief description of the reservation.

    Outputs

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

    Id string

    The provider-assigned unique ID for this managed resource.

    OwnerId string

    ID of the AWS account that owns this CIDR reservation.

    Id string

    The provider-assigned unique ID for this managed resource.

    OwnerId string

    ID of the AWS account that owns this CIDR reservation.

    id String

    The provider-assigned unique ID for this managed resource.

    ownerId String

    ID of the AWS account that owns this CIDR reservation.

    id string

    The provider-assigned unique ID for this managed resource.

    ownerId string

    ID of the AWS account that owns this CIDR reservation.

    id str

    The provider-assigned unique ID for this managed resource.

    owner_id str

    ID of the AWS account that owns this CIDR reservation.

    id String

    The provider-assigned unique ID for this managed resource.

    ownerId String

    ID of the AWS account that owns this CIDR reservation.

    Look up Existing SubnetCidrReservation Resource

    Get an existing SubnetCidrReservation 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?: SubnetCidrReservationState, opts?: CustomResourceOptions): SubnetCidrReservation
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            cidr_block: Optional[str] = None,
            description: Optional[str] = None,
            owner_id: Optional[str] = None,
            reservation_type: Optional[str] = None,
            subnet_id: Optional[str] = None) -> SubnetCidrReservation
    func GetSubnetCidrReservation(ctx *Context, name string, id IDInput, state *SubnetCidrReservationState, opts ...ResourceOption) (*SubnetCidrReservation, error)
    public static SubnetCidrReservation Get(string name, Input<string> id, SubnetCidrReservationState? state, CustomResourceOptions? opts = null)
    public static SubnetCidrReservation get(String name, Output<String> id, SubnetCidrReservationState 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:
    CidrBlock string

    The CIDR block for the reservation.

    Description string

    A brief description of the reservation.

    OwnerId string

    ID of the AWS account that owns this CIDR reservation.

    ReservationType string

    The type of reservation to create. Valid values: explicit, prefix

    SubnetId string

    The ID of the subnet to create the reservation for.

    CidrBlock string

    The CIDR block for the reservation.

    Description string

    A brief description of the reservation.

    OwnerId string

    ID of the AWS account that owns this CIDR reservation.

    ReservationType string

    The type of reservation to create. Valid values: explicit, prefix

    SubnetId string

    The ID of the subnet to create the reservation for.

    cidrBlock String

    The CIDR block for the reservation.

    description String

    A brief description of the reservation.

    ownerId String

    ID of the AWS account that owns this CIDR reservation.

    reservationType String

    The type of reservation to create. Valid values: explicit, prefix

    subnetId String

    The ID of the subnet to create the reservation for.

    cidrBlock string

    The CIDR block for the reservation.

    description string

    A brief description of the reservation.

    ownerId string

    ID of the AWS account that owns this CIDR reservation.

    reservationType string

    The type of reservation to create. Valid values: explicit, prefix

    subnetId string

    The ID of the subnet to create the reservation for.

    cidr_block str

    The CIDR block for the reservation.

    description str

    A brief description of the reservation.

    owner_id str

    ID of the AWS account that owns this CIDR reservation.

    reservation_type str

    The type of reservation to create. Valid values: explicit, prefix

    subnet_id str

    The ID of the subnet to create the reservation for.

    cidrBlock String

    The CIDR block for the reservation.

    description String

    A brief description of the reservation.

    ownerId String

    ID of the AWS account that owns this CIDR reservation.

    reservationType String

    The type of reservation to create. Valid values: explicit, prefix

    subnetId String

    The ID of the subnet to create the reservation for.

    Import

    Using pulumi import, import Existing CIDR reservations using SUBNET_ID:RESERVATION_ID. For example:

     $ pulumi import aws:ec2/subnetCidrReservation:SubnetCidrReservation example subnet-01llsxvsxabqiymcz:scr-4mnvz6wb7otksjcs9
    

    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