amazonka-ec2-2.0: Amazon Elastic Compute Cloud SDK.
Copyright(c) 2013-2023 Brendan Hay
LicenseMozilla Public License, v. 2.0.
MaintainerBrendan Hay
Stabilityauto-generated
Portabilitynon-portable (GHC extensions)
Safe HaskellSafe-Inferred
LanguageHaskell2010

Amazonka.EC2.CreateRoute

Description

Creates a route in a route table within a VPC.

You must specify either a destination CIDR block or a prefix list ID. You must also specify exactly one of the resources from the parameter list.

When determining how to route traffic, we use the route with the most specific match. For example, traffic is destined for the IPv4 address 192.0.2.3, and the route table includes the following two IPv4 routes:

  • 192.0.2.0/24 (goes to some target A)
  • 192.0.2.0/28 (goes to some target B)

Both routes apply to the traffic destined for 192.0.2.3. However, the second route in the list covers a smaller number of IP addresses and is therefore more specific, so we use that route to determine where to target the traffic.

For more information about route tables, see Route tables in the Amazon Virtual Private Cloud User Guide.

Synopsis

Creating a Request

data CreateRoute Source #

See: newCreateRoute smart constructor.

Constructors

CreateRoute' 

Fields

Instances

Instances details
ToHeaders CreateRoute Source # 
Instance details

Defined in Amazonka.EC2.CreateRoute

Methods

toHeaders :: CreateRoute -> [Header] #

ToPath CreateRoute Source # 
Instance details

Defined in Amazonka.EC2.CreateRoute

ToQuery CreateRoute Source # 
Instance details

Defined in Amazonka.EC2.CreateRoute

AWSRequest CreateRoute Source # 
Instance details

Defined in Amazonka.EC2.CreateRoute

Associated Types

type AWSResponse CreateRoute #

Generic CreateRoute Source # 
Instance details

Defined in Amazonka.EC2.CreateRoute

Associated Types

type Rep CreateRoute :: Type -> Type #

Read CreateRoute Source # 
Instance details

Defined in Amazonka.EC2.CreateRoute

Show CreateRoute Source # 
Instance details

Defined in Amazonka.EC2.CreateRoute

NFData CreateRoute Source # 
Instance details

Defined in Amazonka.EC2.CreateRoute

Methods

rnf :: CreateRoute -> () #

Eq CreateRoute Source # 
Instance details

Defined in Amazonka.EC2.CreateRoute

Hashable CreateRoute Source # 
Instance details

Defined in Amazonka.EC2.CreateRoute

type AWSResponse CreateRoute Source # 
Instance details

Defined in Amazonka.EC2.CreateRoute

type Rep CreateRoute Source # 
Instance details

Defined in Amazonka.EC2.CreateRoute

type Rep CreateRoute = D1 ('MetaData "CreateRoute" "Amazonka.EC2.CreateRoute" "amazonka-ec2-2.0-48L9RAJvmvzAdBkRegqWCL" 'False) (C1 ('MetaCons "CreateRoute'" 'PrefixI 'True) ((((S1 ('MetaSel ('Just "carrierGatewayId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "coreNetworkArn") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "destinationCidrBlock") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "destinationIpv6CidrBlock") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: ((S1 ('MetaSel ('Just "destinationPrefixListId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "dryRun") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool))) :*: (S1 ('MetaSel ('Just "egressOnlyInternetGatewayId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "gatewayId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))))) :*: (((S1 ('MetaSel ('Just "instanceId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "localGatewayId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "natGatewayId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "networkInterfaceId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)))) :*: ((S1 ('MetaSel ('Just "transitGatewayId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "vpcEndpointId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "vpcPeeringConnectionId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "routeTableId") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Text))))))

newCreateRoute Source #

Create a value of CreateRoute with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

CreateRoute, createRoute_carrierGatewayId - The ID of the carrier gateway.

You can only use this option when the VPC contains a subnet which is associated with a Wavelength Zone.

CreateRoute, createRoute_coreNetworkArn - The Amazon Resource Name (ARN) of the core network.

CreateRoute, createRoute_destinationCidrBlock - The IPv4 CIDR address block used for the destination match. Routing decisions are based on the most specific match. We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18, we modify it to 100.68.0.0/18.

CreateRoute, createRoute_destinationIpv6CidrBlock - The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.

CreateRoute, createRoute_destinationPrefixListId - The ID of a prefix list used for the destination match.

$sel:dryRun:CreateRoute', createRoute_dryRun - Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

CreateRoute, createRoute_egressOnlyInternetGatewayId - [IPv6 traffic only] The ID of an egress-only internet gateway.

CreateRoute, createRoute_gatewayId - The ID of an internet gateway or virtual private gateway attached to your VPC.

CreateRoute, createRoute_instanceId - The ID of a NAT instance in your VPC. The operation fails if you specify an instance ID unless exactly one network interface is attached.

CreateRoute, createRoute_localGatewayId - The ID of the local gateway.

CreateRoute, createRoute_natGatewayId - [IPv4 traffic only] The ID of a NAT gateway.

CreateRoute, createRoute_networkInterfaceId - The ID of a network interface.

CreateRoute, createRoute_transitGatewayId - The ID of a transit gateway.

CreateRoute, createRoute_vpcEndpointId - The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.

CreateRoute, createRoute_vpcPeeringConnectionId - The ID of a VPC peering connection.

CreateRoute, createRoute_routeTableId - The ID of the route table for the route.

Request Lenses

createRoute_carrierGatewayId :: Lens' CreateRoute (Maybe Text) Source #

The ID of the carrier gateway.

You can only use this option when the VPC contains a subnet which is associated with a Wavelength Zone.

createRoute_coreNetworkArn :: Lens' CreateRoute (Maybe Text) Source #

The Amazon Resource Name (ARN) of the core network.

createRoute_destinationCidrBlock :: Lens' CreateRoute (Maybe Text) Source #

The IPv4 CIDR address block used for the destination match. Routing decisions are based on the most specific match. We modify the specified CIDR block to its canonical form; for example, if you specify 100.68.0.18/18, we modify it to 100.68.0.0/18.

createRoute_destinationIpv6CidrBlock :: Lens' CreateRoute (Maybe Text) Source #

The IPv6 CIDR block used for the destination match. Routing decisions are based on the most specific match.

createRoute_destinationPrefixListId :: Lens' CreateRoute (Maybe Text) Source #

The ID of a prefix list used for the destination match.

createRoute_dryRun :: Lens' CreateRoute (Maybe Bool) Source #

Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

createRoute_egressOnlyInternetGatewayId :: Lens' CreateRoute (Maybe Text) Source #

IPv6 traffic only
The ID of an egress-only internet gateway.

createRoute_gatewayId :: Lens' CreateRoute (Maybe Text) Source #

The ID of an internet gateway or virtual private gateway attached to your VPC.

createRoute_instanceId :: Lens' CreateRoute (Maybe Text) Source #

The ID of a NAT instance in your VPC. The operation fails if you specify an instance ID unless exactly one network interface is attached.

createRoute_localGatewayId :: Lens' CreateRoute (Maybe Text) Source #

The ID of the local gateway.

createRoute_natGatewayId :: Lens' CreateRoute (Maybe Text) Source #

IPv4 traffic only
The ID of a NAT gateway.

createRoute_vpcEndpointId :: Lens' CreateRoute (Maybe Text) Source #

The ID of a VPC endpoint. Supported for Gateway Load Balancer endpoints only.

createRoute_vpcPeeringConnectionId :: Lens' CreateRoute (Maybe Text) Source #

The ID of a VPC peering connection.

createRoute_routeTableId :: Lens' CreateRoute Text Source #

The ID of the route table for the route.

Destructuring the Response

data CreateRouteResponse Source #

See: newCreateRouteResponse smart constructor.

Constructors

CreateRouteResponse' 

Fields

Instances

Instances details
Generic CreateRouteResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateRoute

Associated Types

type Rep CreateRouteResponse :: Type -> Type #

Read CreateRouteResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateRoute

Show CreateRouteResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateRoute

NFData CreateRouteResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateRoute

Methods

rnf :: CreateRouteResponse -> () #

Eq CreateRouteResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateRoute

type Rep CreateRouteResponse Source # 
Instance details

Defined in Amazonka.EC2.CreateRoute

type Rep CreateRouteResponse = D1 ('MetaData "CreateRouteResponse" "Amazonka.EC2.CreateRoute" "amazonka-ec2-2.0-48L9RAJvmvzAdBkRegqWCL" 'False) (C1 ('MetaCons "CreateRouteResponse'" 'PrefixI 'True) (S1 ('MetaSel ('Just "return'") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "httpStatus") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedStrict) (Rec0 Int)))

newCreateRouteResponse Source #

Create a value of CreateRouteResponse with all optional fields omitted.

Use generic-lens or optics to modify other optional fields.

The following record fields are available, with the corresponding lenses provided for backwards compatibility:

$sel:return':CreateRouteResponse', createRouteResponse_return - Returns true if the request succeeds; otherwise, it returns an error.

$sel:httpStatus:CreateRouteResponse', createRouteResponse_httpStatus - The response's http status code.

Response Lenses

createRouteResponse_return :: Lens' CreateRouteResponse (Maybe Bool) Source #

Returns true if the request succeeds; otherwise, it returns an error.