1. Packages
  2. AWS
  3. API Docs
  4. ec2
  5. SubnetCidrReservation
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

aws.ec2.SubnetCidrReservation

Explore with Pulumi AI

aws logo
AWS v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi

    Provides a subnet CIDR reservation resource.

    Example Usage

    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: exampleAwsSubnet.id,
    });
    
    import pulumi
    import pulumi_aws as aws
    
    example = aws.ec2.SubnetCidrReservation("example",
        cidr_block="10.0.0.16/28",
        reservation_type="prefix",
        subnet_id=example_aws_subnet["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(exampleAwsSubnet.Id),
    		})
    		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.SubnetCidrReservation("example", new()
        {
            CidrBlock = "10.0.0.16/28",
            ReservationType = "prefix",
            SubnetId = exampleAwsSubnet.Id,
        });
    
    });
    
    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(exampleAwsSubnet.id())
                .build());
    
        }
    }
    
    resources:
      example:
        type: aws:ec2:SubnetCidrReservation
        properties:
          cidrBlock: 10.0.0.16/28
          reservationType: prefix
          subnetId: ${exampleAwsSubnet.id}
    

    Create SubnetCidrReservation Resource

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

    Constructor syntax

    new SubnetCidrReservation(name: string, args: SubnetCidrReservationArgs, opts?: CustomResourceOptions);
    @overload
    def SubnetCidrReservation(resource_name: str,
                              args: SubnetCidrReservationArgs,
                              opts: Optional[ResourceOptions] = None)
    
    @overload
    def SubnetCidrReservation(resource_name: str,
                              opts: Optional[ResourceOptions] = None,
                              cidr_block: Optional[str] = None,
                              reservation_type: Optional[str] = None,
                              subnet_id: Optional[str] = None,
                              description: Optional[str] = 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.
    
    

    Parameters

    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.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var subnetCidrReservationResource = new Aws.Ec2.SubnetCidrReservation("subnetCidrReservationResource", new()
    {
        CidrBlock = "string",
        ReservationType = "string",
        SubnetId = "string",
        Description = "string",
    });
    
    example, err := ec2.NewSubnetCidrReservation(ctx, "subnetCidrReservationResource", &ec2.SubnetCidrReservationArgs{
    	CidrBlock:       pulumi.String("string"),
    	ReservationType: pulumi.String("string"),
    	SubnetId:        pulumi.String("string"),
    	Description:     pulumi.String("string"),
    })
    
    var subnetCidrReservationResource = new SubnetCidrReservation("subnetCidrReservationResource", SubnetCidrReservationArgs.builder()
        .cidrBlock("string")
        .reservationType("string")
        .subnetId("string")
        .description("string")
        .build());
    
    subnet_cidr_reservation_resource = aws.ec2.SubnetCidrReservation("subnetCidrReservationResource",
        cidr_block="string",
        reservation_type="string",
        subnet_id="string",
        description="string")
    
    const subnetCidrReservationResource = new aws.ec2.SubnetCidrReservation("subnetCidrReservationResource", {
        cidrBlock: "string",
        reservationType: "string",
        subnetId: "string",
        description: "string",
    });
    
    type: aws:ec2:SubnetCidrReservation
    properties:
        cidrBlock: string
        description: string
        reservationType: string
        subnetId: string
    

    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

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    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
    

    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 v6.60.0 published on Tuesday, Nov 19, 2024 by Pulumi