aws.ec2.SubnetCidrReservation
Explore with Pulumi AI
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:
- Cidr
Block string - The CIDR block for the reservation.
- Reservation
Type string - The type of reservation to create. Valid values:
explicit
,prefix
- Subnet
Id string - The ID of the subnet to create the reservation for.
- Description string
- A brief description of the reservation.
- Cidr
Block string - The CIDR block for the reservation.
- Reservation
Type string - The type of reservation to create. Valid values:
explicit
,prefix
- Subnet
Id string - The ID of the subnet to create the reservation for.
- Description string
- A brief description of the reservation.
- cidr
Block String - The CIDR block for the reservation.
- reservation
Type String - The type of reservation to create. Valid values:
explicit
,prefix
- subnet
Id String - The ID of the subnet to create the reservation for.
- description String
- A brief description of the reservation.
- cidr
Block string - The CIDR block for the reservation.
- reservation
Type string - The type of reservation to create. Valid values:
explicit
,prefix
- subnet
Id 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.
- cidr
Block String - The CIDR block for the reservation.
- reservation
Type String - The type of reservation to create. Valid values:
explicit
,prefix
- subnet
Id 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:
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.
- Cidr
Block string - The CIDR block for the reservation.
- Description string
- A brief description of the reservation.
- Owner
Id string - ID of the AWS account that owns this CIDR reservation.
- Reservation
Type string - The type of reservation to create. Valid values:
explicit
,prefix
- Subnet
Id string - The ID of the subnet to create the reservation for.
- Cidr
Block string - The CIDR block for the reservation.
- Description string
- A brief description of the reservation.
- Owner
Id string - ID of the AWS account that owns this CIDR reservation.
- Reservation
Type string - The type of reservation to create. Valid values:
explicit
,prefix
- Subnet
Id string - The ID of the subnet to create the reservation for.
- cidr
Block String - The CIDR block for the reservation.
- description String
- A brief description of the reservation.
- owner
Id String - ID of the AWS account that owns this CIDR reservation.
- reservation
Type String - The type of reservation to create. Valid values:
explicit
,prefix
- subnet
Id String - The ID of the subnet to create the reservation for.
- cidr
Block string - The CIDR block for the reservation.
- description string
- A brief description of the reservation.
- owner
Id string - ID of the AWS account that owns this CIDR reservation.
- reservation
Type string - The type of reservation to create. Valid values:
explicit
,prefix
- subnet
Id 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.
- cidr
Block String - The CIDR block for the reservation.
- description String
- A brief description of the reservation.
- owner
Id String - ID of the AWS account that owns this CIDR reservation.
- reservation
Type String - The type of reservation to create. Valid values:
explicit
,prefix
- subnet
Id 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.