Namespace Amazon.CDK.AWS.EC2
Amazon EC2 Construct Library
The aws-cdk-lib/aws-ec2
package contains primitives for setting up networking and
instances.
using Amazon.CDK.AWS.EC2;
VPC
Most projects need a Virtual Private Cloud to provide security by means of
network partitioning. This is achieved by creating an instance of
Vpc
:
var vpc = new Vpc(this, "VPC");
All default constructs require EC2 instances to be launched inside a VPC, so you should generally start by defining a VPC whenever you need to launch instances for your project.
Subnet Types
A VPC consists of one or more subnets that instances can be placed into. CDK distinguishes three different subnet types:
A default VPC configuration will create public and private subnets. However, if
natGateways:0
and subnetConfiguration
is undefined, default VPC configuration
will create public and isolated subnets. See Advanced Subnet Configuration
below for information on how to change the default subnet configuration.
Constructs using the VPC will "launch instances" (or more accurately, create
Elastic Network Interfaces) into one or more of the subnets. They all accept
a property called subnetSelection
(sometimes called vpcSubnets
) to allow
you to select in what subnet to place the ENIs, usually defaulting to
private subnets if the property is omitted.
If you would like to save on the cost of NAT gateways, you can use
isolated subnets instead of private subnets (as described in Advanced
Subnet Configuration). If you need private instances to have
internet connectivity, another option is to reduce the number of NAT gateways
created by setting the natGateways
property to a lower value (the default
is one NAT gateway per availability zone). Be aware that this may have
availability implications for your application.
Control over availability zones
By default, a VPC will spread over at most 3 Availability Zones available to
it. To change the number of Availability Zones that the VPC will spread over,
specify the maxAzs
property when defining it.
The number of Availability Zones that are available depends on the region
and account of the Stack containing the VPC. If the region and account are
specified on
the Stack, the CLI will look up the existing Availability
Zones
and get an accurate count. The result of this operation will be written to a file
called cdk.context.json
. You must commit this file to source control so
that the lookup values are available in non-privileged environments such
as CI build steps, and to ensure your template builds are repeatable.
If region and account are not specified, the stack could be deployed anywhere and it will have to make a safe choice, limiting itself to 2 Availability Zones.
Therefore, to get the VPC to spread over 3 or more availability zones, you must specify the environment where the stack will be deployed.
You can gain full control over the availability zones selection strategy by overriding the Stack's get availabilityZones()
method:
// This example is only available in TypeScript
class MyStack extends Stack {
constructor(scope: Construct, id: string, props?: StackProps) {
super(scope, id, props);
// ...
}
get availabilityZones(): string[] {
return ['us-west-2a', 'us-west-2b'];
}
}
Note that overriding the get availabilityZones()
method will override the default behavior for all constructs defined within the Stack.
Choosing subnets for resources
When creating resources that create Elastic Network Interfaces (such as
databases or instances), there is an option to choose which subnets to place
them in. For example, a VPC endpoint by default is placed into a subnet in
every availability zone, but you can override which subnets to use. The property
is typically called one of subnets
, vpcSubnets
or subnetSelection
.
The example below will place the endpoint into two AZs (us-east-1a
and us-east-1c
),
in Isolated subnets:
Vpc vpc;
new InterfaceVpcEndpoint(this, "VPC Endpoint", new InterfaceVpcEndpointProps {
Vpc = vpc,
Service = new InterfaceVpcEndpointService("com.amazonaws.vpce.us-east-1.vpce-svc-uuddlrlrbastrtsvc", 443),
Subnets = new SubnetSelection {
SubnetType = SubnetType.PRIVATE_ISOLATED,
AvailabilityZones = new [] { "us-east-1a", "us-east-1c" }
}
});
You can also specify specific subnet objects for granular control:
Vpc vpc;
Subnet subnet1;
Subnet subnet2;
new InterfaceVpcEndpoint(this, "VPC Endpoint", new InterfaceVpcEndpointProps {
Vpc = vpc,
Service = new InterfaceVpcEndpointService("com.amazonaws.vpce.us-east-1.vpce-svc-uuddlrlrbastrtsvc", 443),
Subnets = new SubnetSelection {
Subnets = new [] { subnet1, subnet2 }
}
});
Which subnets are selected is evaluated as follows:
Using NAT instances
By default, the Vpc
construct will create NAT gateways for you, which
are managed by AWS. If you would prefer to use your own managed NAT
instances instead, specify a different value for the natGatewayProvider
property, as follows:
The construct will automatically selects the latest version of Amazon Linux 2023.
If you prefer to use a custom AMI, use machineImage: MachineImage.genericLinux({ ... })
and configure the right AMI ID for the
regions you want to deploy to.
Warning The NAT instances created using this method will be unmonitored. They are not part of an Auto Scaling Group, and if they become unavailable or are terminated for any reason, will not be restarted or replaced.
By default, the NAT instances will route all traffic. To control what traffic
gets routed, pass a custom value for defaultAllowedTraffic
and access the
NatInstanceProvider.connections
member after having passed the NAT provider to
the VPC:
InstanceType instanceType;
var provider = NatProvider.InstanceV2(new NatInstanceProps {
InstanceType = instanceType,
DefaultAllowedTraffic = NatTrafficDirection.OUTBOUND_ONLY
});
new Vpc(this, "TheVPC", new VpcProps {
NatGatewayProvider = provider
});
provider.Connections.AllowFrom(Peer.Ipv4("1.2.3.4/8"), Port.HTTP);
You can also customize the characteristics of your NAT instances, including their security group, as well as their initialization scripts:
Bucket bucket;
var userData = UserData.ForLinux();
userData.AddCommands(
(SpreadElement ...ec2.NatInstanceProviderV2.DEFAULT_USER_DATA_COMMANDS
NatInstanceProviderV2.DEFAULT_USER_DATA_COMMANDS), "echo \"hello world!\" > hello.txt", $"aws s3 cp hello.txt s3://{bucket.bucketName}");
var provider = NatProvider.InstanceV2(new NatInstanceProps {
InstanceType = new InstanceType("t3.small"),
CreditSpecification = CpuCredits.UNLIMITED,
DefaultAllowedTraffic = NatTrafficDirection.NONE
});
var vpc = new Vpc(this, "TheVPC", new VpcProps {
NatGatewayProvider = provider,
NatGateways = 2
});
var securityGroup = new SecurityGroup(this, "SecurityGroup", new SecurityGroupProps { Vpc = vpc });
securityGroup.AddEgressRule(Peer.AnyIpv4(), Port.Tcp(443));
for (var gateway in provider.GatewayInstances)
{
bucket.GrantWrite(gateway);
gateway.AddSecurityGroup(securityGroup);
}
// Configure the `natGatewayProvider` when defining a Vpc
var natGatewayProvider = NatProvider.Instance(new NatInstanceProps {
InstanceType = new InstanceType("t3.small")
});
var vpc = new Vpc(this, "MyVpc", new VpcProps {
NatGatewayProvider = natGatewayProvider,
// The 'natGateways' parameter now controls the number of NAT instances
NatGateways = 2
});
The V1 NatProvider.instance
construct will use the AWS official NAT instance AMI, which has already
reached EOL on Dec 31, 2023. For more information, see the following blog post:
Amazon Linux AMI end of life.
InstanceType instanceType;
var provider = NatProvider.Instance(new NatInstanceProps {
InstanceType = instanceType,
DefaultAllowedTraffic = NatTrafficDirection.OUTBOUND_ONLY
});
new Vpc(this, "TheVPC", new VpcProps {
NatGatewayProvider = provider
});
provider.Connections.AllowFrom(Peer.Ipv4("1.2.3.4/8"), Port.HTTP);
Ip Address Management
The VPC spans a supernet IP range, which contains the non-overlapping IPs of its contained subnets. Possible sources for this IP range are:
By default the Vpc will allocate the 10.0.0.0/16
address range which will be exhaustively spread across all subnets in the subnet configuration. This behavior can be changed by passing an object that implements IIpAddresses
to the ipAddress
property of a Vpc. See the subsequent sections for the options.
Be aware that if you don't explicitly reserve subnet groups in subnetConfiguration
, the address space will be fully allocated! If you predict you may need to add more subnet groups later, add them early on and set reserved: true
(see the "Advanced Subnet Configuration" section for more information).
Specifying a CIDR directly
Use IpAddresses.cidr
to define a Cidr range for your Vpc directly in code:
using Amazon.CDK.AWS.EC2;
new Vpc(this, "TheVPC", new VpcProps {
IpAddresses = IpAddresses.Cidr("10.0.1.0/20")
});
Space will be allocated to subnets in the following order:
The argument to IpAddresses.cidr
may not be a token, and concrete Cidr values are generated in the synthesized CloudFormation template.
Allocating an IP range from AWS IPAM
Amazon VPC IP Address Manager (IPAM) manages a large IP space, from which chunks can be allocated for use in the Vpc. For information on Amazon VPC IP Address Manager please see the official documentation. An example of allocating from AWS IPAM looks like this:
using Amazon.CDK.AWS.EC2;
CfnIPAMPool pool;
new Vpc(this, "TheVPC", new VpcProps {
IpAddresses = IpAddresses.AwsIpamAllocation(new AwsIpamProps {
Ipv4IpamPoolId = pool.Ref,
Ipv4NetmaskLength = 18,
DefaultSubnetIpv4NetmaskLength = 24
})
});
IpAddresses.awsIpamAllocation
requires the following:
With this method of IP address management, no attempt is made to guess at subnet group sizes or to exhaustively allocate the IP range. All subnet groups must have an explicit cidrMask
set as part of their subnet configuration, or defaultSubnetIpv4NetmaskLength
must be set for a default size. If not, synthesis will fail and you must provide one or the other.
Dual Stack configuration
To allocate both IPv4 and IPv6 addresses in your VPC, you can configure your VPC to have a dual stack protocol.
new Vpc(this, "DualStackVpc", new VpcProps {
IpProtocol = IpProtocol.DUAL_STACK
});
By default, a dual stack VPC will create an Amazon provided IPv6 /56 CIDR block associated to the VPC. It will then assign /64 portions of the block to each subnet. For each subnet, auto-assigning an IPv6 address will be enabled, and auto-asigning a public IPv4 address will be disabled. An egress only internet gateway will be created for PRIVATE_WITH_EGRESS
subnets, and IPv6 routes will be added for IGWs and EIGWs.
Disabling the auto-assigning of a public IPv4 address by default can avoid the cost of public IPv4 addresses starting 2/1/2024. For use cases that need an IPv4 address, the mapPublicIpOnLaunch
property in subnetConfiguration
can be set to auto-assign the IPv4 address. Note that private IPv4 address allocation will not be changed.
See Advanced Subnet Configuration for all IPv6 specific properties.
Reserving availability zones
There are situations where the IP space for availability zones will
need to be reserved. This is useful in situations where availability
zones would need to be added after the vpc is originally deployed,
without causing IP renumbering for availability zones subnets. The IP
space for reserving n
availability zones can be done by setting the
reservedAzs
to n
in vpc props, as shown below:
var vpc = new Vpc(this, "TheVPC", new VpcProps {
Cidr = "10.0.0.0/21",
MaxAzs = 3,
ReservedAzs = 1
});
In the example above, the subnets for reserved availability zones is not
actually provisioned but its IP space is still reserved. If, in the future,
new availability zones needs to be provisioned, then we would decrement
the value of reservedAzs
and increment the maxAzs
or availabilityZones
accordingly. This action would not cause the IP address of subnets to get
renumbered, but rather the IP space that was previously reserved will be
used for the new availability zones subnets.
Advanced Subnet Configuration
If the default VPC configuration (public and private subnets spanning the
size of the VPC) don't suffice for you, you can configure what subnets to
create by specifying the subnetConfiguration
property. It allows you
to configure the number and size of all subnets. Specifying an advanced
subnet configuration could look like this:
var vpc = new Vpc(this, "TheVPC", new VpcProps {
// 'IpAddresses' configures the IP range and size of the entire VPC.
// The IP space will be divided based on configuration for the subnets.
IpAddresses = IpAddresses.Cidr("10.0.0.0/21"),
// 'maxAzs' configures the maximum number of availability zones to use.
// If you want to specify the exact availability zones you want the VPC
// to use, use `availabilityZones` instead.
MaxAzs = 3,
// 'subnetConfiguration' specifies the "subnet groups" to create.
// Every subnet group will have a subnet for each AZ, so this
// configuration will create `3 groups × 3 AZs = 9` subnets.
SubnetConfiguration = new [] { new SubnetConfiguration {
// 'subnetType' controls Internet access, as described above.
SubnetType = SubnetType.PUBLIC,
// 'name' is used to name this particular subnet group. You will have to
// use the name for subnet selection if you have more than one subnet
// group of the same type.
Name = "Ingress",
// 'cidrMask' specifies the IP addresses in the range of of individual
// subnets in the group. Each of the subnets in this group will contain
// `2^(32 address bits - 24 subnet bits) - 2 reserved addresses = 254`
// usable IP addresses.
//
// If 'cidrMask' is left out the available address space is evenly
// divided across the remaining subnet groups.
CidrMask = 24
}, new SubnetConfiguration {
CidrMask = 24,
Name = "Application",
SubnetType = SubnetType.PRIVATE_WITH_EGRESS
}, new SubnetConfiguration {
CidrMask = 28,
Name = "Database",
SubnetType = SubnetType.PRIVATE_ISOLATED,
// 'reserved' can be used to reserve IP address space. No resources will
// be created for this subnet, but the IP range will be kept available for
// future creation of this subnet, or even for future subdivision.
Reserved = true
} }
});
The example above is one possible configuration, but the user can use the constructs above to implement many other network configurations.
The Vpc
from the above configuration in a Region with three
availability zones will be the following:
Subnet Name | Type | IP Block | AZ | Features |
---|---|---|---|---|
IngressSubnet1 | PUBLIC |
10.0.0.0/24 |
#1 | NAT Gateway |
IngressSubnet2 | PUBLIC |
10.0.1.0/24 |
#2 | NAT Gateway |
IngressSubnet3 | PUBLIC |
10.0.2.0/24 |
#3 | NAT Gateway |
ApplicationSubnet1 | PRIVATE |
10.0.3.0/24 |
#1 | Route to NAT in IngressSubnet1 |
ApplicationSubnet2 | PRIVATE |
10.0.4.0/24 |
#2 | Route to NAT in IngressSubnet2 |
ApplicationSubnet3 | PRIVATE |
10.0.5.0/24 |
#3 | Route to NAT in IngressSubnet3 |
DatabaseSubnet1 | ISOLATED |
10.0.6.0/28 |
#1 | Only routes within the VPC |
DatabaseSubnet2 | ISOLATED |
10.0.6.16/28 |
#2 | Only routes within the VPC |
DatabaseSubnet3 | ISOLATED |
10.0.6.32/28 |
#3 | Only routes within the VPC |
Dual Stack Configurations
Here is a break down of IPv4 and IPv6 specifc subnetConfiguration
properties in a dual stack VPC:
var vpc = new Vpc(this, "TheVPC", new VpcProps {
IpProtocol = IpProtocol.DUAL_STACK,
SubnetConfiguration = new [] { new SubnetConfiguration {
// general properties
Name = "Public",
SubnetType = SubnetType.PUBLIC,
Reserved = false,
// IPv4 specific properties
MapPublicIpOnLaunch = true,
CidrMask = 24,
// new IPv6 specific property
Ipv6AssignAddressOnCreation = true
} }
});
The property mapPublicIpOnLaunch
controls if a public IPv4 address will be assigned. This defaults to false
for dual stack VPCs to avoid inadvertant costs of having the public address. However, a public IP must be enabled (or otherwise configured with BYOIP or IPAM) in order for services that rely on the address to function.
The ipv6AssignAddressOnCreation
property controls the same behavior for the IPv6 address. It defaults to true.
Using IPv6 specific properties in an IPv4 only VPC will result in errors.
Accessing the Internet Gateway
If you need access to the internet gateway, you can get its ID like so:
Vpc vpc;
var igwId = vpc.InternetGatewayId;
For a VPC with only ISOLATED
subnets, this value will be undefined.
This is only supported for VPCs created in the stack - currently you're unable to get the ID for imported VPCs. To do that you'd have to specifically look up the Internet Gateway by name, which would require knowing the name beforehand.
This can be useful for configuring routing using a combination of gateways: for more information see Routing below.
Disabling the creation of the default internet gateway
If you need to control the creation of the internet gateway explicitly,
you can disable the creation of the default one using the createInternetGateway
property:
var vpc = new Vpc(this, "VPC", new VpcProps {
CreateInternetGateway = false,
SubnetConfiguration = new [] { new SubnetConfiguration {
SubnetType = SubnetType.PUBLIC,
Name = "Public"
} }
});
Routing
It's possible to add routes to any subnets using the addRoute()
method. If for
example you want an isolated subnet to have a static route via the default
Internet Gateway created for the public subnet - perhaps for routing a VPN
connection - you can do so like this:
var vpc = new Vpc(this, "VPC", new VpcProps {
SubnetConfiguration = new [] { new SubnetConfiguration {
SubnetType = SubnetType.PUBLIC,
Name = "Public"
}, new SubnetConfiguration {
SubnetType = SubnetType.PRIVATE_ISOLATED,
Name = "Isolated"
} }
});
((Subnet)vpc.IsolatedSubnets[0]).AddRoute("StaticRoute", new AddRouteOptions {
RouterId = vpc.InternetGatewayId,
RouterType = RouterType.GATEWAY,
DestinationCidrBlock = "8.8.8.8/32"
});
Note that we cast to Subnet
here because the list of subnets only returns an
ISubnet
.
Reserving subnet IP space
There are situations where the IP space for a subnet or number of subnets
will need to be reserved. This is useful in situations where subnets would
need to be added after the vpc is originally deployed, without causing IP
renumbering for existing subnets. The IP space for a subnet may be reserved
by setting the reserved
subnetConfiguration property to true, as shown
below:
var vpc = new Vpc(this, "TheVPC", new VpcProps {
NatGateways = 1,
SubnetConfiguration = new [] { new SubnetConfiguration {
CidrMask = 26,
Name = "Public",
SubnetType = SubnetType.PUBLIC
}, new SubnetConfiguration {
CidrMask = 26,
Name = "Application1",
SubnetType = SubnetType.PRIVATE_WITH_EGRESS
}, new SubnetConfiguration {
CidrMask = 26,
Name = "Application2",
SubnetType = SubnetType.PRIVATE_WITH_EGRESS,
Reserved = true
}, new SubnetConfiguration {
CidrMask = 27,
Name = "Database",
SubnetType = SubnetType.PRIVATE_ISOLATED
} }
});
In the example above, the subnet for Application2 is not actually provisioned
but its IP space is still reserved. If in the future this subnet needs to be
provisioned, then the reserved: true
property should be removed. Reserving
parts of the IP space prevents the other subnets from getting renumbered.
Sharing VPCs between stacks
If you are creating multiple Stack
s inside the same CDK application, you
can reuse a VPC defined in one Stack in another by simply passing the VPC
instance around:
/**
* Stack1 creates the VPC
*/
class Stack1 : Stack
{
public Vpc Vpc { get; }
public Stack1(App scope, string id, StackProps? props=null) : base(scope, id, props)
{
Vpc = new Vpc(this, "VPC");
}
}
class Stack2Props : StackProps
{
public IVpc Vpc { get; set; }
}
/**
* Stack2 consumes the VPC
*/
class Stack2 : Stack
{
public Stack2(App scope, string id, Stack2Props props) : base(scope, id, props)
{
// Pass the VPC to a construct that needs it
// Pass the VPC to a construct that needs it
new ConstructThatTakesAVpc(this, "Construct", new ConstructThatTakesAVpcProps {
Vpc = props.Vpc
});
}
}
var stack1 = new Stack1(app, "Stack1");
var stack2 = new Stack2(app, "Stack2", new Stack2Props {
Vpc = stack1.Vpc
});
Importing an existing VPC
If your VPC is created outside your CDK app, you can use Vpc.fromLookup()
.
The CDK CLI will search for the specified VPC in the the stack's region and
account, and import the subnet configuration. Looking up can be done by VPC
ID, but more flexibly by searching for a specific tag on the VPC.
Subnet types will be determined from the aws-cdk:subnet-type
tag on the
subnet if it exists, or the presence of a route to an Internet Gateway
otherwise. Subnet names will be determined from the aws-cdk:subnet-name
tag
on the subnet if it exists, or will mirror the subnet type otherwise (i.e.
a public subnet will have the name "Public"
).
The result of the Vpc.fromLookup()
operation will be written to a file
called cdk.context.json
. You must commit this file to source control so
that the lookup values are available in non-privileged environments such
as CI build steps, and to ensure your template builds are repeatable.
Here's how Vpc.fromLookup()
can be used:
var vpc = Vpc.FromLookup(stack, "VPC", new VpcLookupOptions {
// This imports the default VPC but you can also
// specify a 'vpcName' or 'tags'.
IsDefault = true
});
Vpc.fromLookup
is the recommended way to import VPCs. If for whatever
reason you do not want to use the context mechanism to look up a VPC at
synthesis time, you can also use Vpc.fromVpcAttributes
. This has the
following limitations:
Using Vpc.fromVpcAttributes()
looks like this:
var vpc = Vpc.FromVpcAttributes(this, "VPC", new VpcAttributes {
VpcId = "vpc-1234",
AvailabilityZones = new [] { "us-east-1a", "us-east-1b" },
// Either pass literals for all IDs
PublicSubnetIds = new [] { "s-12345", "s-67890" },
// OR: import a list of known length
PrivateSubnetIds = Fn.ImportListValue("PrivateSubnetIds", 2),
// OR: split an imported string to a list of known length
IsolatedSubnetIds = Fn.Split(",", StringParameter.ValueForStringParameter(this, "MyParameter"), 2)
});
For each subnet group the import function accepts optional parameters for subnet
names, route table ids and IPv4 CIDR blocks. When supplied, the length of these
lists are required to match the length of the list of subnet ids, allowing the
lists to be zipped together to form ISubnet
instances.
Public subnet group example (for private or isolated subnet groups, use the properties with the respective prefix):
var vpc = Vpc.FromVpcAttributes(this, "VPC", new VpcAttributes {
VpcId = "vpc-1234",
AvailabilityZones = new [] { "us-east-1a", "us-east-1b", "us-east-1c" },
PublicSubnetIds = new [] { "s-12345", "s-34567", "s-56789" },
PublicSubnetNames = new [] { "Subnet A", "Subnet B", "Subnet C" },
PublicSubnetRouteTableIds = new [] { "rt-12345", "rt-34567", "rt-56789" },
PublicSubnetIpv4CidrBlocks = new [] { "10.0.0.0/24", "10.0.1.0/24", "10.0.2.0/24" }
});
The above example will create an IVpc
instance with three public subnets:
| Subnet id | Availability zone | Subnet name | Route table id | IPv4 CIDR | | --------- | ----------------- | ----------- | -------------- | ----------- | | s-12345 | us-east-1a | Subnet A | rt-12345 | 10.0.0.0/24 | | s-34567 | us-east-1b | Subnet B | rt-34567 | 10.0.1.0/24 | | s-56789 | us-east-1c | Subnet B | rt-56789 | 10.0.2.0/24 |
Restricting access to the VPC default security group
AWS Security best practices recommend that the VPC default security group should
not allow inbound and outbound
traffic.
When the @aws-cdk/aws-ec2:restrictDefaultSecurityGroup
feature flag is set to
true
(default for new projects) this will be enabled by default. If you do not
have this feature flag set you can either set the feature flag or you can set
the restrictDefaultSecurityGroup
property to true
.
new Vpc(this, "VPC", new VpcProps {
RestrictDefaultSecurityGroup = true
});
If you set this property to true
and then later remove it or set it to false
the default ingress/egress will be restored on the default security group.
Allowing Connections
In AWS, all network traffic in and out of Elastic Network Interfaces (ENIs)
is controlled by Security Groups. You can think of Security Groups as a
firewall with a set of rules. By default, Security Groups allow no incoming
(ingress) traffic and all outgoing (egress) traffic. You can add ingress rules
to them to allow incoming traffic streams. To exert fine-grained control over
egress traffic, set allowAllOutbound: false
on the SecurityGroup
, after
which you can add egress traffic rules.
You can manipulate Security Groups directly:
var mySecurityGroup = new SecurityGroup(this, "SecurityGroup", new SecurityGroupProps {
Vpc = vpc,
Description = "Allow ssh access to ec2 instances",
AllowAllOutbound = true
});
mySecurityGroup.AddIngressRule(Peer.AnyIpv4(), Port.Tcp(22), "allow ssh access from the world");
All constructs that create ENIs on your behalf (typically constructs that create EC2 instances or other VPC-connected resources) will all have security groups automatically assigned. Those constructs have an attribute called connections, which is an object that makes it convenient to update the security groups. If you want to allow connections between two constructs that have security groups, you have to add an Egress rule to one Security Group, and an Ingress rule to the other. The connections object will automatically take care of this for you:
ApplicationLoadBalancer loadBalancer;
AutoScalingGroup appFleet;
AutoScalingGroup dbFleet;
// Allow connections from anywhere
loadBalancer.Connections.AllowFromAnyIpv4(Port.HTTPS, "Allow inbound HTTPS");
// The same, but an explicit IP address
loadBalancer.Connections.AllowFrom(Peer.Ipv4("1.2.3.4/32"), Port.HTTPS, "Allow inbound HTTPS");
// Allow connection between AutoScalingGroups
appFleet.Connections.AllowTo(dbFleet, Port.HTTPS, "App can call database");
Connection Peers
There are various classes that implement the connection peer part:
AutoScalingGroup appFleet;
AutoScalingGroup dbFleet;
// Simple connection peers
var peer = Peer.Ipv4("10.0.0.0/16");
peer = Peer.AnyIpv4();
peer = Peer.Ipv6("::0/0");
peer = Peer.AnyIpv6();
peer = Peer.PrefixList("pl-12345");
appFleet.Connections.AllowTo(peer, Port.HTTPS, "Allow outbound HTTPS");
Any object that has a security group can itself be used as a connection peer:
AutoScalingGroup fleet1;
AutoScalingGroup fleet2;
AutoScalingGroup appFleet;
// These automatically create appropriate ingress and egress rules in both security groups
fleet1.Connections.AllowTo(fleet2, Port.HTTP, "Allow between fleets");
appFleet.Connections.AllowFromAnyIpv4(Port.HTTP, "Allow from load balancer");
Port Ranges
The connections that are allowed are specified by port ranges. A number of classes provide the connection specifier:
Port.Tcp(80);
Port.HTTPS;
Port.TcpRange(60000, 65535);
Port.AllTcp();
Port.AllIcmp();
Port.AllIcmpV6();
Port.AllTraffic();
NOTE: Not all protocols have corresponding helper methods. In the absence of a helper method,
you can instantiate <code>Port</code> yourself with your own settings. You are also welcome to contribute
new helper methods.
Default Ports
Some Constructs have default ports associated with them. For example, the listener of a load balancer does (it's the public port), or instances of an RDS database (it's the port the database is accepting connections on).
If the object you're calling the peering method on has a default port associated with it, you can call
allowDefaultPortFrom()
and omit the port specifier. If the argument has an associated default port, call
allowDefaultPortTo()
.
For example:
ApplicationListener listener;
AutoScalingGroup appFleet;
DatabaseCluster rdsDatabase;
// Port implicit in listener
listener.Connections.AllowDefaultPortFromAnyIpv4("Allow public");
// Port implicit in peer
appFleet.Connections.AllowDefaultPortTo(rdsDatabase, "Fleet can access database");
Security group rules
By default, security group wills be added inline to the security group in the output cloud formation template, if applicable. This includes any static rules by ip address and port range. This optimization helps to minimize the size of the template.
In some environments this is not desirable, for example if your security group access is controlled
via tags. You can disable inline rules per security group or globally via the context key
@aws-cdk/aws-ec2.securityGroupDisableInlineRules
.
var mySecurityGroupWithoutInlineRules = new SecurityGroup(this, "SecurityGroup", new SecurityGroupProps {
Vpc = vpc,
Description = "Allow ssh access to ec2 instances",
AllowAllOutbound = true,
DisableInlineRules = true
});
//This will add the rule as an external cloud formation construct
mySecurityGroupWithoutInlineRules.AddIngressRule(Peer.AnyIpv4(), Port.SSH, "allow ssh access from the world");
Importing an existing security group
If you know the ID and the configuration of the security group to import, you can use SecurityGroup.fromSecurityGroupId
:
var sg = SecurityGroup.FromSecurityGroupId(this, "SecurityGroupImport", "sg-1234", new SecurityGroupImportOptions {
AllowAllOutbound = true
});
Alternatively, use lookup methods to import security groups if you do not know the ID or the configuration details. Method SecurityGroup.fromLookupByName
looks up a security group if the security group ID is unknown.
var sg = SecurityGroup.FromLookupByName(this, "SecurityGroupLookup", "security-group-name", vpc);
If the security group ID is known and configuration details are unknown, use method SecurityGroup.fromLookupById
instead. This method will lookup property allowAllOutbound
from the current configuration of the security group.
var sg = SecurityGroup.FromLookupById(this, "SecurityGroupLookup", "sg-1234");
The result of SecurityGroup.fromLookupByName
and SecurityGroup.fromLookupById
operations will be written to a file called cdk.context.json
. You must commit this file to source control so that the lookup values are available in non-privileged environments such as CI build steps, and to ensure your template builds are repeatable.
Cross Stack Connections
If you are attempting to add a connection from a peer in one stack to a peer in a different stack, sometimes it is necessary to ensure that you are making the connection in a specific stack in order to avoid a cyclic reference. If there are no other dependencies between stacks then it will not matter in which stack you make the connection, but if there are existing dependencies (i.e. stack1 already depends on stack2), then it is important to make the connection in the dependent stack (i.e. stack1).
Whenever you make a connections
function call, the ingress and egress security group rules will be added to the stack that the calling object exists in.
So if you are doing something like peer1.connections.allowFrom(peer2)
, then the security group rules (both ingress and egress) will be created in peer1
's Stack.
As an example, if we wanted to allow a connection from a security group in one stack (egress) to a security group in a different stack (ingress), we would make the connection like:
If Stack1 depends on Stack2
// Stack 1
Stack stack1;
Stack stack2;
var sg1 = new SecurityGroup(stack1, "SG1", new SecurityGroupProps {
AllowAllOutbound = false, // if this is `true` then no egress rule will be created
Vpc = vpc
});
// Stack 2
var sg2 = new SecurityGroup(stack2, "SG2", new SecurityGroupProps {
AllowAllOutbound = false, // if this is `true` then no egress rule will be created
Vpc = vpc
});
// `connections.allowTo` on `sg1` since we want the
// rules to be created in Stack1
sg1.Connections.AllowTo(sg2, Port.Tcp(3333));
In this case both the Ingress Rule for sg2
and the Egress Rule for sg1
will both be created
in Stack 1
which avoids the cyclic reference.
If Stack2 depends on Stack1
// Stack 1
Stack stack1;
Stack stack2;
var sg1 = new SecurityGroup(stack1, "SG1", new SecurityGroupProps {
AllowAllOutbound = false, // if this is `true` then no egress rule will be created
Vpc = vpc
});
// Stack 2
var sg2 = new SecurityGroup(stack2, "SG2", new SecurityGroupProps {
AllowAllOutbound = false, // if this is `true` then no egress rule will be created
Vpc = vpc
});
// `connections.allowFrom` on `sg2` since we want the
// rules to be created in Stack2
sg2.Connections.AllowFrom(sg1, Port.Tcp(3333));
In this case both the Ingress Rule for sg2
and the Egress Rule for sg1
will both be created
in Stack 2
which avoids the cyclic reference.
Machine Images (AMIs)
AMIs control the OS that gets launched when you start your EC2 instance. The EC2 library contains constructs to select the AMI you want to use.
Depending on the type of AMI, you select it a different way. Here are some examples of images you might want to use:
// Pick the right Amazon Linux edition. All arguments shown are optional
// and will default to these values when omitted.
var amznLinux = MachineImage.LatestAmazonLinux(new AmazonLinuxImageProps {
Generation = AmazonLinuxGeneration.AMAZON_LINUX,
Edition = AmazonLinuxEdition.STANDARD,
Virtualization = AmazonLinuxVirt.HVM,
Storage = AmazonLinuxStorage.GENERAL_PURPOSE,
CpuType = AmazonLinuxCpuType.X86_64
});
// Pick a Windows edition to use
var windows = MachineImage.LatestWindows(WindowsVersion.WINDOWS_SERVER_2019_ENGLISH_FULL_BASE);
// Read AMI id from SSM parameter store
var ssm = MachineImage.FromSsmParameter("/my/ami", new SsmParameterImageOptions { Os = OperatingSystemType.LINUX });
// Look up the most recent image matching a set of AMI filters.
// In this case, look up the NAT instance AMI, by using a wildcard
// in the 'name' field:
var natAmi = MachineImage.Lookup(new LookupMachineImageProps {
Name = "amzn-ami-vpc-nat-*",
Owners = new [] { "amazon" }
});
// For other custom (Linux) images, instantiate a `GenericLinuxImage` with
// a map giving the AMI to in for each region:
var linux = MachineImage.GenericLinux(new Dictionary<string, string> {
{ "us-east-1", "ami-97785bed" },
{ "eu-west-1", "ami-12345678" }
});
// For other custom (Windows) images, instantiate a `GenericWindowsImage` with
// a map giving the AMI to in for each region:
var genericWindows = MachineImage.GenericWindows(new Dictionary<string, string> {
{ "us-east-1", "ami-97785bed" },
{ "eu-west-1", "ami-12345678" }
});
NOTE: The AMIs selected by <code>MachineImage.lookup()</code> will be cached in
cdk.context.json
, so that your AutoScalingGroup instances aren't replaced while
you are making unrelated changes to your CDK app.
To query for the latest AMI again, remove the relevant cache entry from
cdk.context.json
, or use the cdk context
command. For more information, see
Runtime Context in the CDK
developer guide.
MachineImage.genericLinux()
, MachineImage.genericWindows()
will use CfnMapping
in
an agnostic stack.
Special VPC configurations
VPN connections to a VPC
Create your VPC with VPN connections by specifying the vpnConnections
props (keys are construct id
s):
using Amazon.CDK;
var vpc = new Vpc(this, "MyVpc", new VpcProps {
VpnConnections = new Dictionary<string, VpnConnectionOptions> {
{ "dynamic", new VpnConnectionOptions { // Dynamic routing (BGP)
Ip = "1.2.3.4",
TunnelOptions = new [] { new VpnTunnelOption {
PreSharedKeySecret = SecretValue.UnsafePlainText("secretkey1234")
}, new VpnTunnelOption {
PreSharedKeySecret = SecretValue.UnsafePlainText("secretkey5678")
} } } },
{ "static", new VpnConnectionOptions { // Static routing
Ip = "4.5.6.7",
StaticRoutes = new [] { "192.168.10.0/24", "192.168.20.0/24" } } }
}
});
To create a VPC that can accept VPN connections, set vpnGateway
to true
:
var vpc = new Vpc(this, "MyVpc", new VpcProps {
VpnGateway = true
});
VPN connections can then be added:
vpc.AddVpnConnection("Dynamic", new VpnConnectionOptions {
Ip = "1.2.3.4"
});
By default, routes will be propagated on the route tables associated with the private subnets. If no
private subnets exist, isolated subnets are used. If no isolated subnets exist, public subnets are
used. Use the Vpc
property vpnRoutePropagation
to customize this behavior.
VPN connections expose metrics (cloudwatch.Metric) across all tunnels in the account/region and per connection:
// Across all tunnels in the account/region
var allDataOut = VpnConnection.MetricAllTunnelDataOut();
// For a specific vpn connection
var vpnConnection = vpc.AddVpnConnection("Dynamic", new VpnConnectionOptions {
Ip = "1.2.3.4"
});
var state = vpnConnection.MetricTunnelState();
VPC endpoints
A VPC endpoint enables you to privately connect your VPC to supported AWS services and VPC endpoint services powered by PrivateLink without requiring an internet gateway, NAT device, VPN connection, or AWS Direct Connect connection. Instances in your VPC do not require public IP addresses to communicate with resources in the service. Traffic between your VPC and the other service does not leave the Amazon network.
Endpoints are virtual devices. They are horizontally scaled, redundant, and highly available VPC components that allow communication between instances in your VPC and services without imposing availability risks or bandwidth constraints on your network traffic.
// Add gateway endpoints when creating the VPC
var vpc = new Vpc(this, "MyVpc", new VpcProps {
GatewayEndpoints = new Dictionary<string, GatewayVpcEndpointOptions> {
{ "S3", new GatewayVpcEndpointOptions {
Service = GatewayVpcEndpointAwsService.S3
} }
}
});
// Alternatively gateway endpoints can be added on the VPC
var dynamoDbEndpoint = vpc.AddGatewayEndpoint("DynamoDbEndpoint", new GatewayVpcEndpointOptions {
Service = GatewayVpcEndpointAwsService.DYNAMODB
});
// This allows to customize the endpoint policy
dynamoDbEndpoint.AddToPolicy(
new PolicyStatement(new PolicyStatementProps { // Restrict to listing and describing tables
Principals = new [] { new AnyPrincipal() },
Actions = new [] { "dynamodb:DescribeTable", "dynamodb:ListTables" },
Resources = new [] { "*" } }));
// Add an interface endpoint
vpc.AddInterfaceEndpoint("EcrDockerEndpoint", new InterfaceVpcEndpointOptions {
Service = InterfaceVpcEndpointAwsService.ECR_DOCKER
});
By default, CDK will place a VPC endpoint in one subnet per AZ. If you wish to override the AZs CDK places the VPC endpoint in,
use the subnets
parameter as follows:
Vpc vpc;
new InterfaceVpcEndpoint(this, "VPC Endpoint", new InterfaceVpcEndpointProps {
Vpc = vpc,
Service = new InterfaceVpcEndpointService("com.amazonaws.vpce.us-east-1.vpce-svc-uuddlrlrbastrtsvc", 443),
// Choose which availability zones to place the VPC endpoint in, based on
// available AZs
Subnets = new SubnetSelection {
AvailabilityZones = new [] { "us-east-1a", "us-east-1c" }
}
});
Per the AWS documentation, not all
VPC endpoint services are available in all AZs. If you specify the parameter lookupSupportedAzs
, CDK attempts to discover which
AZs an endpoint service is available in, and will ensure the VPC endpoint is not placed in a subnet that doesn't match those AZs.
These AZs will be stored in cdk.context.json.
Vpc vpc;
new InterfaceVpcEndpoint(this, "VPC Endpoint", new InterfaceVpcEndpointProps {
Vpc = vpc,
Service = new InterfaceVpcEndpointService("com.amazonaws.vpce.us-east-1.vpce-svc-uuddlrlrbastrtsvc", 443),
// Choose which availability zones to place the VPC endpoint in, based on
// available AZs
LookupSupportedAzs = true
});
Pre-defined AWS services are defined in the InterfaceVpcEndpointAwsService class, and can be used to create VPC endpoints without having to configure name, ports, etc. For example, a Keyspaces endpoint can be created for use in your VPC:
Vpc vpc;
new InterfaceVpcEndpoint(this, "VPC Endpoint", new InterfaceVpcEndpointProps {
Vpc = vpc,
Service = InterfaceVpcEndpointAwsService.KEYSPACES
});
Security groups for interface VPC endpoints
By default, interface VPC endpoints create a new security group and all traffic to the endpoint from within the VPC will be automatically allowed.
Use the connections
object to allow other traffic to flow to the endpoint:
InterfaceVpcEndpoint myEndpoint;
myEndpoint.Connections.AllowDefaultPortFromAnyIpv4();
Alternatively, existing security groups can be used by specifying the securityGroups
prop.
VPC endpoint services
A VPC endpoint service enables you to expose a Network Load Balancer(s) as a provider service to consumers, who connect to your service over a VPC endpoint. You can restrict access to your service via allowed principals (anything that extends ArnPrincipal), and require that new connections be manually accepted. You can also enable Contributor Insight rules.
NetworkLoadBalancer networkLoadBalancer1;
NetworkLoadBalancer networkLoadBalancer2;
new VpcEndpointService(this, "EndpointService", new VpcEndpointServiceProps {
VpcEndpointServiceLoadBalancers = new [] { networkLoadBalancer1, networkLoadBalancer2 },
AcceptanceRequired = true,
AllowedPrincipals = new [] { new ArnPrincipal("arn:aws:iam::123456789012:root") },
ContributorInsights = true
});
You can also include a service principal in the allowedPrincipals
property by specifying it as a parameter to the ArnPrincipal
constructor.
The resulting VPC endpoint will have an allowlisted principal of type Service
, instead of Arn
for that item in the list.
NetworkLoadBalancer networkLoadBalancer;
new VpcEndpointService(this, "EndpointService", new VpcEndpointServiceProps {
VpcEndpointServiceLoadBalancers = new [] { networkLoadBalancer },
AllowedPrincipals = new [] { new ArnPrincipal("ec2.amazonaws.com") }
});
Endpoint services support private DNS, which makes it easier for clients to connect to your service by automatically setting up DNS in their VPC. You can enable private DNS on an endpoint service like so:
using Amazon.CDK.AWS.Route53;
PublicHostedZone zone;
VpcEndpointService vpces;
new VpcEndpointServiceDomainName(this, "EndpointDomain", new VpcEndpointServiceDomainNameProps {
EndpointService = vpces,
DomainName = "my-stuff.aws-cdk.dev",
PublicHostedZone = zone
});
Note: The domain name must be owned (registered through Route53) by the account the endpoint service is in, or delegated to the account. The VpcEndpointServiceDomainName will handle the AWS side of domain verification, the process for which can be found here
Client VPN endpoint
AWS Client VPN is a managed client-based VPN service that enables you to securely access your AWS resources and resources in your on-premises network. With Client VPN, you can access your resources from any location using an OpenVPN-based VPN client.
Use the addClientVpnEndpoint()
method to add a client VPN endpoint to a VPC:
vpc.AddClientVpnEndpoint("Endpoint", new ClientVpnEndpointOptions {
Cidr = "10.100.0.0/16",
ServerCertificateArn = "arn:aws:acm:us-east-1:123456789012:certificate/server-certificate-id",
// Mutual authentication
ClientCertificateArn = "arn:aws:acm:us-east-1:123456789012:certificate/client-certificate-id",
// User-based authentication
UserBasedAuthentication = ClientVpnUserBasedAuthentication.Federated(samlProvider)
});
The endpoint must use at least one authentication method:
If user-based authentication is used, the self-service portal URL is made available via a CloudFormation output.
By default, a new security group is created, and logging is enabled. Moreover, a rule to authorize all users to the VPC CIDR is created.
To customize authorization rules, set the authorizeAllUsersToVpcCidr
prop to false
and use addAuthorizationRule()
:
var endpoint = vpc.AddClientVpnEndpoint("Endpoint", new ClientVpnEndpointOptions {
Cidr = "10.100.0.0/16",
ServerCertificateArn = "arn:aws:acm:us-east-1:123456789012:certificate/server-certificate-id",
UserBasedAuthentication = ClientVpnUserBasedAuthentication.Federated(samlProvider),
AuthorizeAllUsersToVpcCidr = false
});
endpoint.AddAuthorizationRule("Rule", new ClientVpnAuthorizationRuleOptions {
Cidr = "10.0.10.0/32",
GroupId = "group-id"
});
Use addRoute()
to configure network routes:
var endpoint = vpc.AddClientVpnEndpoint("Endpoint", new ClientVpnEndpointOptions {
Cidr = "10.100.0.0/16",
ServerCertificateArn = "arn:aws:acm:us-east-1:123456789012:certificate/server-certificate-id",
UserBasedAuthentication = ClientVpnUserBasedAuthentication.Federated(samlProvider)
});
// Client-to-client access
endpoint.AddRoute("Route", new ClientVpnRouteOptions {
Cidr = "10.100.0.0/16",
Target = ClientVpnRouteTarget.Local()
});
Use the connections
object of the endpoint to allow traffic to other security groups.
Instances
You can use the Instance
class to start up a single EC2 instance. For production setups, we recommend
you use an AutoScalingGroup
from the aws-autoscaling
module instead, as AutoScalingGroups will take
care of restarting your instance if it ever fails.
Vpc vpc;
InstanceType instanceType;
// Amazon Linux 2
// Amazon Linux 2
new Instance(this, "Instance2", new InstanceProps {
Vpc = vpc,
InstanceType = instanceType,
MachineImage = MachineImage.LatestAmazonLinux2()
});
// Amazon Linux 2 with kernel 5.x
// Amazon Linux 2 with kernel 5.x
new Instance(this, "Instance3", new InstanceProps {
Vpc = vpc,
InstanceType = instanceType,
MachineImage = MachineImage.LatestAmazonLinux2(new AmazonLinux2ImageSsmParameterProps {
Kernel = AmazonLinux2Kernel.KERNEL_5_10
})
});
// Amazon Linux 2023
// Amazon Linux 2023
new Instance(this, "Instance4", new InstanceProps {
Vpc = vpc,
InstanceType = instanceType,
MachineImage = MachineImage.LatestAmazonLinux2023()
});
// Graviton 3 Processor
// Graviton 3 Processor
new Instance(this, "Instance5", new InstanceProps {
Vpc = vpc,
InstanceType = InstanceType.Of(InstanceClass.C7G, InstanceSize.LARGE),
MachineImage = MachineImage.LatestAmazonLinux2023(new AmazonLinux2023ImageSsmParameterProps {
CpuType = AmazonLinuxCpuType.ARM_64
})
});
Latest Amazon Linux Images
Rather than specifying a specific AMI ID to use, it is possible to specify a SSM
Parameter that contains the AMI ID. AWS publishes a set of public parameters
that contain the latest Amazon Linux AMIs. To make it easier to query a
particular image parameter, the CDK provides a couple of constructs AmazonLinux2ImageSsmParameter
,
AmazonLinux2022ImageSsmParameter
, & AmazonLinux2023SsmParameter
. For example
to use the latest al2023
image:
Vpc vpc;
new Instance(this, "LatestAl2023", new InstanceProps {
Vpc = vpc,
InstanceType = InstanceType.Of(InstanceClass.C7G, InstanceSize.LARGE),
MachineImage = MachineImage.LatestAmazonLinux2023()
});
Warning Since this retrieves the value from an SSM parameter at deployment time, the value will be resolved each time the stack is deployed. This means that if the parameter contains a different value on your next deployment, the instance will be replaced.
It is also possible to perform the lookup once at synthesis time and then cache the value in CDK context. This way the value will not change on future deployments unless you manually refresh the context.
Vpc vpc;
new Instance(this, "LatestAl2023", new InstanceProps {
Vpc = vpc,
InstanceType = InstanceType.Of(InstanceClass.C7G, InstanceSize.LARGE),
MachineImage = MachineImage.LatestAmazonLinux2023(new AmazonLinux2023ImageSsmParameterProps {
CachedInContext = true
})
});
// or
// or
new Instance(this, "LatestAl2023", new InstanceProps {
Vpc = vpc,
InstanceType = InstanceType.Of(InstanceClass.C7G, InstanceSize.LARGE),
// context cache is turned on by default
MachineImage = new AmazonLinux2023ImageSsmParameter()
});
Kernel Versions
Each Amazon Linux AMI uses a specific kernel version. Most Amazon Linux generations come with an AMI using the "default" kernel and then 1 or more AMIs using a specific kernel version, which may or may not be different from the default kernel version.
For example, Amazon Linux 2 has two different AMIs available from the SSM parameters.
If a new Amazon Linux generation AMI is published with a new kernel version,
then a new SSM parameter will be created with the new version
(e.g. /aws/service/ami-amazon-linux-latest/amzn2-ami-kernel-5.15-hvm-x86_64-ebs
),
but the "default" AMI may or may not be updated.
If you would like to make sure you always have the latest kernel version, then either specify the specific latest kernel version or opt-in to using the CDK latest kernel version.
Vpc vpc;
new Instance(this, "LatestAl2023", new InstanceProps {
Vpc = vpc,
InstanceType = InstanceType.Of(InstanceClass.C7G, InstanceSize.LARGE),
// context cache is turned on by default
MachineImage = new AmazonLinux2023ImageSsmParameter(new AmazonLinux2023ImageSsmParameterProps {
Kernel = AmazonLinux2023Kernel.KERNEL_6_1
})
});
CDK managed latest
Vpc vpc;
new Instance(this, "LatestAl2023", new InstanceProps {
Vpc = vpc,
InstanceType = InstanceType.Of(InstanceClass.C7G, InstanceSize.LARGE),
// context cache is turned on by default
MachineImage = new AmazonLinux2023ImageSsmParameter(new AmazonLinux2023ImageSsmParameterProps {
Kernel = AmazonLinux2023Kernel.CDK_LATEST
})
});
// or
// or
new Instance(this, "LatestAl2023", new InstanceProps {
Vpc = vpc,
InstanceType = InstanceType.Of(InstanceClass.C7G, InstanceSize.LARGE),
MachineImage = MachineImage.LatestAmazonLinux2023()
});
When using the CDK managed latest version, when a new kernel version is made
available the LATEST
will be updated to point to the new kernel version. You
then would be required to update the newest CDK version for it to take effect.
Configuring Instances using CloudFormation Init (cfn-init)
CloudFormation Init allows you to configure your instances by writing files to them, installing software
packages, starting services and running arbitrary commands. By default, if any of the instance setup
commands throw an error; the deployment will fail and roll back to the previously known good state.
The following documentation also applies to AutoScalingGroup
s.
For the full set of capabilities of this system, see the documentation for
AWS::CloudFormation::Init
.
Here is an example of applying some configuration to an instance:
Vpc vpc;
InstanceType instanceType;
IMachineImage machineImage;
new Instance(this, "Instance", new InstanceProps {
Vpc = vpc,
InstanceType = instanceType,
MachineImage = machineImage,
// Showing the most complex setup, if you have simpler requirements
// you can use `CloudFormationInit.fromElements()`.
Init = CloudFormationInit.FromConfigSets(new ConfigSetProps {
ConfigSets = new Dictionary<string, string[]> {
// Applies the configs below in this order
{ "default", new [] { "yumPreinstall", "config" } }
},
Configs = new Dictionary<string, InitConfig> {
{ "yumPreinstall", new InitConfig(new [] { InitPackage.Yum("git") }) },
{ "config", new InitConfig(new [] { InitFile.FromObject("/etc/stack.json", new Dictionary<string, object> {
{ "stackId", Stack.Of(this).StackId },
{ "stackName", Stack.Of(this).StackName },
{ "region", Stack.Of(this).Region }
}), InitGroup.FromName("my-group"), InitUser.FromName("my-user"), InitPackage.Rpm("http://mirrors.ukfast.co.uk/sites/dl.fedoraproject.org/pub/epel/8/Everything/x86_64/Packages/r/rubygem-git-1.5.0-2.el8.noarch.rpm") }) }
}
}),
InitOptions = new ApplyCloudFormationInitOptions {
// Optional, which configsets to activate (['default'] by default)
ConfigSets = new [] { "default" },
// Optional, how long the installation is expected to take (5 minutes by default)
Timeout = Duration.Minutes(30),
// Optional, whether to include the --url argument when running cfn-init and cfn-signal commands (false by default)
IncludeUrl = true,
// Optional, whether to include the --role argument when running cfn-init and cfn-signal commands (false by default)
IncludeRole = true
}
});
InitCommand
can not be used to start long-running processes. At deploy time,
cfn-init
will always wait for the process to exit before continuing, causing
the CloudFormation deployment to fail because the signal hasn't been received
within the expected timeout.
Instead, you should install a service configuration file onto your machine InitFile
,
and then use InitService
to start it.
If your Linux OS is using SystemD (like Amazon Linux 2 or higher), the CDK has
helpers to create a long-running service using CFN Init. You can create a
SystemD-compatible config file using InitService.systemdConfigFile()
, and
start it immediately. The following examples shows how to start a trivial Python
3 web server:
Vpc vpc;
InstanceType instanceType;
new Instance(this, "Instance", new InstanceProps {
Vpc = vpc,
InstanceType = instanceType,
MachineImage = MachineImage.LatestAmazonLinux2023(),
Init = CloudFormationInit.FromElements(InitService.SystemdConfigFile("simpleserver", new SystemdConfigFileOptions {
Command = "/usr/bin/python3 -m http.server 8080",
Cwd = "/var/www/html"
}), InitService.Enable("simpleserver", new InitServiceOptions {
ServiceManager = ServiceManager.SYSTEMD
}), InitFile.FromString("/var/www/html/index.html", "Hello! It's working!"))
});
You can have services restarted after the init process has made changes to the system.
To do that, instantiate an InitServiceRestartHandle
and pass it to the config elements
that need to trigger the restart and the service itself. For example, the following
config writes a config file for nginx, extracts an archive to the root directory, and then
restarts nginx so that it picks up the new config and files:
Bucket myBucket;
var handle = new InitServiceRestartHandle();
CloudFormationInit.FromElements(InitFile.FromString("/etc/nginx/nginx.conf", "...", new InitFileOptions { ServiceRestartHandles = new [] { handle } }), InitSource.FromS3Object("/var/www/html", myBucket, "html.zip", new InitSourceOptions { ServiceRestartHandles = new [] { handle } }), InitService.Enable("nginx", new InitServiceOptions {
ServiceRestartHandle = handle
}));
You can use the environmentVariables
or environmentFiles
parameters to specify environment variables
for your services:
new InitConfig(new [] { InitFile.FromString("/myvars.env", "VAR_FROM_FILE=\"VAR_FROM_FILE\""), InitService.SystemdConfigFile("myapp", new SystemdConfigFileOptions {
Command = "/usr/bin/python3 -m http.server 8080",
Cwd = "/var/www/html",
EnvironmentVariables = new Dictionary<string, string> {
{ "MY_VAR", "MY_VAR" }
},
EnvironmentFiles = new [] { "/myvars.env" }
}) });
Bastion Hosts
A bastion host functions as an instance used to access servers and resources in a VPC without open up the complete VPC on a network level. You can use bastion hosts using a standard SSH connection targeting port 22 on the host. As an alternative, you can connect the SSH connection feature of AWS Systems Manager Session Manager, which does not need an opened security group. (https://aws.amazon.com/about-aws/whats-new/2019/07/session-manager-launches-tunneling-support-for-ssh-and-scp/)
A default bastion host for use via SSM can be configured like:
var host = new BastionHostLinux(this, "BastionHost", new BastionHostLinuxProps { Vpc = vpc });
If you want to connect from the internet using SSH, you need to place the host into a public subnet. You can then configure allowed source hosts.
var host = new BastionHostLinux(this, "BastionHost", new BastionHostLinuxProps {
Vpc = vpc,
SubnetSelection = new SubnetSelection { SubnetType = SubnetType.PUBLIC }
});
host.AllowSshAccessFrom(Peer.Ipv4("1.2.3.4/32"));
As there are no SSH public keys deployed on this machine, you need to use EC2 Instance Connect
with the command aws ec2-instance-connect send-ssh-public-key
to provide your SSH public key.
EBS volume for the bastion host can be encrypted like:
var host = new BastionHostLinux(this, "BastionHost", new BastionHostLinuxProps {
Vpc = vpc,
BlockDevices = new [] { new BlockDevice {
DeviceName = "/dev/sdh",
Volume = BlockDeviceVolume.Ebs(10, new EbsDeviceOptions {
Encrypted = true
})
} }
});
Placement Group
Specify placementGroup
to enable the placement group support:
InstanceType instanceType;
var pg = new PlacementGroup(this, "test-pg", new PlacementGroupProps {
Strategy = PlacementGroupStrategy.SPREAD
});
new Instance(this, "Instance", new InstanceProps {
Vpc = vpc,
InstanceType = instanceType,
MachineImage = MachineImage.LatestAmazonLinux2023(),
PlacementGroup = pg
});
Block Devices
To add EBS block device mappings, specify the blockDevices
property. The following example sets the EBS-backed
root device (/dev/sda1
) size to 50 GiB, and adds another EBS-backed device mapped to /dev/sdm
that is 100 GiB in
size:
Vpc vpc;
InstanceType instanceType;
IMachineImage machineImage;
new Instance(this, "Instance", new InstanceProps {
Vpc = vpc,
InstanceType = instanceType,
MachineImage = machineImage,
// ...
BlockDevices = new [] { new BlockDevice {
DeviceName = "/dev/sda1",
Volume = BlockDeviceVolume.Ebs(50)
}, new BlockDevice {
DeviceName = "/dev/sdm",
Volume = BlockDeviceVolume.Ebs(100)
} }
});
It is also possible to encrypt the block devices. In this example we will create an customer managed key encrypted EBS-backed root device:
using Amazon.CDK.AWS.KMS;
Vpc vpc;
InstanceType instanceType;
IMachineImage machineImage;
var kmsKey = new Key(this, "KmsKey");
new Instance(this, "Instance", new InstanceProps {
Vpc = vpc,
InstanceType = instanceType,
MachineImage = machineImage,
// ...
BlockDevices = new [] { new BlockDevice {
DeviceName = "/dev/sda1",
Volume = BlockDeviceVolume.Ebs(50, new EbsDeviceOptions {
Encrypted = true,
KmsKey = kmsKey
})
} }
});
To specify the throughput value for gp3
volumes, use the throughput
property:
Vpc vpc;
InstanceType instanceType;
IMachineImage machineImage;
new Instance(this, "Instance", new InstanceProps {
Vpc = vpc,
InstanceType = instanceType,
MachineImage = machineImage,
// ...
BlockDevices = new [] { new BlockDevice {
DeviceName = "/dev/sda1",
Volume = BlockDeviceVolume.Ebs(100, new EbsDeviceOptions {
VolumeType = EbsDeviceVolumeType.GP3,
Throughput = 250
})
} }
});
EBS Optimized Instances
An Amazon EBS–optimized instance uses an optimized configuration stack and provides additional, dedicated capacity for Amazon EBS I/O. This optimization provides the best performance for your EBS volumes by minimizing contention between Amazon EBS I/O and other traffic from your instance.
Depending on the instance type, this features is enabled by default while others require explicit activation. Please refer to the documentation for details.
Vpc vpc;
InstanceType instanceType;
IMachineImage machineImage;
new Instance(this, "Instance", new InstanceProps {
Vpc = vpc,
InstanceType = instanceType,
MachineImage = machineImage,
EbsOptimized = true,
BlockDevices = new [] { new BlockDevice {
DeviceName = "/dev/xvda",
Volume = BlockDeviceVolume.Ebs(8)
} }
});
Volumes
Whereas a BlockDeviceVolume
is an EBS volume that is created and destroyed as part of the creation and destruction of a specific instance. A Volume
is for when you want an EBS volume separate from any particular instance. A Volume
is an EBS block device that can be attached to, or detached from, any instance at any time. Some types of Volume
s can also be attached to multiple instances at the same time to allow you to have shared storage between those instances.
A notable restriction is that a Volume can only be attached to instances in the same availability zone as the Volume itself.
The following demonstrates how to create a 500 GiB encrypted Volume in the us-west-2a
availability zone, and give a role the ability to attach that Volume to a specific instance:
Instance instance;
Role role;
var volume = new Volume(this, "Volume", new VolumeProps {
AvailabilityZone = "us-west-2a",
Size = Size.Gibibytes(500),
Encrypted = true
});
volume.GrantAttachVolume(role, new [] { instance });
Instances Attaching Volumes to Themselves
If you need to grant an instance the ability to attach/detach an EBS volume to/from itself, then using grantAttachVolume
and grantDetachVolume
as outlined above
will lead to an unresolvable circular reference between the instance role and the instance. In this case, use grantAttachVolumeByResourceTag
and grantDetachVolumeByResourceTag
as follows:
Instance instance;
Volume volume;
var attachGrant = volume.GrantAttachVolumeByResourceTag(instance.GrantPrincipal, new [] { instance });
var detachGrant = volume.GrantDetachVolumeByResourceTag(instance.GrantPrincipal, new [] { instance });
Attaching Volumes
The Amazon EC2 documentation for Linux Instances and Windows Instances contains information on how to attach and detach your Volumes to/from instances, and how to format them for use.
The following is a sample skeleton of EC2 UserData that can be used to attach a Volume to the Linux instance that it is running on:
Instance instance;
Volume volume;
volume.GrantAttachVolumeByResourceTag(instance.GrantPrincipal, new [] { instance });
var targetDevice = "/dev/xvdz";
instance.UserData.AddCommands("TOKEN=$(curl -SsfX PUT \"http://169.254.169.254/latest/api/token\" -H \"X-aws-ec2-metadata-token-ttl-seconds: 21600\")", "INSTANCE_ID=$(curl -SsfH \"X-aws-ec2-metadata-token: $TOKEN\" http://169.254.169.254/latest/meta-data/instance-id)", $"aws --region {Stack.of(this).region} ec2 attach-volume --volume-id {volume.volumeId} --instance-id $INSTANCE_ID --device {targetDevice}", $"while ! test -e {targetDevice}; do sleep 1; done");
Tagging Volumes
You can configure tag propagation on volume creation.
Vpc vpc;
InstanceType instanceType;
IMachineImage machineImage;
new Instance(this, "Instance", new InstanceProps {
Vpc = vpc,
MachineImage = machineImage,
InstanceType = instanceType,
PropagateTagsToVolumeOnCreation = true
});
Throughput on GP3 Volumes
You can specify the throughput
of a GP3 volume from 125 (default) to 1000.
new Volume(this, "Volume", new VolumeProps {
AvailabilityZone = "us-east-1a",
Size = Size.Gibibytes(125),
VolumeType = EbsDeviceVolumeType.GP3,
Throughput = 125
});
Configuring Instance Metadata Service (IMDS)
Toggling IMDSv1
You can configure EC2 Instance Metadata Service options to either allow both IMDSv1 and IMDSv2 or enforce IMDSv2 when interacting with the IMDS.
To do this for a single Instance
, you can use the requireImdsv2
property.
The example below demonstrates IMDSv2 being required on a single Instance
:
Vpc vpc;
InstanceType instanceType;
IMachineImage machineImage;
new Instance(this, "Instance", new InstanceProps {
Vpc = vpc,
InstanceType = instanceType,
MachineImage = machineImage,
// ...
RequireImdsv2 = true
});
You can also use the either the InstanceRequireImdsv2Aspect
for EC2 instances or the LaunchTemplateRequireImdsv2Aspect
for EC2 launch templates
to apply the operation to multiple instances or launch templates, respectively.
The following example demonstrates how to use the InstanceRequireImdsv2Aspect
to require IMDSv2 for all EC2 instances in a stack:
var aspect = new InstanceRequireImdsv2Aspect();
Aspects.Of(this).Add(aspect);
Associating a Public IP Address with an Instance
All subnets have an attribute that determines whether instances launched into that subnet are assigned a public IPv4 address. This attribute is set to true by default for default public subnets. Thus, an EC2 instance launched into a default public subnet will be assigned a public IPv4 address. Nondefault public subnets have this attribute set to false by default and any EC2 instance launched into a nondefault public subnet will not be assigned a public IPv4 address automatically. To automatically assign a public IPv4 address to an instance launched into a nondefault public subnet, you can set the associatePublicIpAddress
property on the Instance
construct to true. Alternatively, to not automatically assign a public IPv4 address to an instance launched into a default public subnet, you can set associatePublicIpAddress
to false. Including this property, removing this property, or updating the value of this property on an existing instance will result in replacement of the instance.
var vpc = new Vpc(this, "VPC", new VpcProps {
Cidr = "10.0.0.0/16",
NatGateways = 0,
MaxAzs = 3,
SubnetConfiguration = new [] { new SubnetConfiguration {
Name = "public-subnet-1",
SubnetType = SubnetType.PUBLIC,
CidrMask = 24
} }
});
var instance = new Instance(this, "Instance", new InstanceProps {
Vpc = vpc,
VpcSubnets = new SubnetSelection { SubnetGroupName = "public-subnet-1" },
InstanceType = InstanceType.Of(InstanceClass.T3, InstanceSize.NANO),
MachineImage = new AmazonLinuxImage(new AmazonLinuxImageProps { Generation = AmazonLinuxGeneration.AMAZON_LINUX_2 }),
DetailedMonitoring = true,
AssociatePublicIpAddress = true
});
Specifying a key pair
To allow SSH access to an EC2 instance by default, a Key Pair must be specified. Key pairs can
be provided with the keyPair
property to instances and launch templates. You can create a
key pair for an instance like this:
Vpc vpc;
InstanceType instanceType;
var keyPair = new KeyPair(this, "KeyPair", new KeyPairProps {
Type = KeyPairType.ED25519,
Format = KeyPairFormat.PEM
});
var instance = new Instance(this, "Instance", new InstanceProps {
Vpc = vpc,
InstanceType = instanceType,
MachineImage = MachineImage.LatestAmazonLinux2023(),
// Use the custom key pair
KeyPair = keyPair
});
When a new EC2 Key Pair is created (without imported material), the private key material is automatically stored in Systems Manager Parameter Store. This can be retrieved from the key pair construct:
var keyPair = new KeyPair(this, "KeyPair");
var privateKey = keyPair.PrivateKey;
If you already have an SSH key that you wish to use in EC2, that can be provided when constructing the
KeyPair
. If public key material is provided, the key pair is considered "imported" and there
will not be any data automatically stored in Systems Manager Parameter Store and the type
property
cannot be specified for the key pair.
var keyPair = new KeyPair(this, "KeyPair", new KeyPairProps {
PublicKeyMaterial = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIB7jpNzG+YG0s+xIGWbxrxIZiiozHOEuzIJacvASP0mq"
});
Using an existing EC2 Key Pair
If you already have an EC2 Key Pair created outside of the CDK, you can import that key to your CDK stack.
You can import it purely by name:
var keyPair = KeyPair.FromKeyPairName(this, "KeyPair", "the-keypair-name");
Or by specifying additional attributes:
var keyPair = KeyPair.FromKeyPairAttributes(this, "KeyPair", new KeyPairAttributes {
KeyPairName = "the-keypair-name",
Type = KeyPairType.RSA
});
Using IPv6 IPs
Instances can be given IPv6 IPs by launching them into a subnet of a dual stack VPC.
var vpc = new Vpc(this, "Ip6VpcDualStack", new VpcProps {
IpProtocol = IpProtocol.DUAL_STACK,
SubnetConfiguration = new [] { new SubnetConfiguration {
Name = "Public",
SubnetType = SubnetType.PUBLIC,
MapPublicIpOnLaunch = true
}, new SubnetConfiguration {
Name = "Private",
SubnetType = SubnetType.PRIVATE_ISOLATED
} }
});
var instance = new Instance(this, "MyInstance", new InstanceProps {
InstanceType = InstanceType.Of(InstanceClass.T2, InstanceSize.MICRO),
MachineImage = MachineImage.LatestAmazonLinux2(),
Vpc = vpc,
VpcSubnets = new SubnetSelection { SubnetType = SubnetType.PUBLIC },
AllowAllIpv6Outbound = true
});
instance.Connections.AllowFrom(Peer.AnyIpv6(), Port.AllIcmpV6(), "allow ICMPv6");
Note to set mapPublicIpOnLaunch
to true in the subnetConfiguration
.
Additionally, IPv6 support varies by instance type. Most instance types have IPv6 support with exception of m1-m3, c1, g2, and t1.micro. A full list can be found here: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html#AvailableIpPerENI.
Specifying the IPv6 Address
If you want to specify the number of IPv6 addresses to assign to the instance, you can use the ipv6AddresseCount
property:
// dual stack VPC
Vpc vpc;
var instance = new Instance(this, "MyInstance", new InstanceProps {
InstanceType = InstanceType.Of(InstanceClass.M5, InstanceSize.LARGE),
MachineImage = MachineImage.LatestAmazonLinux2(),
Vpc = vpc,
VpcSubnets = new SubnetSelection { SubnetType = SubnetType.PUBLIC },
// Assign 2 IPv6 addresses to the instance
Ipv6AddressCount = 2
});
Credit configuration modes for burstable instances
You can set the credit configuration mode for burstable instances (T2, T3, T3a and T4g instance types):
Vpc vpc;
var instance = new Instance(this, "Instance", new InstanceProps {
InstanceType = InstanceType.Of(InstanceClass.T3, InstanceSize.MICRO),
MachineImage = MachineImage.LatestAmazonLinux2(),
Vpc = vpc,
CreditSpecification = CpuCredits.STANDARD
});
It is also possible to set the credit configuration mode for NAT instances.
var natInstanceProvider = NatProvider.Instance(new NatInstanceProps {
InstanceType = InstanceType.Of(InstanceClass.T4G, InstanceSize.LARGE),
MachineImage = new AmazonLinuxImage(),
CreditSpecification = CpuCredits.UNLIMITED
});
new Vpc(this, "VPC", new VpcProps {
NatGatewayProvider = natInstanceProvider
});
Note: CpuCredits.UNLIMITED
mode is not supported for T3 instances that are launched on a Dedicated Host.
Shutdown behavior
You can specify the behavior of the instance when you initiate shutdown from the instance (using the operating system command for system shutdown).
Vpc vpc;
new Instance(this, "Instance", new InstanceProps {
Vpc = vpc,
InstanceType = InstanceType.Of(InstanceClass.T3, InstanceSize.NANO),
MachineImage = new AmazonLinuxImage(new AmazonLinuxImageProps { Generation = AmazonLinuxGeneration.AMAZON_LINUX_2 }),
InstanceInitiatedShutdownBehavior = InstanceInitiatedShutdownBehavior.TERMINATE
});
Enabling Nitro Enclaves
You can enable AWS Nitro Enclaves for
your EC2 instances by setting the enclaveEnabled
property to true
. Nitro Enclaves is a feature of
AWS Nitro System that enables creating isolated and highly constrained CPU environments known as enclaves.
Vpc vpc;
var instance = new Instance(this, "Instance", new InstanceProps {
InstanceType = InstanceType.Of(InstanceClass.M5, InstanceSize.XLARGE),
MachineImage = new AmazonLinuxImage(),
Vpc = vpc,
EnclaveEnabled = true
});
NOTE: You must use an instance type and operating system that support Nitro Enclaves.
For more information, see <a href="https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html#nitro-enclave-reqs">Requirements</a>.
Enabling Instance Hibernation
You can enable Instance Hibernation for
your EC2 instances by setting the hibernationEnabled
property to true
. Instance Hibernation saves the
instance's in-memory (RAM) state when an instance is stopped, and restores that state when the instance is started.
Vpc vpc;
var instance = new Instance(this, "Instance", new InstanceProps {
InstanceType = InstanceType.Of(InstanceClass.M5, InstanceSize.XLARGE),
MachineImage = new AmazonLinuxImage(),
Vpc = vpc,
HibernationEnabled = true,
BlockDevices = new [] { new BlockDevice {
DeviceName = "/dev/xvda",
Volume = BlockDeviceVolume.Ebs(30, new EbsDeviceOptions {
VolumeType = EbsDeviceVolumeType.GP3,
Encrypted = true,
DeleteOnTermination = true
})
} }
});
NOTE: You must use an instance and a volume that meet the requirements for hibernation.
For more information, see <a href="https://docs.aws.amazon.com/enclaves/latest/user/nitro-enclave.html#nitro-enclave-reqs">Prerequisites for Amazon EC2 instance hibernation</a>.
VPC Flow Logs
VPC Flow Logs is a feature that enables you to capture information about the IP traffic going to and from network interfaces in your VPC. Flow log data can be published to Amazon CloudWatch Logs and Amazon S3. After you've created a flow log, you can retrieve and view its data in the chosen destination. (https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs.html).
By default, a flow log will be created with CloudWatch Logs as the destination.
You can create a flow log like this:
Vpc vpc;
new FlowLog(this, "FlowLog", new FlowLogProps {
ResourceType = FlowLogResourceType.FromVpc(vpc)
});
Or you can add a Flow Log to a VPC by using the addFlowLog method like this:
var vpc = new Vpc(this, "Vpc");
vpc.AddFlowLog("FlowLog");
You can also add multiple flow logs with different destinations.
var vpc = new Vpc(this, "Vpc");
vpc.AddFlowLog("FlowLogS3", new FlowLogOptions {
Destination = FlowLogDestination.ToS3()
});
// Only reject traffic and interval every minute.
vpc.AddFlowLog("FlowLogCloudWatch", new FlowLogOptions {
TrafficType = FlowLogTrafficType.REJECT,
MaxAggregationInterval = FlowLogMaxAggregationInterval.ONE_MINUTE
});
To create a Transit Gateway flow log, you can use the fromTransitGatewayId
method:
CfnTransitGateway tgw;
new FlowLog(this, "TransitGatewayFlowLog", new FlowLogProps {
ResourceType = FlowLogResourceType.FromTransitGatewayId(tgw.Ref)
});
To create a Transit Gateway Attachment flow log, you can use the fromTransitGatewayAttachmentId
method:
CfnTransitGatewayAttachment tgwAttachment;
new FlowLog(this, "TransitGatewayAttachmentFlowLog", new FlowLogProps {
ResourceType = FlowLogResourceType.FromTransitGatewayAttachmentId(tgwAttachment.Ref)
});
For flow logs targeting TransitGateway and TransitGatewayAttachment, specifying the trafficType
is not possible.
Custom Formatting
You can also custom format flow logs.
var vpc = new Vpc(this, "Vpc");
vpc.AddFlowLog("FlowLog", new FlowLogOptions {
LogFormat = new [] { LogFormat.DST_PORT, LogFormat.SRC_PORT }
});
// If you just want to add a field to the default field
vpc.AddFlowLog("FlowLog", new FlowLogOptions {
LogFormat = new [] { LogFormat.VERSION, LogFormat.ALL_DEFAULT_FIELDS }
});
// If AWS CDK does not support the new fields
vpc.AddFlowLog("FlowLog", new FlowLogOptions {
LogFormat = new [] { LogFormat.SRC_PORT, LogFormat.Custom("${new-field}") }
});
By default, the CDK will create the necessary resources for the destination. For the CloudWatch Logs destination it will create a CloudWatch Logs Log Group as well as the IAM role with the necessary permissions to publish to the log group. In the case of an S3 destination, it will create the S3 bucket.
If you want to customize any of the destination resources you can provide your own as part of the destination
.
CloudWatch Logs
Vpc vpc;
var logGroup = new LogGroup(this, "MyCustomLogGroup");
var role = new Role(this, "MyCustomRole", new RoleProps {
AssumedBy = new ServicePrincipal("vpc-flow-logs.amazonaws.com")
});
new FlowLog(this, "FlowLog", new FlowLogProps {
ResourceType = FlowLogResourceType.FromVpc(vpc),
Destination = FlowLogDestination.ToCloudWatchLogs(logGroup, role)
});
S3
Vpc vpc;
var bucket = new Bucket(this, "MyCustomBucket");
new FlowLog(this, "FlowLog", new FlowLogProps {
ResourceType = FlowLogResourceType.FromVpc(vpc),
Destination = FlowLogDestination.ToS3(bucket)
});
new FlowLog(this, "FlowLogWithKeyPrefix", new FlowLogProps {
ResourceType = FlowLogResourceType.FromVpc(vpc),
Destination = FlowLogDestination.ToS3(bucket, "prefix/")
});
Kinesis Data Firehose
using Amazon.CDK.AWS.KinesisFirehose;
Vpc vpc;
CfnDeliveryStream deliveryStream;
vpc.AddFlowLog("FlowLogsKinesisDataFirehose", new FlowLogOptions {
Destination = FlowLogDestination.ToKinesisDataFirehoseDestination(deliveryStream.AttrArn)
});
When the S3 destination is configured, AWS will automatically create an S3 bucket policy
that allows the service to write logs to the bucket. This makes it impossible to later update
that bucket policy. To have CDK create the bucket policy so that future updates can be made,
the @aws-cdk/aws-s3:createDefaultLoggingPolicy
feature flag can be used. This can be set
in the cdk.json
file.
{
"context": {
"@aws-cdk/aws-s3:createDefaultLoggingPolicy": true
}
}
User Data
User data enables you to run a script when your instances start up. In order to configure these scripts you can add commands directly to the script or you can use the UserData's convenience functions to aid in the creation of your script.
A user data could be configured to run a script found in an asset through the following:
using Amazon.CDK.AWS.S3.Assets;
Instance instance;
var asset = new Asset(this, "Asset", new AssetProps {
Path = "./configure.sh"
});
var localPath = instance.UserData.AddS3DownloadCommand(new S3DownloadOptions {
Bucket = asset.Bucket,
BucketKey = asset.S3ObjectKey,
Region = "us-east-1"
});
instance.UserData.AddExecuteFileCommand(new ExecuteFileOptions {
FilePath = localPath,
Arguments = "--verbose -y"
});
asset.GrantRead(instance.Role);
Persisting user data
By default, EC2 UserData is run once on only the first time that an instance is started. It is possible to make the user data script run on every start of the instance.
When creating a Windows UserData you can use the persist
option to set whether or not to add
<persist>true</persist>
to the user data script. it can be used as follows:
var windowsUserData = UserData.ForWindows(new WindowsUserDataOptions { Persist = true });
For a Linux instance, this can be accomplished by using a Multipart user data to configure cloud-config as detailed in: https://aws.amazon.com/premiumsupport/knowledge-center/execute-user-data-ec2/
Multipart user data
In addition, to above the MultipartUserData
can be used to change instance startup behavior. Multipart user data are composed
from separate parts forming archive. The most common parts are scripts executed during instance set-up. However, there are other
kinds, too.
The advantage of multipart archive is in flexibility when it's needed to add additional parts or to use specialized parts to
fine tune instance startup. Some services (like AWS Batch) support only MultipartUserData
.
The parts can be executed at different moment of instance start-up and can serve a different purpose. This is controlled by contentType
property.
For common scripts, text/x-shellscript; charset="utf-8"
can be used as content type.
In order to create archive the MultipartUserData
has to be instantiated. Than, user can add parts to multipart archive using addPart
. The MultipartBody
contains methods supporting creation of body parts.
If the very custom part is required, it can be created using MultipartUserData.fromRawBody
, in this case full control over content type,
transfer encoding, and body properties is given to the user.
Below is an example for creating multipart user data with single body part responsible for installing awscli
and configuring maximum size
of storage used by Docker containers:
var bootHookConf = UserData.ForLinux();
bootHookConf.AddCommands("cloud-init-per once docker_options echo 'OPTIONS=\"${OPTIONS} --storage-opt dm.basesize=40G\"' >> /etc/sysconfig/docker");
var setupCommands = UserData.ForLinux();
setupCommands.AddCommands("sudo yum install awscli && echo Packages installed らと > /var/tmp/setup");
var multipartUserData = new MultipartUserData();
// The docker has to be configured at early stage, so content type is overridden to boothook
multipartUserData.AddPart(MultipartBody.FromUserData(bootHookConf, "text/cloud-boothook; charset=\"us-ascii\""));
// Execute the rest of setup
multipartUserData.AddPart(MultipartBody.FromUserData(setupCommands));
new LaunchTemplate(this, "", new LaunchTemplateProps {
UserData = multipartUserData,
BlockDevices = new [] { }
});
For more information see Specifying Multiple User Data Blocks Using a MIME Multi Part Archive
Using add*Command on MultipartUserData
To use the add*Command
methods, that are inherited from the UserData
interface, on MultipartUserData
you must add a part
to the MultipartUserData
and designate it as the receiver for these methods. This is accomplished by using the addUserDataPart()
method on MultipartUserData
with the makeDefault
argument set to true
:
var multipartUserData = new MultipartUserData();
var commandsUserData = UserData.ForLinux();
multipartUserData.AddUserDataPart(commandsUserData, MultipartBody.SHELL_SCRIPT, true);
// Adding commands to the multipartUserData adds them to commandsUserData, and vice-versa.
multipartUserData.AddCommands("touch /root/multi.txt");
commandsUserData.AddCommands("touch /root/userdata.txt");
When used on an EC2 instance, the above multipartUserData
will create both multi.txt
and userdata.txt
in /root
.
Importing existing subnet
To import an existing Subnet, call Subnet.fromSubnetAttributes()
or
Subnet.fromSubnetId()
. Only if you supply the subnet's Availability Zone
and Route Table Ids when calling Subnet.fromSubnetAttributes()
will you be
able to use the CDK features that use these values (such as selecting one
subnet per AZ).
Importing an existing subnet looks like this:
// Supply all properties
var subnet1 = Subnet.FromSubnetAttributes(this, "SubnetFromAttributes", new SubnetAttributes {
SubnetId = "s-1234",
AvailabilityZone = "pub-az-4465",
RouteTableId = "rt-145"
});
// Supply only subnet id
var subnet2 = Subnet.FromSubnetId(this, "SubnetFromId", "s-1234");
Launch Templates
A Launch Template is a standardized template that contains the configuration information to launch an instance. They can be used when launching instances on their own, through Amazon EC2 Auto Scaling, EC2 Fleet, and Spot Fleet. Launch templates enable you to store launch parameters so that you do not have to specify them every time you launch an instance. For information on Launch Templates please see the official documentation.
The following demonstrates how to create a launch template with an Amazon Machine Image, security group, and an instance profile.
Vpc vpc;
var role = new Role(this, "Role", new RoleProps {
AssumedBy = new ServicePrincipal("ec2.amazonaws.com")
});
var instanceProfile = new InstanceProfile(this, "InstanceProfile", new InstanceProfileProps {
Role = role
});
var template = new LaunchTemplate(this, "LaunchTemplate", new LaunchTemplateProps {
LaunchTemplateName = "MyTemplateV1",
VersionDescription = "This is my v1 template",
MachineImage = MachineImage.LatestAmazonLinux2023(),
SecurityGroup = new SecurityGroup(this, "LaunchTemplateSG", new SecurityGroupProps {
Vpc = vpc
}),
InstanceProfile = instanceProfile
});
And the following demonstrates how to enable metadata options support.
new LaunchTemplate(this, "LaunchTemplate", new LaunchTemplateProps {
HttpEndpoint = true,
HttpProtocolIpv6 = true,
HttpPutResponseHopLimit = 1,
HttpTokens = LaunchTemplateHttpTokens.REQUIRED,
InstanceMetadataTags = true
});
And the following demonstrates how to add one or more security groups to launch template.
Vpc vpc;
var sg1 = new SecurityGroup(this, "sg1", new SecurityGroupProps {
Vpc = vpc
});
var sg2 = new SecurityGroup(this, "sg2", new SecurityGroupProps {
Vpc = vpc
});
var launchTemplate = new LaunchTemplate(this, "LaunchTemplate", new LaunchTemplateProps {
MachineImage = MachineImage.LatestAmazonLinux2023(),
SecurityGroup = sg1
});
launchTemplate.AddSecurityGroup(sg2);
To use AWS Systems Manager parameters instead of AMI IDs in launch templates and resolve the AMI IDs at instance launch time:
var launchTemplate = new LaunchTemplate(this, "LaunchTemplate", new LaunchTemplateProps {
MachineImage = MachineImage.ResolveSsmParameterAtLaunch("parameterName")
});
Please note this feature does not support Launch Configurations.
Detailed Monitoring
The following demonstrates how to enable Detailed Monitoring for an EC2 instance. Keep in mind that Detailed Monitoring results in additional charges.
Vpc vpc;
InstanceType instanceType;
new Instance(this, "Instance1", new InstanceProps {
Vpc = vpc,
InstanceType = instanceType,
MachineImage = MachineImage.LatestAmazonLinux2023(),
DetailedMonitoring = true
});
Connecting to your instances using SSM Session Manager
SSM Session Manager makes it possible to connect to your instances from the AWS Console, without preparing SSH keys.
To do so, you need to:
If these conditions are met, you can connect to the instance from the EC2 Console. Example:
Vpc vpc;
InstanceType instanceType;
new Instance(this, "Instance1", new InstanceProps {
Vpc = vpc,
InstanceType = instanceType,
// Amazon Linux 2023 comes with SSM Agent by default
MachineImage = MachineImage.LatestAmazonLinux2023(),
// Turn on SSM
SsmSessionPermissions = true
});
Managed Prefix Lists
Create and manage customer-managed prefix lists. If you don't specify anything in this construct, it will manage IPv4 addresses.
You can also create an empty Prefix List with only the maximum number of entries specified, as shown in the following code. If nothing is specified, maxEntries=1.
new PrefixList(this, "EmptyPrefixList", new PrefixListProps {
MaxEntries = 100
});
maxEntries
can also be omitted as follows. In this case maxEntries: 2
, will be set.
new PrefixList(this, "PrefixList", new PrefixListProps {
Entries = new [] { new EntryProperty { Cidr = "10.0.0.1/32" }, new EntryProperty { Cidr = "10.0.0.2/32", Description = "sample1" } }
});
For more information see Work with customer-managed prefix lists
Classes
AclCidr | Either an IPv4 or an IPv6 CIDR. |
AclCidrConfig | Acl Configuration for CIDR. |
AclIcmp | Properties to create Icmp. |
AclPortRange | Properties to create PortRange. |
AclTraffic | The traffic that is configured using a Network ACL entry. |
AclTrafficConfig | Acl Configuration for traffic. |
Action | What action to apply to traffic matching the ACL. |
AddressFamily | The IP address type. |
AddRouteOptions | Options for adding a new route to a subnet. |
AllocateCidrRequest | Request for subnets CIDR to be allocated for a Vpc. |
AllocatedSubnet | CIDR Allocated Subnet. |
AllocateIpv6CidrRequest | Request for subnet IPv6 CIDRs to be allocated for a VPC. |
AllocateVpcIpv6CidrRequest | Request for allocation of the VPC IPv6 CIDR. |
AmazonLinux2022ImageSsmParameter | A SSM Parameter that contains the AMI ID for Amazon Linux 2023. |
AmazonLinux2022ImageSsmParameterProps | Properties specific to al2022 images. |
AmazonLinux2022Kernel | Amazon Linux 2022 kernel versions. |
AmazonLinux2023ImageSsmParameter | A SSM Parameter that contains the AMI ID for Amazon Linux 2023. |
AmazonLinux2023ImageSsmParameterProps | Properties specific to al2023 images. |
AmazonLinux2023Kernel | Amazon Linux 2023 kernel versions. |
AmazonLinux2ImageSsmParameter | A SSM Parameter that contains the AMI ID for Amazon Linux 2. |
AmazonLinux2ImageSsmParameterProps | Properties specific to amzn2 images. |
AmazonLinux2Kernel | Amazon Linux 2 kernel versions. |
AmazonLinuxCpuType | CPU type. |
AmazonLinuxEdition | Amazon Linux edition. |
AmazonLinuxGeneration | What generation of Amazon Linux to use. |
AmazonLinuxImage | Selects the latest version of Amazon Linux. |
AmazonLinuxImageProps | Amazon Linux image properties. |
AmazonLinuxImageSsmParameterBase | |
AmazonLinuxImageSsmParameterBaseOptions | Base options for amazon linux ssm parameters. |
AmazonLinuxImageSsmParameterBaseProps | Base properties for an Amazon Linux SSM Parameter. |
AmazonLinuxImageSsmParameterCommonOptions | Common options across all generations. |
AmazonLinuxKernel | Amazon Linux Kernel. |
AmazonLinuxStorage | Available storage options for Amazon Linux images Only applies to Amazon Linux & Amazon Linux 2. |
AmazonLinuxVirt | Virtualization type for Amazon Linux. |
ApplyCloudFormationInitOptions | Options for applying CloudFormation init to an instance or instance group. |
AttachInitOptions | Options for attaching a CloudFormationInit to a resource. |
AwsIpamProps | Configuration for AwsIpam. |
BastionHostLinux | This creates a linux bastion host you can use to connect to other instances or services in your VPC. |
BastionHostLinuxProps | Properties of the bastion host. |
BlockDevice | Block device. |
BlockDeviceVolume | Describes a block device mapping for an EC2 instance or Auto Scaling group. |
CfnCapacityReservation | Creates a new Capacity Reservation with the specified attributes. |
CfnCapacityReservation.TagSpecificationProperty | An array of key-value pairs to apply to this resource. |
CfnCapacityReservationFleet | Creates a new Capacity Reservation Fleet with the specified attributes. |
CfnCapacityReservationFleet.InstanceTypeSpecificationProperty | Specifies information about an instance type to use in a Capacity Reservation Fleet. |
CfnCapacityReservationFleet.TagSpecificationProperty | The tags to apply to a resource when the resource is being created. |
CfnCapacityReservationFleetProps | Properties for defining a |
CfnCapacityReservationProps | Properties for defining a |
CfnCarrierGateway | Creates a carrier gateway. |
CfnCarrierGatewayProps | Properties for defining a |
CfnClientVpnAuthorizationRule | Specifies an ingress authorization rule to add to a Client VPN endpoint. |
CfnClientVpnAuthorizationRuleProps | Properties for defining a |
CfnClientVpnEndpoint | Specifies a Client VPN endpoint. |
CfnClientVpnEndpoint.CertificateAuthenticationRequestProperty | Information about the client certificate to be used for authentication. |
CfnClientVpnEndpoint.ClientAuthenticationRequestProperty | Describes the authentication method to be used by a Client VPN endpoint. |
CfnClientVpnEndpoint.ClientConnectOptionsProperty | Indicates whether client connect options are enabled. |
CfnClientVpnEndpoint.ClientLoginBannerOptionsProperty | Options for enabling a customizable text banner that will be displayed on AWS provided clients when a VPN session is established. |
CfnClientVpnEndpoint.ConnectionLogOptionsProperty | Describes the client connection logging options for the Client VPN endpoint. |
CfnClientVpnEndpoint.DirectoryServiceAuthenticationRequestProperty | Describes the Active Directory to be used for client authentication. |
CfnClientVpnEndpoint.FederatedAuthenticationRequestProperty | The IAM SAML identity provider used for federated authentication. |
CfnClientVpnEndpoint.TagSpecificationProperty | Specifies the tags to apply to the Client VPN endpoint. |
CfnClientVpnEndpointProps | Properties for defining a |
CfnClientVpnRoute | Specifies a network route to add to a Client VPN endpoint. |
CfnClientVpnRouteProps | Properties for defining a |
CfnClientVpnTargetNetworkAssociation | Specifies a target network to associate with a Client VPN endpoint. |
CfnClientVpnTargetNetworkAssociationProps | Properties for defining a |
CfnCustomerGateway | Specifies a customer gateway. |
CfnCustomerGatewayProps | Properties for defining a |
CfnDHCPOptions | Specifies a set of DHCP options for your VPC. |
CfnDHCPOptionsProps | Properties for defining a |
CfnEC2Fleet | Specifies the configuration information to launch a fleet--or group--of instances. |
CfnEC2Fleet.AcceleratorCountRequestProperty | The minimum and maximum number of accelerators (GPUs, FPGAs, or AWS Inferentia chips) on an instance. |
CfnEC2Fleet.AcceleratorTotalMemoryMiBRequestProperty | The minimum and maximum amount of total accelerator memory, in MiB. |
CfnEC2Fleet.BaselineEbsBandwidthMbpsRequestProperty | The minimum and maximum baseline bandwidth to Amazon EBS, in Mbps. |
CfnEC2Fleet.CapacityRebalanceProperty | The Spot Instance replacement strategy to use when Amazon EC2 emits a rebalance notification signal that your Spot Instance is at an elevated risk of being interrupted. |
CfnEC2Fleet.CapacityReservationOptionsRequestProperty | Describes the strategy for using unused Capacity Reservations for fulfilling On-Demand capacity. |
CfnEC2Fleet.FleetLaunchTemplateConfigRequestProperty | Specifies a launch template and overrides for an EC2 Fleet. |
CfnEC2Fleet.FleetLaunchTemplateOverridesRequestProperty | Specifies overrides for a launch template for an EC2 Fleet. |
CfnEC2Fleet.FleetLaunchTemplateSpecificationRequestProperty | Specifies the launch template to be used by the EC2 Fleet for configuring Amazon EC2 instances. |
CfnEC2Fleet.InstanceRequirementsRequestProperty | The attributes for the instance types. |
CfnEC2Fleet.MaintenanceStrategiesProperty | The strategies for managing your Spot Instances that are at an elevated risk of being interrupted. |
CfnEC2Fleet.MemoryGiBPerVCpuRequestProperty | The minimum and maximum amount of memory per vCPU, in GiB. |
CfnEC2Fleet.MemoryMiBRequestProperty | The minimum and maximum amount of memory, in MiB. |
CfnEC2Fleet.NetworkBandwidthGbpsRequestProperty | The minimum and maximum amount of network bandwidth, in gigabits per second (Gbps). |
CfnEC2Fleet.NetworkInterfaceCountRequestProperty | The minimum and maximum number of network interfaces. |
CfnEC2Fleet.OnDemandOptionsRequestProperty | Specifies the allocation strategy of On-Demand Instances in an EC2 Fleet. |
CfnEC2Fleet.PlacementProperty | Describes the placement of an instance. |
CfnEC2Fleet.SpotOptionsRequestProperty | Specifies the configuration of Spot Instances for an EC2 Fleet. |
CfnEC2Fleet.TagSpecificationProperty | Specifies the tags to apply to a resource when the resource is being created for an EC2 Fleet. |
CfnEC2Fleet.TargetCapacitySpecificationRequestProperty | Specifies the number of units to request for an EC2 Fleet. |
CfnEC2Fleet.TotalLocalStorageGBRequestProperty | The minimum and maximum amount of total local storage, in GB. |
CfnEC2Fleet.VCpuCountRangeRequestProperty | The minimum and maximum number of vCPUs. |
CfnEC2FleetProps | Properties for defining a |
CfnEgressOnlyInternetGateway | [IPv6 only] Specifies an egress-only internet gateway for your VPC. |
CfnEgressOnlyInternetGatewayProps | Properties for defining a |
CfnEIP | Specifies an Elastic IP (EIP) address and can, optionally, associate it with an Amazon EC2 instance. |
CfnEIPAssociation | Associates an Elastic IP address with an instance or a network interface. |
CfnEIPAssociationProps | Properties for defining a |
CfnEIPProps | Properties for defining a |
CfnEnclaveCertificateIamRoleAssociation | Associates an AWS Identity and Access Management (IAM) role with an AWS Certificate Manager (ACM) certificate. |
CfnEnclaveCertificateIamRoleAssociationProps | Properties for defining a |
CfnFlowLog | Specifies a VPC flow log that captures IP traffic for a specified network interface, subnet, or VPC. |
CfnFlowLog.DestinationOptionsProperty | Describes the destination options for a flow log. |
CfnFlowLogProps | Properties for defining a |
CfnGatewayRouteTableAssociation | Associates a virtual private gateway or internet gateway with a route table. |
CfnGatewayRouteTableAssociationProps | Properties for defining a |
CfnHost | Allocates a fully dedicated physical server for launching EC2 instances. |
CfnHostProps | Properties for defining a |
CfnInstance | Specifies an EC2 instance. |
CfnInstance.AssociationParameterProperty | Specifies input parameter values for an SSM document in AWS Systems Manager . |
CfnInstance.BlockDeviceMappingProperty | Specifies a block device mapping for an instance. |
CfnInstance.CpuOptionsProperty | Specifies the CPU options for the instance. |
CfnInstance.CreditSpecificationProperty | Specifies the credit option for CPU usage of a T instance. |
CfnInstance.EbsProperty | Specifies a block device for an EBS volume. |
CfnInstance.ElasticGpuSpecificationProperty | Amazon Elastic Graphics reached end of life on January 8, 2024. |
CfnInstance.ElasticInferenceAcceleratorProperty | Specifies the Elastic Inference Accelerator for the instance. |
CfnInstance.EnclaveOptionsProperty | Indicates whether the instance is enabled for AWS Nitro Enclaves. |
CfnInstance.HibernationOptionsProperty | Specifies the hibernation options for the instance. |
CfnInstance.InstanceIpv6AddressProperty | Specifies the IPv6 address for the instance. |
CfnInstance.LaunchTemplateSpecificationProperty | Specifies a launch template to use when launching an Amazon EC2 instance. |
CfnInstance.LicenseSpecificationProperty | Specifies the license configuration to use. |
CfnInstance.NetworkInterfaceProperty | Specifies a network interface that is to be attached to an instance. |
CfnInstance.NoDeviceProperty | |
CfnInstance.PrivateDnsNameOptionsProperty | The type of hostnames to assign to instances in the subnet at launch. |
CfnInstance.PrivateIpAddressSpecificationProperty | Specifies a secondary private IPv4 address for a network interface. |
CfnInstance.SsmAssociationProperty | Specifies the SSM document and parameter values in AWS Systems Manager to associate with an instance. |
CfnInstance.StateProperty | Describes the current state of an instance. |
CfnInstance.VolumeProperty | Specifies a volume to attach to an instance. |
CfnInstanceConnectEndpoint | Creates an EC2 Instance Connect Endpoint. |
CfnInstanceConnectEndpointProps | Properties for defining a |
CfnInstanceProps | Properties for defining a |
CfnInternetGateway | Allocates an internet gateway for use with a VPC. |
CfnInternetGatewayProps | Properties for defining a |
CfnIPAM | IPAM is a VPC feature that you can use to automate your IP address management workflows including assigning, tracking, troubleshooting, and auditing IP addresses across AWS Regions and accounts throughout your AWS Organization. |
CfnIPAM.IpamOperatingRegionProperty | The operating Regions for an IPAM. |
CfnIPAMAllocation | In IPAM, an allocation is a CIDR assignment from an IPAM pool to another IPAM pool or to a resource. |
CfnIPAMAllocationProps | Properties for defining a |
CfnIPAMPool | In IPAM, a pool is a collection of contiguous IP addresses CIDRs. |
CfnIPAMPool.ProvisionedCidrProperty | The CIDR provisioned to the IPAM pool. |
CfnIPAMPool.SourceResourceProperty | The resource used to provision CIDRs to a resource planning pool. |
CfnIPAMPoolCidr | A CIDR provisioned to an IPAM pool. |
CfnIPAMPoolCidrProps | Properties for defining a |
CfnIPAMPoolProps | Properties for defining a |
CfnIPAMProps | Properties for defining a |
CfnIPAMResourceDiscovery | A resource discovery is an IPAM component that enables IPAM to manage and monitor resources that belong to the owning account. |
CfnIPAMResourceDiscovery.IpamOperatingRegionProperty | The operating Regions for an IPAM. |
CfnIPAMResourceDiscoveryAssociation | An IPAM resource discovery association. |
CfnIPAMResourceDiscoveryAssociationProps | Properties for defining a |
CfnIPAMResourceDiscoveryProps | Properties for defining a |
CfnIPAMScope | In IPAM, a scope is the highest-level container within IPAM. |
CfnIPAMScopeProps | Properties for defining a |
CfnKeyPair | Specifies a key pair for use with an Amazon Elastic Compute Cloud instance as follows:. |
CfnKeyPairProps | Properties for defining a |
CfnLaunchTemplate | Specifies the properties for creating a launch template. |
CfnLaunchTemplate.AcceleratorCountProperty | The minimum and maximum number of accelerators (GPUs, FPGAs, or AWS Inferentia chips) on an instance. |
CfnLaunchTemplate.AcceleratorTotalMemoryMiBProperty | The minimum and maximum amount of total accelerator memory, in MiB. |
CfnLaunchTemplate.BaselineEbsBandwidthMbpsProperty | The minimum and maximum baseline bandwidth to Amazon EBS, in Mbps. |
CfnLaunchTemplate.BlockDeviceMappingProperty | Specifies a block device mapping for a launch template. |
CfnLaunchTemplate.CapacityReservationSpecificationProperty | Specifies an instance's Capacity Reservation targeting option. You can specify only one option at a time. |
CfnLaunchTemplate.CapacityReservationTargetProperty | Specifies a target Capacity Reservation. |
CfnLaunchTemplate.ConnectionTrackingSpecificationProperty | A security group connection tracking specification that enables you to set the idle timeout for connection tracking on an Elastic network interface. |
CfnLaunchTemplate.CpuOptionsProperty | Specifies the CPU options for an instance. |
CfnLaunchTemplate.CreditSpecificationProperty | Specifies the credit option for CPU usage of a T2, T3, or T3a instance. |
CfnLaunchTemplate.EbsProperty | Parameters for a block device for an EBS volume in an Amazon EC2 launch template. |
CfnLaunchTemplate.ElasticGpuSpecificationProperty | Amazon Elastic Graphics reached end of life on January 8, 2024. |
CfnLaunchTemplate.EnaSrdSpecificationProperty | ENA Express uses AWS Scalable Reliable Datagram (SRD) technology to increase the maximum bandwidth used per stream and minimize tail latency of network traffic between EC2 instances. |
CfnLaunchTemplate.EnaSrdUdpSpecificationProperty | ENA Express is compatible with both TCP and UDP transport protocols. |
CfnLaunchTemplate.EnclaveOptionsProperty | Indicates whether the instance is enabled for AWS Nitro Enclaves. |
CfnLaunchTemplate.HibernationOptionsProperty | Specifies whether your instance is configured for hibernation. |
CfnLaunchTemplate.IamInstanceProfileProperty | Specifies an IAM instance profile, which is a container for an IAM role for your instance. |
CfnLaunchTemplate.InstanceMarketOptionsProperty | Specifies the market (purchasing) option for an instance. |
CfnLaunchTemplate.InstanceRequirementsProperty | The attributes for the instance types. |
CfnLaunchTemplate.Ipv4PrefixSpecificationProperty | Specifies an IPv4 prefix for a network interface. |
CfnLaunchTemplate.Ipv6AddProperty | Specifies an IPv6 address in an Amazon EC2 launch template. |
CfnLaunchTemplate.Ipv6PrefixSpecificationProperty | Specifies an IPv6 prefix for a network interface. |
CfnLaunchTemplate.LaunchTemplateDataProperty | The information to include in the launch template. |
CfnLaunchTemplate.LaunchTemplateElasticInferenceAcceleratorProperty | Specifies an elastic inference accelerator. |
CfnLaunchTemplate.LaunchTemplateTagSpecificationProperty | Specifies the tags to apply to the launch template during creation. |
CfnLaunchTemplate.LicenseSpecificationProperty | Specifies a license configuration for an instance. |
CfnLaunchTemplate.MaintenanceOptionsProperty | The maintenance options of your instance. |
CfnLaunchTemplate.MemoryGiBPerVCpuProperty | The minimum and maximum amount of memory per vCPU, in GiB. |
CfnLaunchTemplate.MemoryMiBProperty | The minimum and maximum amount of memory, in MiB. |
CfnLaunchTemplate.MetadataOptionsProperty | The metadata options for the instance. |
CfnLaunchTemplate.MonitoringProperty | Specifies whether detailed monitoring is enabled for an instance. |
CfnLaunchTemplate.NetworkBandwidthGbpsProperty | The minimum and maximum amount of network bandwidth, in gigabits per second (Gbps). |
CfnLaunchTemplate.NetworkInterfaceCountProperty | The minimum and maximum number of network interfaces. |
CfnLaunchTemplate.NetworkInterfaceProperty | Specifies the parameters for a network interface. |
CfnLaunchTemplate.PlacementProperty | Specifies the placement of an instance. |
CfnLaunchTemplate.PrivateDnsNameOptionsProperty | The hostname type for EC2 instances launched into this subnet and how DNS A and AAAA record queries should be handled. |
CfnLaunchTemplate.PrivateIpAddProperty | Specifies a secondary private IPv4 address for a network interface. |
CfnLaunchTemplate.SpotOptionsProperty | Specifies options for Spot Instances. |
CfnLaunchTemplate.TagSpecificationProperty | Specifies the tags to apply to resources that are created during instance launch. |
CfnLaunchTemplate.TotalLocalStorageGBProperty | The minimum and maximum amount of total local storage, in GB. |
CfnLaunchTemplate.VCpuCountProperty | The minimum and maximum number of vCPUs. |
CfnLaunchTemplateProps | Properties for defining a |
CfnLocalGatewayRoute | Creates a static route for the specified local gateway route table. You must specify one of the following targets:. |
CfnLocalGatewayRouteProps | Properties for defining a |
CfnLocalGatewayRouteTable | Describes a local gateway route table. |
CfnLocalGatewayRouteTableProps | Properties for defining a |
CfnLocalGatewayRouteTableVirtualInterfaceGroupAssociation | Describes an association between a local gateway route table and a virtual interface group. |
CfnLocalGatewayRouteTableVirtualInterfaceGroupAssociationProps | Properties for defining a |
CfnLocalGatewayRouteTableVPCAssociation | Associates the specified VPC with the specified local gateway route table. |
CfnLocalGatewayRouteTableVPCAssociationProps | Properties for defining a |
CfnNatGateway | Specifies a network address translation (NAT) gateway in the specified subnet. |
CfnNatGatewayProps | Properties for defining a |
CfnNetworkAcl | Specifies a network ACL for your VPC. |
CfnNetworkAclEntry | Specifies an entry, known as a rule, in a network ACL with a rule number you specify. |
CfnNetworkAclEntry.IcmpProperty | Describes the ICMP type and code. |
CfnNetworkAclEntry.PortRangeProperty | Describes a range of ports. |
CfnNetworkAclEntryProps | Properties for defining a |
CfnNetworkAclProps | Properties for defining a |
CfnNetworkInsightsAccessScope | Describes a Network Access Scope. |
CfnNetworkInsightsAccessScope.AccessScopePathRequestProperty | Describes a path. |
CfnNetworkInsightsAccessScope.PacketHeaderStatementRequestProperty | Describes a packet header statement. |
CfnNetworkInsightsAccessScope.PathStatementRequestProperty | Describes a path statement. |
CfnNetworkInsightsAccessScope.ResourceStatementRequestProperty | Describes a resource statement. |
CfnNetworkInsightsAccessScope.ThroughResourcesStatementRequestProperty | Describes a through resource statement. |
CfnNetworkInsightsAccessScopeAnalysis | Describes a Network Access Scope analysis. |
CfnNetworkInsightsAccessScopeAnalysisProps | Properties for defining a |
CfnNetworkInsightsAccessScopeProps | Properties for defining a |
CfnNetworkInsightsAnalysis | Specifies a network insights analysis. |
CfnNetworkInsightsAnalysis.AdditionalDetailProperty | Describes an additional detail for a path analysis. |
CfnNetworkInsightsAnalysis.AlternatePathHintProperty | Describes an potential intermediate component of a feasible path. |
CfnNetworkInsightsAnalysis.AnalysisAclRuleProperty | Describes a network access control (ACL) rule. |
CfnNetworkInsightsAnalysis.AnalysisComponentProperty | Describes a path component. |
CfnNetworkInsightsAnalysis.AnalysisLoadBalancerListenerProperty | Describes a load balancer listener. |
CfnNetworkInsightsAnalysis.AnalysisLoadBalancerTargetProperty | Describes a load balancer target. |
CfnNetworkInsightsAnalysis.AnalysisPacketHeaderProperty | Describes a header. |
CfnNetworkInsightsAnalysis.AnalysisRouteTableRouteProperty | Describes a route table route. |
CfnNetworkInsightsAnalysis.AnalysisSecurityGroupRuleProperty | Describes a security group rule. |
CfnNetworkInsightsAnalysis.ExplanationProperty | Describes an explanation code for an unreachable path. |
CfnNetworkInsightsAnalysis.PathComponentProperty | Describes a path component. |
CfnNetworkInsightsAnalysis.PortRangeProperty | Describes a range of ports. |
CfnNetworkInsightsAnalysis.TransitGatewayRouteTableRouteProperty | Describes a route in a transit gateway route table. |
CfnNetworkInsightsAnalysisProps | Properties for defining a |
CfnNetworkInsightsPath | Specifies a path to analyze for reachability. |
CfnNetworkInsightsPath.FilterPortRangeProperty | Describes a port range. |
CfnNetworkInsightsPath.PathFilterProperty | Describes a set of filters for a path analysis. |
CfnNetworkInsightsPathProps | Properties for defining a |
CfnNetworkInterface | Describes a network interface in an Amazon EC2 instance for AWS CloudFormation . |
CfnNetworkInterface.ConnectionTrackingSpecificationProperty | Configurable options for connection tracking on a network interface. |
CfnNetworkInterface.InstanceIpv6AddressProperty | Describes the IPv6 addresses to associate with the network interface. |
CfnNetworkInterface.Ipv4PrefixSpecificationProperty | Describes an IPv4 prefix. |
CfnNetworkInterface.Ipv6PrefixSpecificationProperty | Describes the IPv6 prefix. |
CfnNetworkInterface.PrivateIpAddressSpecificationProperty | Describes a secondary private IPv4 address for a network interface. |
CfnNetworkInterfaceAttachment | Attaches an elastic network interface (ENI) to an Amazon EC2 instance. |
CfnNetworkInterfaceAttachment.EnaSrdSpecificationProperty | ENA Express uses AWS Scalable Reliable Datagram (SRD) technology to increase the maximum bandwidth used per stream and minimize tail latency of network traffic between EC2 instances. |
CfnNetworkInterfaceAttachment.EnaSrdUdpSpecificationProperty | ENA Express is compatible with both TCP and UDP transport protocols. |
CfnNetworkInterfaceAttachmentProps | Properties for defining a |
CfnNetworkInterfacePermission | Specifies a permission for an Amazon EC2 network interface. |
CfnNetworkInterfacePermissionProps | Properties for defining a |
CfnNetworkInterfaceProps | Properties for defining a |
CfnNetworkPerformanceMetricSubscription | Describes Infrastructure Performance subscriptions. |
CfnNetworkPerformanceMetricSubscriptionProps | Properties for defining a |
CfnPlacementGroup | Specifies a placement group in which to launch instances. |
CfnPlacementGroupProps | Properties for defining a |
CfnPrefixList | Specifies a managed prefix list. |
CfnPrefixList.EntryProperty | An entry for a prefix list. |
CfnPrefixListProps | Properties for defining a |
CfnRoute | Specifies a route in a route table. For more information, see Routes in the Amazon VPC User Guide . |
CfnRouteProps | Properties for defining a |
CfnRouteTable | Specifies a route table for the specified VPC. |
CfnRouteTableProps | Properties for defining a |
CfnSecurityGroup | Specifies a security group. |
CfnSecurityGroup.EgressProperty | Adds the specified outbound (egress) rule to a security group. |
CfnSecurityGroup.IngressProperty | Adds an inbound (ingress) rule to a security group. |
CfnSecurityGroupEgress | Adds the specified outbound (egress) rule to a security group. |
CfnSecurityGroupEgressProps | Properties for defining a |
CfnSecurityGroupIngress | Adds an inbound (ingress) rule to a security group. |
CfnSecurityGroupIngressProps | Properties for defining a |
CfnSecurityGroupProps | Properties for defining a |
CfnSnapshotBlockPublicAccess | Specifies the state of the block public access for snapshots setting for the Region. |
CfnSnapshotBlockPublicAccessProps | Properties for defining a |
CfnSpotFleet | Specifies a Spot Fleet request. |
CfnSpotFleet.AcceleratorCountRequestProperty | The minimum and maximum number of accelerators (GPUs, FPGAs, or AWS Inferentia chips) on an instance. |
CfnSpotFleet.AcceleratorTotalMemoryMiBRequestProperty | The minimum and maximum amount of total accelerator memory, in MiB. |
CfnSpotFleet.BaselineEbsBandwidthMbpsRequestProperty | The minimum and maximum baseline bandwidth to Amazon EBS, in Mbps. |
CfnSpotFleet.BlockDeviceMappingProperty | Specifies a block device mapping. |
CfnSpotFleet.ClassicLoadBalancerProperty | Specifies a Classic Load Balancer. |
CfnSpotFleet.ClassicLoadBalancersConfigProperty | Specifies the Classic Load Balancers to attach to a Spot Fleet. |
CfnSpotFleet.EbsBlockDeviceProperty | Describes a block device for an EBS volume. |
CfnSpotFleet.FleetLaunchTemplateSpecificationProperty | Specifies the launch template to be used by the Spot Fleet request for configuring Amazon EC2 instances. |
CfnSpotFleet.GroupIdentifierProperty | Describes a security group. |
CfnSpotFleet.IamInstanceProfileSpecificationProperty | Describes an IAM instance profile. |
CfnSpotFleet.InstanceIpv6AddressProperty | Describes an IPv6 address. |
CfnSpotFleet.InstanceNetworkInterfaceSpecificationProperty | Describes a network interface. |
CfnSpotFleet.InstanceRequirementsRequestProperty | The attributes for the instance types. |
CfnSpotFleet.LaunchTemplateConfigProperty | Specifies a launch template and overrides. |
CfnSpotFleet.LaunchTemplateOverridesProperty | Specifies overrides for a launch template. |
CfnSpotFleet.LoadBalancersConfigProperty | Specifies the Classic Load Balancers and target groups to attach to a Spot Fleet request. |
CfnSpotFleet.MemoryGiBPerVCpuRequestProperty | The minimum and maximum amount of memory per vCPU, in GiB. |
CfnSpotFleet.MemoryMiBRequestProperty | The minimum and maximum amount of memory, in MiB. |
CfnSpotFleet.NetworkBandwidthGbpsRequestProperty | The minimum and maximum amount of baseline network bandwidth, in gigabits per second (Gbps). |
CfnSpotFleet.NetworkInterfaceCountRequestProperty | The minimum and maximum number of network interfaces. |
CfnSpotFleet.PrivateIpAddressSpecificationProperty | Describes a secondary private IPv4 address for a network interface. |
CfnSpotFleet.SpotCapacityRebalanceProperty | The Spot Instance replacement strategy to use when Amazon EC2 emits a signal that your Spot Instance is at an elevated risk of being interrupted. |
CfnSpotFleet.SpotFleetLaunchSpecificationProperty | Specifies the launch specification for one or more Spot Instances. |
CfnSpotFleet.SpotFleetMonitoringProperty | Describes whether monitoring is enabled. |
CfnSpotFleet.SpotFleetRequestConfigDataProperty | Specifies the configuration of a Spot Fleet request. |
CfnSpotFleet.SpotFleetTagSpecificationProperty | The tags for a Spot Fleet resource. |
CfnSpotFleet.SpotMaintenanceStrategiesProperty | The strategies for managing your Spot Instances that are at an elevated risk of being interrupted. |
CfnSpotFleet.SpotPlacementProperty | Describes Spot Instance placement. |
CfnSpotFleet.TargetGroupProperty | Describes a load balancer target group. |
CfnSpotFleet.TargetGroupsConfigProperty | Describes the target groups to attach to a Spot Fleet. |
CfnSpotFleet.TotalLocalStorageGBRequestProperty | The minimum and maximum amount of total local storage, in GB. |
CfnSpotFleet.VCpuCountRangeRequestProperty | The minimum and maximum number of vCPUs. |
CfnSpotFleetProps | Properties for defining a |
CfnSubnet | Specifies a subnet for the specified VPC. |
CfnSubnet.PrivateDnsNameOptionsOnLaunchProperty | Describes the options for instance hostnames. |
CfnSubnetCidrBlock | Associates a CIDR block with your subnet. |
CfnSubnetCidrBlockProps | Properties for defining a |
CfnSubnetNetworkAclAssociation | Associates a subnet with a network ACL. For more information, see ReplaceNetworkAclAssociation in the Amazon EC2 API Reference . |
CfnSubnetNetworkAclAssociationProps | Properties for defining a |
CfnSubnetProps | Properties for defining a |
CfnSubnetRouteTableAssociation | Associates a subnet with a route table. |
CfnSubnetRouteTableAssociationProps | Properties for defining a |
CfnTrafficMirrorFilter | Specifies a Traffic Mirror filter. |
CfnTrafficMirrorFilterProps | Properties for defining a |
CfnTrafficMirrorFilterRule | Creates a Traffic Mirror filter rule. |
CfnTrafficMirrorFilterRule.TrafficMirrorPortRangeProperty | Describes the Traffic Mirror port range. |
CfnTrafficMirrorFilterRuleProps | Properties for defining a |
CfnTrafficMirrorSession | Creates a Traffic Mirror session. |
CfnTrafficMirrorSessionProps | Properties for defining a |
CfnTrafficMirrorTarget | Specifies a target for your Traffic Mirror session. |
CfnTrafficMirrorTargetProps | Properties for defining a |
CfnTransitGateway | Specifies a transit gateway. |
CfnTransitGatewayAttachment | Attaches a VPC to a transit gateway. |
CfnTransitGatewayAttachment.OptionsProperty | Describes the VPC attachment options. |
CfnTransitGatewayAttachmentProps | Properties for defining a |
CfnTransitGatewayConnect | Creates a Connect attachment from a specified transit gateway attachment. |
CfnTransitGatewayConnect.TransitGatewayConnectOptionsProperty | Describes the Connect attachment options. |
CfnTransitGatewayConnectProps | Properties for defining a |
CfnTransitGatewayMulticastDomain | Creates a multicast domain using the specified transit gateway. |
CfnTransitGatewayMulticastDomain.OptionsProperty | The options for the transit gateway multicast domain. |
CfnTransitGatewayMulticastDomainAssociation | Associates the specified subnets and transit gateway attachments with the specified transit gateway multicast domain. |
CfnTransitGatewayMulticastDomainAssociationProps | Properties for defining a |
CfnTransitGatewayMulticastDomainProps | Properties for defining a |
CfnTransitGatewayMulticastGroupMember | Registers members (network interfaces) with the transit gateway multicast group. |
CfnTransitGatewayMulticastGroupMemberProps | Properties for defining a |
CfnTransitGatewayMulticastGroupSource | Registers sources (network interfaces) with the specified transit gateway multicast domain. |
CfnTransitGatewayMulticastGroupSourceProps | Properties for defining a |
CfnTransitGatewayPeeringAttachment | Requests a transit gateway peering attachment between the specified transit gateway (requester) and a peer transit gateway (accepter). |
CfnTransitGatewayPeeringAttachment.PeeringAttachmentStatusProperty | The status of the transit gateway peering attachment. |
CfnTransitGatewayPeeringAttachmentProps | Properties for defining a |
CfnTransitGatewayProps | Properties for defining a |
CfnTransitGatewayRoute | Specifies a static route for a transit gateway route table. |
CfnTransitGatewayRouteProps | Properties for defining a |
CfnTransitGatewayRouteTable | Specifies a route table for a transit gateway. |
CfnTransitGatewayRouteTableAssociation | Associates the specified attachment with the specified transit gateway route table. |
CfnTransitGatewayRouteTableAssociationProps | Properties for defining a |
CfnTransitGatewayRouteTablePropagation | Enables the specified attachment to propagate routes to the specified propagation route table. |
CfnTransitGatewayRouteTablePropagationProps | Properties for defining a |
CfnTransitGatewayRouteTableProps | Properties for defining a |
CfnTransitGatewayVpcAttachment | Specifies a VPC attachment. |
CfnTransitGatewayVpcAttachment.OptionsProperty | Describes the VPC attachment options. |
CfnTransitGatewayVpcAttachmentProps | Properties for defining a |
CfnVerifiedAccessEndpoint | An AWS Verified Access endpoint specifies the application that AWS Verified Access provides access to. |
CfnVerifiedAccessEndpoint.LoadBalancerOptionsProperty | Describes the load balancer options when creating an AWS Verified Access endpoint using the |
CfnVerifiedAccessEndpoint.NetworkInterfaceOptionsProperty | Describes the network interface options when creating an AWS Verified Access endpoint using the |
CfnVerifiedAccessEndpoint.SseSpecificationProperty | AWS Verified Access provides server side encryption by default to data at rest using AWS -owned KMS keys. |
CfnVerifiedAccessEndpointProps | Properties for defining a |
CfnVerifiedAccessGroup | An AWS Verified Access group is a collection of AWS Verified Access endpoints who's associated applications have similar security requirements. |
CfnVerifiedAccessGroup.SseSpecificationProperty | AWS Verified Access provides server side encryption by default to data at rest using AWS -owned KMS keys. |
CfnVerifiedAccessGroupProps | Properties for defining a |
CfnVerifiedAccessInstance | An AWS Verified Access instance is a regional entity that evaluates application requests and grants access only when your security requirements are met. |
CfnVerifiedAccessInstance.CloudWatchLogsProperty | Options for CloudWatch Logs as a logging destination. |
CfnVerifiedAccessInstance.KinesisDataFirehoseProperty | Options for Kinesis as a logging destination. |
CfnVerifiedAccessInstance.S3Property | Options for Amazon S3 as a logging destination. |
CfnVerifiedAccessInstance.VerifiedAccessLogsProperty | Describes the options for Verified Access logs. |
CfnVerifiedAccessInstance.VerifiedAccessTrustProviderProperty | A trust provider is a third-party entity that creates, maintains, and manages identity information for users and devices. |
CfnVerifiedAccessInstanceProps | Properties for defining a |
CfnVerifiedAccessTrustProvider | A trust provider is a third-party entity that creates, maintains, and manages identity information for users and devices. |
CfnVerifiedAccessTrustProvider.DeviceOptionsProperty | Describes the options for an AWS Verified Access device-identity based trust provider. |
CfnVerifiedAccessTrustProvider.OidcOptionsProperty | Describes the options for an OpenID Connect-compatible user-identity trust provider. |
CfnVerifiedAccessTrustProvider.SseSpecificationProperty | AWS Verified Access provides server side encryption by default to data at rest using AWS -owned KMS keys. |
CfnVerifiedAccessTrustProviderProps | Properties for defining a |
CfnVolume | Specifies an Amazon Elastic Block Store (Amazon EBS) volume. |
CfnVolumeAttachment | Attaches an Amazon EBS volume to a running instance and exposes it to the instance with the specified device name. |
CfnVolumeAttachmentProps | Properties for defining a |
CfnVolumeProps | Properties for defining a |
CfnVPC | Specifies a virtual private cloud (VPC). |
CfnVPCCidrBlock | Associates a CIDR block with your VPC. |
CfnVPCCidrBlockProps | Properties for defining a |
CfnVPCDHCPOptionsAssociation | Associates a set of DHCP options with a VPC, or associates no DHCP options with the VPC. |
CfnVPCDHCPOptionsAssociationProps | Properties for defining a |
CfnVPCEndpoint | Specifies a VPC endpoint. |
CfnVPCEndpointConnectionNotification | Specifies a connection notification for a VPC endpoint or VPC endpoint service. |
CfnVPCEndpointConnectionNotificationProps | Properties for defining a |
CfnVPCEndpointProps | Properties for defining a |
CfnVPCEndpointService | Creates a VPC endpoint service configuration to which service consumers ( AWS accounts, users, and IAM roles) can connect. |
CfnVPCEndpointServicePermissions | Grant or revoke permissions for service consumers (users, IAM roles, and AWS accounts) to connect to a VPC endpoint service. |
CfnVPCEndpointServicePermissionsProps | Properties for defining a |
CfnVPCEndpointServiceProps | Properties for defining a |
CfnVPCGatewayAttachment | Attaches an internet gateway, or a virtual private gateway to a VPC, enabling connectivity between the internet and the VPC. |
CfnVPCGatewayAttachmentProps | Properties for defining a |
CfnVPCPeeringConnection | Requests a VPC peering connection between two VPCs: a requester VPC that you own and an accepter VPC with which to create the connection. |
CfnVPCPeeringConnectionProps | Properties for defining a |
CfnVPCProps | Properties for defining a |
CfnVPNConnection | Specifies a VPN connection between a virtual private gateway and a VPN customer gateway or a transit gateway and a VPN customer gateway. |
CfnVPNConnection.VpnTunnelOptionsSpecificationProperty | The tunnel options for a single VPN tunnel. |
CfnVPNConnectionProps | Properties for defining a |
CfnVPNConnectionRoute | Specifies a static route for a VPN connection between an existing virtual private gateway and a VPN customer gateway. |
CfnVPNConnectionRouteProps | Properties for defining a |
CfnVPNGateway | Specifies a virtual private gateway. |
CfnVPNGatewayProps | Properties for defining a |
CfnVPNGatewayRoutePropagation | Enables a virtual private gateway (VGW) to propagate routes to the specified route table of a VPC. |
CfnVPNGatewayRoutePropagationProps | Properties for defining a |
ClientVpnAuthorizationRule | A client VPN authorization rule. |
ClientVpnAuthorizationRuleOptions | Options for a ClientVpnAuthorizationRule. |
ClientVpnAuthorizationRuleProps | Properties for a ClientVpnAuthorizationRule. |
ClientVpnEndpoint | A client VPN connnection. |
ClientVpnEndpointAttributes | Attributes when importing an existing client VPN endpoint. |
ClientVpnEndpointOptions | Options for a client VPN endpoint. |
ClientVpnEndpointProps | Properties for a client VPN endpoint. |
ClientVpnRoute | A client VPN route. |
ClientVpnRouteOptions | Options for a ClientVpnRoute. |
ClientVpnRouteProps | Properties for a ClientVpnRoute. |
ClientVpnRouteTarget | Target for a client VPN route. |
ClientVpnSessionTimeout | Maximum VPN session duration time. |
ClientVpnUserBasedAuthentication | User-based authentication for a client VPN endpoint. |
CloudFormationInit | A CloudFormation-init configuration. |
CommonNetworkAclEntryOptions | Basic NetworkACL entry props. |
ConfigSetProps | Options for CloudFormationInit.withConfigSets. |
ConfigureNatOptions | Options passed by the VPC when NAT needs to be configured. |
ConnectionRule | |
Connections_ | Manage the allowed network connections for constructs with Security Groups. |
ConnectionsProps | Properties to intialize a new Connections object. |
CpuCredits | Provides the options for specifying the CPU credit type for burstable EC2 instance types (T2, T3, T3a, etc). |
CreateIpv6CidrBlocksRequest | Request for IPv6 CIDR block to be split up. |
DefaultInstanceTenancy | The default tenancy of instances launched into the VPC. |
DestinationOptions | Options for writing logs to a destination. |
EbsDeviceOptions | Block device options for an EBS volume. |
EbsDeviceOptionsBase | Base block device options for an EBS volume. |
EbsDeviceProps | Properties of an EBS block device. |
EbsDeviceSnapshotOptions | Block device options for an EBS volume created from a snapshot. |
EbsDeviceVolumeType | Supported EBS volume types for blockDevices. |
EnableVpnGatewayOptions | Options for the Vpc.enableVpnGateway() method. |
ExecuteFileOptions | Options when executing a file. |
FlowLog | A VPC flow log. |
FlowLogDestination | The destination type for the flow log. |
FlowLogDestinationConfig | Flow Log Destination configuration. |
FlowLogDestinationType | The available destination types for Flow Logs. |
FlowLogFileFormat | The file format for flow logs written to an S3 bucket destination. |
FlowLogMaxAggregationInterval | The maximum interval of time during which a flow of packets is captured and aggregated into a flow log record. |
FlowLogOptions | Options to add a flow log to a VPC. |
FlowLogProps | Properties of a VPC Flow Log. |
FlowLogResourceType | The type of resource to create the flow log for. |
FlowLogTrafficType | The type of VPC traffic to log. |
GatewayConfig | Pair represents a gateway created by NAT Provider. |
GatewayVpcEndpoint | A gateway VPC endpoint. |
GatewayVpcEndpointAwsService | An AWS service for a gateway VPC endpoint. |
GatewayVpcEndpointOptions | Options to add a gateway endpoint to a VPC. |
GatewayVpcEndpointProps | Construction properties for a GatewayVpcEndpoint. |
GenericLinuxImage | Construct a Linux machine image from an AMI map. |
GenericLinuxImageProps | Configuration options for GenericLinuxImage. |
GenericSSMParameterImage | Select the image based on a given SSM parameter at deployment time of the CloudFormation Stack. |
GenericWindowsImage | Construct a Windows machine image from an AMI map. |
GenericWindowsImageProps | Configuration options for GenericWindowsImage. |
InitCommand | Command to execute on the instance. |
InitCommandOptions | Options for InitCommand. |
InitCommandWaitDuration | Represents a duration to wait after a command has finished, in case of a reboot (Windows only). |
InitConfig | A collection of configuration elements. |
InitElement | Base class for all CloudFormation Init elements. |
InitFile | Create files on the EC2 instance. |
InitFileAssetOptions | Additional options for creating an InitFile from an asset. |
InitFileOptions | Options for InitFile. |
InitGroup | Create Linux/UNIX groups and assign group IDs. |
InitPackage | A package to be installed during cfn-init time. |
InitService | A services that be enabled, disabled or restarted when the instance is launched. |
InitServiceOptions | Options for an InitService. |
InitServiceRestartHandle | An object that represents reasons to restart an InitService. |
InitSource | Extract an archive into a directory. |
InitSourceAssetOptions | Additional options for an InitSource that builds an asset from local files. |
InitSourceOptions | Additional options for an InitSource. |
InitUser | Create Linux/UNIX users and to assign user IDs. |
InitUserOptions | Optional parameters used when creating a user. |
Instance_ | This represents a single EC2 instance. |
InstanceArchitecture | Identifies an instance's CPU architecture. |
InstanceClass | What class and generation of instance to use. |
InstanceInitiatedShutdownBehavior | Provides the options for specifying the instance initiated shutdown behavior. |
InstanceProps | Properties of an EC2 Instance. |
InstanceRequireImdsv2Aspect | Aspect that applies IMDS configuration on EC2 Instance constructs. |
InstanceRequireImdsv2AspectProps | Properties for |
InstanceSize | What size of instance to use. |
InstanceType | Instance type for EC2 instances. |
InterfaceVpcEndpoint | A interface VPC endpoint. |
InterfaceVpcEndpointAttributes | Construction properties for an ImportedInterfaceVpcEndpoint. |
InterfaceVpcEndpointAwsService | An AWS service for an interface VPC endpoint. |
InterfaceVpcEndpointAwsServiceProps | Optional properties for the InterfaceVpcEndpointAwsService class. |
InterfaceVpcEndpointOptions | Options to add an interface endpoint to a VPC. |
InterfaceVpcEndpointProps | Construction properties for an InterfaceVpcEndpoint. |
InterfaceVpcEndpointService | A custom-hosted service for an interface VPC endpoint. |
IpAddresses | An abstract Provider of IpAddresses. |
IpProtocol | The types of IP addresses provisioned in the VPC. |
Ipv6Addresses | An abstract Provider of Ipv6Addresses. |
KeyPair | An EC2 Key Pair. |
KeyPairAttributes | Attributes of a Key Pair. |
KeyPairFormat | The format of the Key Pair. |
KeyPairProps | The properties of a Key Pair. |
KeyPairType | The type of the key pair. |
LaunchTemplate | This represents an EC2 LaunchTemplate. |
LaunchTemplateAttributes | Attributes for an imported LaunchTemplate. |
LaunchTemplateHttpTokens | The state of token usage for your instance metadata requests. |
LaunchTemplateProps | Properties of a LaunchTemplate. |
LaunchTemplateRequireImdsv2Aspect | Aspect that applies IMDS configuration on EC2 Launch Template constructs. |
LaunchTemplateRequireImdsv2AspectProps | Properties for |
LaunchTemplateSpecialVersions | A class that provides convenient access to special version tokens for LaunchTemplate versions. |
LaunchTemplateSpotOptions | Interface for the Spot market instance options provided in a LaunchTemplate. |
LinuxUserDataOptions | Options when constructing UserData for Linux. |
LocationPackageOptions | Options for InitPackage.rpm/InitPackage.msi. |
LogFormat | The following table describes all of the available fields for a flow log record. |
LookupMachineImage | A machine image whose AMI ID will be searched using DescribeImages. |
LookupMachineImageProps | Properties for looking up an image. |
MachineImage | Factory functions for standard Amazon Machine Image objects. |
MachineImageConfig | Configuration for a machine image. |
MultipartBody | The base class for all classes which can be used as |
MultipartBodyOptions | Options when creating |
MultipartUserData | Mime multipart user data. |
MultipartUserDataOptions | Options for creating |
NamedPackageOptions | Options for InitPackage.yum/apt/rubyGem/python. |
NatGatewayProps | Properties for a NAT gateway. |
NatGatewayProvider | Provider for NAT Gateways. |
NatInstanceImage | Machine image representing the latest NAT instance image. |
NatInstanceProps | Properties for a NAT instance. |
NatInstanceProvider | (deprecated) NAT provider which uses NAT Instances. |
NatInstanceProviderV2 | Modern NAT provider which uses NAT Instances. |
NatProvider | NAT providers. |
NatTrafficDirection | Direction of traffic to allow all by default. |
NetworkAcl | Define a new custom network ACL. |
NetworkAclEntry | Define an entry in a Network ACL table. |
NetworkAclEntryProps | Properties to create NetworkAclEntry. |
NetworkAclProps | Properties to create NetworkAcl. |
OperatingSystemType | The OS type of a particular image. |
Peer | Peer object factories (to be used in Security Group management). |
PlacementGroup | Defines a placement group. |
PlacementGroupProps | Props for a PlacementGroup. |
PlacementGroupSpreadLevel | Determines how this placement group spreads instances. |
PlacementGroupStrategy | Which strategy to use when launching instances. |
Port | Interface for classes that provide the connection-specification parts of a security group rule. |
PortProps | Properties to create a port range. |
PrefixList | A managed prefix list. |
PrefixListOptions | Options to add a prefix list. |
PrefixListProps | Properties for creating a prefix list. |
PrivateSubnet | Represents a private VPC subnet resource. |
PrivateSubnetAttributes | |
PrivateSubnetProps | |
Protocol | Protocol for use in Connection Rules. |
PublicSubnet | Represents a public VPC subnet resource. |
PublicSubnetAttributes | |
PublicSubnetProps | |
RequestedSubnet | Subnet requested for allocation. |
ResolveSsmParameterAtLaunchImage | Select the image based on a given SSM parameter at instance launch time. |
RouterType | Type of router used in route. |
RuleScope | The scope and id in which a given SecurityGroup rule should be defined. |
S3DestinationOptions | Options for writing logs to a S3 destination. |
S3DownloadOptions | Options when downloading files from S3. |
SecurityGroup | Creates an Amazon EC2 security group within a VPC. |
SecurityGroupImportOptions | Additional options for imported security groups. |
SecurityGroupProps | |
SelectedSubnets | Result of selecting a subset of subnets from a VPC. |
ServiceManager | The service manager that will be used by InitServices. |
SpotInstanceInterruption | Provides the options for the types of interruption for spot instances. |
SpotRequestType | The Spot Instance request type. |
SsmParameterImageOptions | Properties for GenericSsmParameterImage. |
Subnet | Represents a new VPC subnet resource. |
SubnetAttributes | |
SubnetConfiguration | Specify configuration parameters for a single subnet group in a VPC. |
SubnetFilter | Contains logic which chooses a set of subnets from a larger list, in conjunction with SubnetSelection, to determine where to place AWS resources such as VPC endpoints, EC2 instances, etc. |
SubnetIpamOptions | CIDR Allocated Subnets. |
SubnetNetworkAclAssociation | |
SubnetNetworkAclAssociationProps | Properties to create a SubnetNetworkAclAssociation. |
SubnetProps | Specify configuration parameters for a VPC subnet. |
SubnetSelection | Customize subnets that are selected for placement of ENIs. |
SubnetType | The type of Subnet. |
SystemdConfigFileOptions | Options for creating a SystemD configuration file. |
TrafficDirection | Direction of traffic the AclEntry applies to. |
TransportProtocol | Transport protocol for client VPN. |
UserData | Instance User Data. |
Volume | Creates a new EBS Volume in AWS EC2. |
VolumeAttributes | Attributes required to import an existing EBS Volume into the Stack. |
VolumeProps | Properties of an EBS Volume. |
Vpc | Define an AWS Virtual Private Cloud. |
VpcAttributes | Properties that reference an external Vpc. |
VpcEndpoint | |
VpcEndpointService | A VPC endpoint service. |
VpcEndpointServiceProps | Construction properties for a VpcEndpointService. |
VpcEndpointType | The type of VPC endpoint. |
VpcIpamOptions | CIDR Allocated Vpc. |
VpcLookupOptions | Properties for looking up an existing VPC. |
VpcProps | Configuration for Vpc. |
VpnConnection | Define a VPN Connection. |
VpnConnectionAttributes | Attributes of an imported VpnConnection. |
VpnConnectionBase | Base class for Vpn connections. |
VpnConnectionOptions | |
VpnConnectionProps | |
VpnConnectionType | The VPN connection type. |
VpnGateway | The VPN Gateway that shall be added to the VPC. |
VpnGatewayProps | The VpnGateway Properties. |
VpnPort | Port for client VPN. |
VpnTunnelOption | |
WindowsImage | Select the latest version of the indicated Windows version. |
WindowsImageProps | Configuration options for WindowsImage. |
WindowsUserDataOptions | Options when constructing UserData for Windows. |
WindowsVersion | The Windows version to use for the WindowsImage. |
Interfaces
CfnCapacityReservation.ITagSpecificationProperty | An array of key-value pairs to apply to this resource. |
CfnCapacityReservationFleet.IInstanceTypeSpecificationProperty | Specifies information about an instance type to use in a Capacity Reservation Fleet. |
CfnCapacityReservationFleet.ITagSpecificationProperty | The tags to apply to a resource when the resource is being created. |
CfnClientVpnEndpoint.ICertificateAuthenticationRequestProperty | Information about the client certificate to be used for authentication. |
CfnClientVpnEndpoint.IClientAuthenticationRequestProperty | Describes the authentication method to be used by a Client VPN endpoint. |
CfnClientVpnEndpoint.IClientConnectOptionsProperty | Indicates whether client connect options are enabled. |
CfnClientVpnEndpoint.IClientLoginBannerOptionsProperty | Options for enabling a customizable text banner that will be displayed on AWS provided clients when a VPN session is established. |
CfnClientVpnEndpoint.IConnectionLogOptionsProperty | Describes the client connection logging options for the Client VPN endpoint. |
CfnClientVpnEndpoint.IDirectoryServiceAuthenticationRequestProperty | Describes the Active Directory to be used for client authentication. |
CfnClientVpnEndpoint.IFederatedAuthenticationRequestProperty | The IAM SAML identity provider used for federated authentication. |
CfnClientVpnEndpoint.ITagSpecificationProperty | Specifies the tags to apply to the Client VPN endpoint. |
CfnEC2Fleet.IAcceleratorCountRequestProperty | The minimum and maximum number of accelerators (GPUs, FPGAs, or AWS Inferentia chips) on an instance. |
CfnEC2Fleet.IAcceleratorTotalMemoryMiBRequestProperty | The minimum and maximum amount of total accelerator memory, in MiB. |
CfnEC2Fleet.IBaselineEbsBandwidthMbpsRequestProperty | The minimum and maximum baseline bandwidth to Amazon EBS, in Mbps. |
CfnEC2Fleet.ICapacityRebalanceProperty | The Spot Instance replacement strategy to use when Amazon EC2 emits a rebalance notification signal that your Spot Instance is at an elevated risk of being interrupted. |
CfnEC2Fleet.ICapacityReservationOptionsRequestProperty | Describes the strategy for using unused Capacity Reservations for fulfilling On-Demand capacity. |
CfnEC2Fleet.IFleetLaunchTemplateConfigRequestProperty | Specifies a launch template and overrides for an EC2 Fleet. |
CfnEC2Fleet.IFleetLaunchTemplateOverridesRequestProperty | Specifies overrides for a launch template for an EC2 Fleet. |
CfnEC2Fleet.IFleetLaunchTemplateSpecificationRequestProperty | Specifies the launch template to be used by the EC2 Fleet for configuring Amazon EC2 instances. |
CfnEC2Fleet.IInstanceRequirementsRequestProperty | The attributes for the instance types. |
CfnEC2Fleet.IMaintenanceStrategiesProperty | The strategies for managing your Spot Instances that are at an elevated risk of being interrupted. |
CfnEC2Fleet.IMemoryGiBPerVCpuRequestProperty | The minimum and maximum amount of memory per vCPU, in GiB. |
CfnEC2Fleet.IMemoryMiBRequestProperty | The minimum and maximum amount of memory, in MiB. |
CfnEC2Fleet.INetworkBandwidthGbpsRequestProperty | The minimum and maximum amount of network bandwidth, in gigabits per second (Gbps). |
CfnEC2Fleet.INetworkInterfaceCountRequestProperty | The minimum and maximum number of network interfaces. |
CfnEC2Fleet.IOnDemandOptionsRequestProperty | Specifies the allocation strategy of On-Demand Instances in an EC2 Fleet. |
CfnEC2Fleet.IPlacementProperty | Describes the placement of an instance. |
CfnEC2Fleet.ISpotOptionsRequestProperty | Specifies the configuration of Spot Instances for an EC2 Fleet. |
CfnEC2Fleet.ITagSpecificationProperty | Specifies the tags to apply to a resource when the resource is being created for an EC2 Fleet. |
CfnEC2Fleet.ITargetCapacitySpecificationRequestProperty | Specifies the number of units to request for an EC2 Fleet. |
CfnEC2Fleet.ITotalLocalStorageGBRequestProperty | The minimum and maximum amount of total local storage, in GB. |
CfnEC2Fleet.IVCpuCountRangeRequestProperty | The minimum and maximum number of vCPUs. |
CfnFlowLog.IDestinationOptionsProperty | Describes the destination options for a flow log. |
CfnInstance.IAssociationParameterProperty | Specifies input parameter values for an SSM document in AWS Systems Manager . |
CfnInstance.IBlockDeviceMappingProperty | Specifies a block device mapping for an instance. |
CfnInstance.ICpuOptionsProperty | Specifies the CPU options for the instance. |
CfnInstance.ICreditSpecificationProperty | Specifies the credit option for CPU usage of a T instance. |
CfnInstance.IEbsProperty | Specifies a block device for an EBS volume. |
CfnInstance.IElasticGpuSpecificationProperty | Amazon Elastic Graphics reached end of life on January 8, 2024. |
CfnInstance.IElasticInferenceAcceleratorProperty | Specifies the Elastic Inference Accelerator for the instance. |
CfnInstance.IEnclaveOptionsProperty | Indicates whether the instance is enabled for AWS Nitro Enclaves. |
CfnInstance.IHibernationOptionsProperty | Specifies the hibernation options for the instance. |
CfnInstance.IInstanceIpv6AddressProperty | Specifies the IPv6 address for the instance. |
CfnInstance.ILaunchTemplateSpecificationProperty | Specifies a launch template to use when launching an Amazon EC2 instance. |
CfnInstance.ILicenseSpecificationProperty | Specifies the license configuration to use. |
CfnInstance.INetworkInterfaceProperty | Specifies a network interface that is to be attached to an instance. |
CfnInstance.INoDeviceProperty | |
CfnInstance.IPrivateDnsNameOptionsProperty | The type of hostnames to assign to instances in the subnet at launch. |
CfnInstance.IPrivateIpAddressSpecificationProperty | Specifies a secondary private IPv4 address for a network interface. |
CfnInstance.ISsmAssociationProperty | Specifies the SSM document and parameter values in AWS Systems Manager to associate with an instance. |
CfnInstance.IStateProperty | Describes the current state of an instance. |
CfnInstance.IVolumeProperty | Specifies a volume to attach to an instance. |
CfnIPAM.IIpamOperatingRegionProperty | The operating Regions for an IPAM. |
CfnIPAMPool.IProvisionedCidrProperty | The CIDR provisioned to the IPAM pool. |
CfnIPAMPool.ISourceResourceProperty | The resource used to provision CIDRs to a resource planning pool. |
CfnIPAMResourceDiscovery.IIpamOperatingRegionProperty | The operating Regions for an IPAM. |
CfnLaunchTemplate.IAcceleratorCountProperty | The minimum and maximum number of accelerators (GPUs, FPGAs, or AWS Inferentia chips) on an instance. |
CfnLaunchTemplate.IAcceleratorTotalMemoryMiBProperty | The minimum and maximum amount of total accelerator memory, in MiB. |
CfnLaunchTemplate.IBaselineEbsBandwidthMbpsProperty | The minimum and maximum baseline bandwidth to Amazon EBS, in Mbps. |
CfnLaunchTemplate.IBlockDeviceMappingProperty | Specifies a block device mapping for a launch template. |
CfnLaunchTemplate.ICapacityReservationSpecificationProperty | Specifies an instance's Capacity Reservation targeting option. You can specify only one option at a time. |
CfnLaunchTemplate.ICapacityReservationTargetProperty | Specifies a target Capacity Reservation. |
CfnLaunchTemplate.IConnectionTrackingSpecificationProperty | A security group connection tracking specification that enables you to set the idle timeout for connection tracking on an Elastic network interface. |
CfnLaunchTemplate.ICpuOptionsProperty | Specifies the CPU options for an instance. |
CfnLaunchTemplate.ICreditSpecificationProperty | Specifies the credit option for CPU usage of a T2, T3, or T3a instance. |
CfnLaunchTemplate.IEbsProperty | Parameters for a block device for an EBS volume in an Amazon EC2 launch template. |
CfnLaunchTemplate.IElasticGpuSpecificationProperty | Amazon Elastic Graphics reached end of life on January 8, 2024. |
CfnLaunchTemplate.IEnaSrdSpecificationProperty | ENA Express uses AWS Scalable Reliable Datagram (SRD) technology to increase the maximum bandwidth used per stream and minimize tail latency of network traffic between EC2 instances. |
CfnLaunchTemplate.IEnaSrdUdpSpecificationProperty | ENA Express is compatible with both TCP and UDP transport protocols. |
CfnLaunchTemplate.IEnclaveOptionsProperty | Indicates whether the instance is enabled for AWS Nitro Enclaves. |
CfnLaunchTemplate.IHibernationOptionsProperty | Specifies whether your instance is configured for hibernation. |
CfnLaunchTemplate.IIamInstanceProfileProperty | Specifies an IAM instance profile, which is a container for an IAM role for your instance. |
CfnLaunchTemplate.IInstanceMarketOptionsProperty | Specifies the market (purchasing) option for an instance. |
CfnLaunchTemplate.IInstanceRequirementsProperty | The attributes for the instance types. |
CfnLaunchTemplate.IIpv4PrefixSpecificationProperty | Specifies an IPv4 prefix for a network interface. |
CfnLaunchTemplate.IIpv6AddProperty | Specifies an IPv6 address in an Amazon EC2 launch template. |
CfnLaunchTemplate.IIpv6PrefixSpecificationProperty | Specifies an IPv6 prefix for a network interface. |
CfnLaunchTemplate.ILaunchTemplateDataProperty | The information to include in the launch template. |
CfnLaunchTemplate.ILaunchTemplateElasticInferenceAcceleratorProperty | Specifies an elastic inference accelerator. |
CfnLaunchTemplate.ILaunchTemplateTagSpecificationProperty | Specifies the tags to apply to the launch template during creation. |
CfnLaunchTemplate.ILicenseSpecificationProperty | Specifies a license configuration for an instance. |
CfnLaunchTemplate.IMaintenanceOptionsProperty | The maintenance options of your instance. |
CfnLaunchTemplate.IMemoryGiBPerVCpuProperty | The minimum and maximum amount of memory per vCPU, in GiB. |
CfnLaunchTemplate.IMemoryMiBProperty | The minimum and maximum amount of memory, in MiB. |
CfnLaunchTemplate.IMetadataOptionsProperty | The metadata options for the instance. |
CfnLaunchTemplate.IMonitoringProperty | Specifies whether detailed monitoring is enabled for an instance. |
CfnLaunchTemplate.INetworkBandwidthGbpsProperty | The minimum and maximum amount of network bandwidth, in gigabits per second (Gbps). |
CfnLaunchTemplate.INetworkInterfaceCountProperty | The minimum and maximum number of network interfaces. |
CfnLaunchTemplate.INetworkInterfaceProperty | Specifies the parameters for a network interface. |
CfnLaunchTemplate.IPlacementProperty | Specifies the placement of an instance. |
CfnLaunchTemplate.IPrivateDnsNameOptionsProperty | The hostname type for EC2 instances launched into this subnet and how DNS A and AAAA record queries should be handled. |
CfnLaunchTemplate.IPrivateIpAddProperty | Specifies a secondary private IPv4 address for a network interface. |
CfnLaunchTemplate.ISpotOptionsProperty | Specifies options for Spot Instances. |
CfnLaunchTemplate.ITagSpecificationProperty | Specifies the tags to apply to resources that are created during instance launch. |
CfnLaunchTemplate.ITotalLocalStorageGBProperty | The minimum and maximum amount of total local storage, in GB. |
CfnLaunchTemplate.IVCpuCountProperty | The minimum and maximum number of vCPUs. |
CfnNetworkAclEntry.IIcmpProperty | Describes the ICMP type and code. |
CfnNetworkAclEntry.IPortRangeProperty | Describes a range of ports. |
CfnNetworkInsightsAccessScope.IAccessScopePathRequestProperty | Describes a path. |
CfnNetworkInsightsAccessScope.IPacketHeaderStatementRequestProperty | Describes a packet header statement. |
CfnNetworkInsightsAccessScope.IPathStatementRequestProperty | Describes a path statement. |
CfnNetworkInsightsAccessScope.IResourceStatementRequestProperty | Describes a resource statement. |
CfnNetworkInsightsAccessScope.IThroughResourcesStatementRequestProperty | Describes a through resource statement. |
CfnNetworkInsightsAnalysis.IAdditionalDetailProperty | Describes an additional detail for a path analysis. |
CfnNetworkInsightsAnalysis.IAlternatePathHintProperty | Describes an potential intermediate component of a feasible path. |
CfnNetworkInsightsAnalysis.IAnalysisAclRuleProperty | Describes a network access control (ACL) rule. |
CfnNetworkInsightsAnalysis.IAnalysisComponentProperty | Describes a path component. |
CfnNetworkInsightsAnalysis.IAnalysisLoadBalancerListenerProperty | Describes a load balancer listener. |
CfnNetworkInsightsAnalysis.IAnalysisLoadBalancerTargetProperty | Describes a load balancer target. |
CfnNetworkInsightsAnalysis.IAnalysisPacketHeaderProperty | Describes a header. |
CfnNetworkInsightsAnalysis.IAnalysisRouteTableRouteProperty | Describes a route table route. |
CfnNetworkInsightsAnalysis.IAnalysisSecurityGroupRuleProperty | Describes a security group rule. |
CfnNetworkInsightsAnalysis.IExplanationProperty | Describes an explanation code for an unreachable path. |
CfnNetworkInsightsAnalysis.IPathComponentProperty | Describes a path component. |
CfnNetworkInsightsAnalysis.IPortRangeProperty | Describes a range of ports. |
CfnNetworkInsightsAnalysis.ITransitGatewayRouteTableRouteProperty | Describes a route in a transit gateway route table. |
CfnNetworkInsightsPath.IFilterPortRangeProperty | Describes a port range. |
CfnNetworkInsightsPath.IPathFilterProperty | Describes a set of filters for a path analysis. |
CfnNetworkInterface.IConnectionTrackingSpecificationProperty | Configurable options for connection tracking on a network interface. |
CfnNetworkInterface.IInstanceIpv6AddressProperty | Describes the IPv6 addresses to associate with the network interface. |
CfnNetworkInterface.IIpv4PrefixSpecificationProperty | Describes an IPv4 prefix. |
CfnNetworkInterface.IIpv6PrefixSpecificationProperty | Describes the IPv6 prefix. |
CfnNetworkInterface.IPrivateIpAddressSpecificationProperty | Describes a secondary private IPv4 address for a network interface. |
CfnNetworkInterfaceAttachment.IEnaSrdSpecificationProperty | ENA Express uses AWS Scalable Reliable Datagram (SRD) technology to increase the maximum bandwidth used per stream and minimize tail latency of network traffic between EC2 instances. |
CfnNetworkInterfaceAttachment.IEnaSrdUdpSpecificationProperty | ENA Express is compatible with both TCP and UDP transport protocols. |
CfnPrefixList.IEntryProperty | An entry for a prefix list. |
CfnSecurityGroup.IEgressProperty | Adds the specified outbound (egress) rule to a security group. |
CfnSecurityGroup.IIngressProperty | Adds an inbound (ingress) rule to a security group. |
CfnSpotFleet.IAcceleratorCountRequestProperty | The minimum and maximum number of accelerators (GPUs, FPGAs, or AWS Inferentia chips) on an instance. |
CfnSpotFleet.IAcceleratorTotalMemoryMiBRequestProperty | The minimum and maximum amount of total accelerator memory, in MiB. |
CfnSpotFleet.IBaselineEbsBandwidthMbpsRequestProperty | The minimum and maximum baseline bandwidth to Amazon EBS, in Mbps. |
CfnSpotFleet.IBlockDeviceMappingProperty | Specifies a block device mapping. |
CfnSpotFleet.IClassicLoadBalancerProperty | Specifies a Classic Load Balancer. |
CfnSpotFleet.IClassicLoadBalancersConfigProperty | Specifies the Classic Load Balancers to attach to a Spot Fleet. |
CfnSpotFleet.IEbsBlockDeviceProperty | Describes a block device for an EBS volume. |
CfnSpotFleet.IFleetLaunchTemplateSpecificationProperty | Specifies the launch template to be used by the Spot Fleet request for configuring Amazon EC2 instances. |
CfnSpotFleet.IGroupIdentifierProperty | Describes a security group. |
CfnSpotFleet.IIamInstanceProfileSpecificationProperty | Describes an IAM instance profile. |
CfnSpotFleet.IInstanceIpv6AddressProperty | Describes an IPv6 address. |
CfnSpotFleet.IInstanceNetworkInterfaceSpecificationProperty | Describes a network interface. |
CfnSpotFleet.IInstanceRequirementsRequestProperty | The attributes for the instance types. |
CfnSpotFleet.ILaunchTemplateConfigProperty | Specifies a launch template and overrides. |
CfnSpotFleet.ILaunchTemplateOverridesProperty | Specifies overrides for a launch template. |
CfnSpotFleet.ILoadBalancersConfigProperty | Specifies the Classic Load Balancers and target groups to attach to a Spot Fleet request. |
CfnSpotFleet.IMemoryGiBPerVCpuRequestProperty | The minimum and maximum amount of memory per vCPU, in GiB. |
CfnSpotFleet.IMemoryMiBRequestProperty | The minimum and maximum amount of memory, in MiB. |
CfnSpotFleet.INetworkBandwidthGbpsRequestProperty | The minimum and maximum amount of baseline network bandwidth, in gigabits per second (Gbps). |
CfnSpotFleet.INetworkInterfaceCountRequestProperty | The minimum and maximum number of network interfaces. |
CfnSpotFleet.IPrivateIpAddressSpecificationProperty | Describes a secondary private IPv4 address for a network interface. |
CfnSpotFleet.ISpotCapacityRebalanceProperty | The Spot Instance replacement strategy to use when Amazon EC2 emits a signal that your Spot Instance is at an elevated risk of being interrupted. |
CfnSpotFleet.ISpotFleetLaunchSpecificationProperty | Specifies the launch specification for one or more Spot Instances. |
CfnSpotFleet.ISpotFleetMonitoringProperty | Describes whether monitoring is enabled. |
CfnSpotFleet.ISpotFleetRequestConfigDataProperty | Specifies the configuration of a Spot Fleet request. |
CfnSpotFleet.ISpotFleetTagSpecificationProperty | The tags for a Spot Fleet resource. |
CfnSpotFleet.ISpotMaintenanceStrategiesProperty | The strategies for managing your Spot Instances that are at an elevated risk of being interrupted. |
CfnSpotFleet.ISpotPlacementProperty | Describes Spot Instance placement. |
CfnSpotFleet.ITargetGroupProperty | Describes a load balancer target group. |
CfnSpotFleet.ITargetGroupsConfigProperty | Describes the target groups to attach to a Spot Fleet. |
CfnSpotFleet.ITotalLocalStorageGBRequestProperty | The minimum and maximum amount of total local storage, in GB. |
CfnSpotFleet.IVCpuCountRangeRequestProperty | The minimum and maximum number of vCPUs. |
CfnSubnet.IPrivateDnsNameOptionsOnLaunchProperty | Describes the options for instance hostnames. |
CfnTrafficMirrorFilterRule.ITrafficMirrorPortRangeProperty | Describes the Traffic Mirror port range. |
CfnTransitGatewayAttachment.IOptionsProperty | Describes the VPC attachment options. |
CfnTransitGatewayConnect.ITransitGatewayConnectOptionsProperty | Describes the Connect attachment options. |
CfnTransitGatewayMulticastDomain.IOptionsProperty | The options for the transit gateway multicast domain. |
CfnTransitGatewayPeeringAttachment.IPeeringAttachmentStatusProperty | The status of the transit gateway peering attachment. |
CfnTransitGatewayVpcAttachment.IOptionsProperty | Describes the VPC attachment options. |
CfnVerifiedAccessEndpoint.ILoadBalancerOptionsProperty | Describes the load balancer options when creating an AWS Verified Access endpoint using the |
CfnVerifiedAccessEndpoint.INetworkInterfaceOptionsProperty | Describes the network interface options when creating an AWS Verified Access endpoint using the |
CfnVerifiedAccessEndpoint.ISseSpecificationProperty | AWS Verified Access provides server side encryption by default to data at rest using AWS -owned KMS keys. |
CfnVerifiedAccessGroup.ISseSpecificationProperty | AWS Verified Access provides server side encryption by default to data at rest using AWS -owned KMS keys. |
CfnVerifiedAccessInstance.ICloudWatchLogsProperty | Options for CloudWatch Logs as a logging destination. |
CfnVerifiedAccessInstance.IKinesisDataFirehoseProperty | Options for Kinesis as a logging destination. |
CfnVerifiedAccessInstance.IS3Property | Options for Amazon S3 as a logging destination. |
CfnVerifiedAccessInstance.IVerifiedAccessLogsProperty | Describes the options for Verified Access logs. |
CfnVerifiedAccessInstance.IVerifiedAccessTrustProviderProperty | A trust provider is a third-party entity that creates, maintains, and manages identity information for users and devices. |
CfnVerifiedAccessTrustProvider.IDeviceOptionsProperty | Describes the options for an AWS Verified Access device-identity based trust provider. |
CfnVerifiedAccessTrustProvider.IOidcOptionsProperty | Describes the options for an OpenID Connect-compatible user-identity trust provider. |
CfnVerifiedAccessTrustProvider.ISseSpecificationProperty | AWS Verified Access provides server side encryption by default to data at rest using AWS -owned KMS keys. |
CfnVPNConnection.IVpnTunnelOptionsSpecificationProperty | The tunnel options for a single VPN tunnel. |
IAclCidrConfig | Acl Configuration for CIDR. |
IAclIcmp | Properties to create Icmp. |
IAclPortRange | Properties to create PortRange. |
IAclTrafficConfig | Acl Configuration for traffic. |
IAddRouteOptions | Options for adding a new route to a subnet. |
IAllocateCidrRequest | Request for subnets CIDR to be allocated for a Vpc. |
IAllocatedSubnet | CIDR Allocated Subnet. |
IAllocateIpv6CidrRequest | Request for subnet IPv6 CIDRs to be allocated for a VPC. |
IAllocateVpcIpv6CidrRequest | Request for allocation of the VPC IPv6 CIDR. |
IAmazonLinux2022ImageSsmParameterProps | Properties specific to al2022 images. |
IAmazonLinux2023ImageSsmParameterProps | Properties specific to al2023 images. |
IAmazonLinux2ImageSsmParameterProps | Properties specific to amzn2 images. |
IAmazonLinuxImageProps | Amazon Linux image properties. |
IAmazonLinuxImageSsmParameterBaseOptions | Base options for amazon linux ssm parameters. |
IAmazonLinuxImageSsmParameterBaseProps | Base properties for an Amazon Linux SSM Parameter. |
IAmazonLinuxImageSsmParameterCommonOptions | Common options across all generations. |
IApplyCloudFormationInitOptions | Options for applying CloudFormation init to an instance or instance group. |
IAttachInitOptions | Options for attaching a CloudFormationInit to a resource. |
IAwsIpamProps | Configuration for AwsIpam. |
IBastionHostLinuxProps | Properties of the bastion host. |
IBlockDevice | Block device. |
ICfnCapacityReservationFleetProps | Properties for defining a |
ICfnCapacityReservationProps | Properties for defining a |
ICfnCarrierGatewayProps | Properties for defining a |
ICfnClientVpnAuthorizationRuleProps | Properties for defining a |
ICfnClientVpnEndpointProps | Properties for defining a |
ICfnClientVpnRouteProps | Properties for defining a |
ICfnClientVpnTargetNetworkAssociationProps | Properties for defining a |
ICfnCustomerGatewayProps | Properties for defining a |
ICfnDHCPOptionsProps | Properties for defining a |
ICfnEC2FleetProps | Properties for defining a |
ICfnEgressOnlyInternetGatewayProps | Properties for defining a |
ICfnEIPAssociationProps | Properties for defining a |
ICfnEIPProps | Properties for defining a |
ICfnEnclaveCertificateIamRoleAssociationProps | Properties for defining a |
ICfnFlowLogProps | Properties for defining a |
ICfnGatewayRouteTableAssociationProps | Properties for defining a |
ICfnHostProps | Properties for defining a |
ICfnInstanceConnectEndpointProps | Properties for defining a |
ICfnInstanceProps | Properties for defining a |
ICfnInternetGatewayProps | Properties for defining a |
ICfnIPAMAllocationProps | Properties for defining a |
ICfnIPAMPoolCidrProps | Properties for defining a |
ICfnIPAMPoolProps | Properties for defining a |
ICfnIPAMProps | Properties for defining a |
ICfnIPAMResourceDiscoveryAssociationProps | Properties for defining a |
ICfnIPAMResourceDiscoveryProps | Properties for defining a |
ICfnIPAMScopeProps | Properties for defining a |
ICfnKeyPairProps | Properties for defining a |
ICfnLaunchTemplateProps | Properties for defining a |
ICfnLocalGatewayRouteProps | Properties for defining a |
ICfnLocalGatewayRouteTableProps | Properties for defining a |
ICfnLocalGatewayRouteTableVirtualInterfaceGroupAssociationProps | Properties for defining a |
ICfnLocalGatewayRouteTableVPCAssociationProps | Properties for defining a |
ICfnNatGatewayProps | Properties for defining a |
ICfnNetworkAclEntryProps | Properties for defining a |
ICfnNetworkAclProps | Properties for defining a |
ICfnNetworkInsightsAccessScopeAnalysisProps | Properties for defining a |
ICfnNetworkInsightsAccessScopeProps | Properties for defining a |
ICfnNetworkInsightsAnalysisProps | Properties for defining a |
ICfnNetworkInsightsPathProps | Properties for defining a |
ICfnNetworkInterfaceAttachmentProps | Properties for defining a |
ICfnNetworkInterfacePermissionProps | Properties for defining a |
ICfnNetworkInterfaceProps | Properties for defining a |
ICfnNetworkPerformanceMetricSubscriptionProps | Properties for defining a |
ICfnPlacementGroupProps | Properties for defining a |
ICfnPrefixListProps | Properties for defining a |
ICfnRouteProps | Properties for defining a |
ICfnRouteTableProps | Properties for defining a |
ICfnSecurityGroupEgressProps | Properties for defining a |
ICfnSecurityGroupIngressProps | Properties for defining a |
ICfnSecurityGroupProps | Properties for defining a |
ICfnSnapshotBlockPublicAccessProps | Properties for defining a |
ICfnSpotFleetProps | Properties for defining a |
ICfnSubnetCidrBlockProps | Properties for defining a |
ICfnSubnetNetworkAclAssociationProps | Properties for defining a |
ICfnSubnetProps | Properties for defining a |
ICfnSubnetRouteTableAssociationProps | Properties for defining a |
ICfnTrafficMirrorFilterProps | Properties for defining a |
ICfnTrafficMirrorFilterRuleProps | Properties for defining a |
ICfnTrafficMirrorSessionProps | Properties for defining a |
ICfnTrafficMirrorTargetProps | Properties for defining a |
ICfnTransitGatewayAttachmentProps | Properties for defining a |
ICfnTransitGatewayConnectProps | Properties for defining a |
ICfnTransitGatewayMulticastDomainAssociationProps | Properties for defining a |
ICfnTransitGatewayMulticastDomainProps | Properties for defining a |
ICfnTransitGatewayMulticastGroupMemberProps | Properties for defining a |
ICfnTransitGatewayMulticastGroupSourceProps | Properties for defining a |
ICfnTransitGatewayPeeringAttachmentProps | Properties for defining a |
ICfnTransitGatewayProps | Properties for defining a |
ICfnTransitGatewayRouteProps | Properties for defining a |
ICfnTransitGatewayRouteTableAssociationProps | Properties for defining a |
ICfnTransitGatewayRouteTablePropagationProps | Properties for defining a |
ICfnTransitGatewayRouteTableProps | Properties for defining a |
ICfnTransitGatewayVpcAttachmentProps | Properties for defining a |
ICfnVerifiedAccessEndpointProps | Properties for defining a |
ICfnVerifiedAccessGroupProps | Properties for defining a |
ICfnVerifiedAccessInstanceProps | Properties for defining a |
ICfnVerifiedAccessTrustProviderProps | Properties for defining a |
ICfnVolumeAttachmentProps | Properties for defining a |
ICfnVolumeProps | Properties for defining a |
ICfnVPCCidrBlockProps | Properties for defining a |
ICfnVPCDHCPOptionsAssociationProps | Properties for defining a |
ICfnVPCEndpointConnectionNotificationProps | Properties for defining a |
ICfnVPCEndpointProps | Properties for defining a |
ICfnVPCEndpointServicePermissionsProps | Properties for defining a |
ICfnVPCEndpointServiceProps | Properties for defining a |
ICfnVPCGatewayAttachmentProps | Properties for defining a |
ICfnVPCPeeringConnectionProps | Properties for defining a |
ICfnVPCProps | Properties for defining a |
ICfnVPNConnectionProps | Properties for defining a |
ICfnVPNConnectionRouteProps | Properties for defining a |
ICfnVPNGatewayProps | Properties for defining a |
ICfnVPNGatewayRoutePropagationProps | Properties for defining a |
IClientVpnAuthorizationRuleOptions | Options for a ClientVpnAuthorizationRule. |
IClientVpnAuthorizationRuleProps | Properties for a ClientVpnAuthorizationRule. |
IClientVpnConnectionHandler | A connection handler for client VPN endpoints. |
IClientVpnEndpoint | A client VPN endpoint. |
IClientVpnEndpointAttributes | Attributes when importing an existing client VPN endpoint. |
IClientVpnEndpointOptions | Options for a client VPN endpoint. |
IClientVpnEndpointProps | Properties for a client VPN endpoint. |
IClientVpnRouteOptions | Options for a ClientVpnRoute. |
IClientVpnRouteProps | Properties for a ClientVpnRoute. |
ICommonNetworkAclEntryOptions | Basic NetworkACL entry props. |
IConfigSetProps | Options for CloudFormationInit.withConfigSets. |
IConfigureNatOptions | Options passed by the VPC when NAT needs to be configured. |
IConnectable | An object that has a Connections object. |
IConnectionRule | |
IConnectionsProps | Properties to intialize a new Connections object. |
ICreateIpv6CidrBlocksRequest | Request for IPv6 CIDR block to be split up. |
IDestinationOptions | Options for writing logs to a destination. |
IEbsDeviceOptions | Block device options for an EBS volume. |
IEbsDeviceOptionsBase | Base block device options for an EBS volume. |
IEbsDeviceProps | Properties of an EBS block device. |
IEbsDeviceSnapshotOptions | Block device options for an EBS volume created from a snapshot. |
IEnableVpnGatewayOptions | Options for the Vpc.enableVpnGateway() method. |
IExecuteFileOptions | Options when executing a file. |
IFlowLog | A FlowLog. |
IFlowLogDestinationConfig | Flow Log Destination configuration. |
IFlowLogOptions | Options to add a flow log to a VPC. |
IFlowLogProps | Properties of a VPC Flow Log. |
IGatewayConfig | Pair represents a gateway created by NAT Provider. |
IGatewayVpcEndpoint | A gateway VPC endpoint. |
IGatewayVpcEndpointOptions | Options to add a gateway endpoint to a VPC. |
IGatewayVpcEndpointProps | Construction properties for a GatewayVpcEndpoint. |
IGatewayVpcEndpointService | A service for a gateway VPC endpoint. |
IGenericLinuxImageProps | Configuration options for GenericLinuxImage. |
IGenericWindowsImageProps | Configuration options for GenericWindowsImage. |
IInitCommandOptions | Options for InitCommand. |
IInitFileAssetOptions | Additional options for creating an InitFile from an asset. |
IInitFileOptions | Options for InitFile. |
IInitServiceOptions | Options for an InitService. |
IInitSourceAssetOptions | Additional options for an InitSource that builds an asset from local files. |
IInitSourceOptions | Additional options for an InitSource. |
IInitUserOptions | Optional parameters used when creating a user. |
IInstance | |
IInstanceProps | Properties of an EC2 Instance. |
IInstanceRequireImdsv2AspectProps | Properties for |
IInterfaceVpcEndpoint | An interface VPC endpoint. |
IInterfaceVpcEndpointAttributes | Construction properties for an ImportedInterfaceVpcEndpoint. |
IInterfaceVpcEndpointAwsServiceProps | Optional properties for the InterfaceVpcEndpointAwsService class. |
IInterfaceVpcEndpointOptions | Options to add an interface endpoint to a VPC. |
IInterfaceVpcEndpointProps | Construction properties for an InterfaceVpcEndpoint. |
IInterfaceVpcEndpointService | A service for an interface VPC endpoint. |
IIpAddresses | Implementations for ip address management. |
IIpv6Addresses | Implementations for IPv6 address management. |
IKeyPair | An EC2 Key Pair. |
IKeyPairAttributes | Attributes of a Key Pair. |
IKeyPairProps | The properties of a Key Pair. |
ILaunchTemplate | Interface for LaunchTemplate-like objects. |
ILaunchTemplateAttributes | Attributes for an imported LaunchTemplate. |
ILaunchTemplateProps | Properties of a LaunchTemplate. |
ILaunchTemplateRequireImdsv2AspectProps | Properties for |
ILaunchTemplateSpotOptions | Interface for the Spot market instance options provided in a LaunchTemplate. |
ILinuxUserDataOptions | Options when constructing UserData for Linux. |
ILocationPackageOptions | Options for InitPackage.rpm/InitPackage.msi. |
ILookupMachineImageProps | Properties for looking up an image. |
IMachineImage | Interface for classes that can select an appropriate machine image to use. |
IMachineImageConfig | Configuration for a machine image. |
IMultipartBodyOptions | Options when creating |
IMultipartUserDataOptions | Options for creating |
INamedPackageOptions | Options for InitPackage.yum/apt/rubyGem/python. |
INatGatewayProps | Properties for a NAT gateway. |
INatInstanceProps | Properties for a NAT instance. |
INetworkAcl | A NetworkAcl. |
INetworkAclEntry | A NetworkAclEntry. |
INetworkAclEntryProps | Properties to create NetworkAclEntry. |
INetworkAclProps | Properties to create NetworkAcl. |
IPeer | Interface for classes that provide the peer-specification parts of a security group rule. |
IPlacementGroup | Determines where your instances are placed on the underlying hardware according to the specified PlacementGroupStrategy. |
IPlacementGroupProps | Props for a PlacementGroup. |
IPortProps | Properties to create a port range. |
IPrefixList | A prefix list. |
IPrefixListOptions | Options to add a prefix list. |
IPrefixListProps | Properties for creating a prefix list. |
IPrivateSubnet | |
IPrivateSubnetAttributes | |
IPrivateSubnetProps | |
IPublicSubnet | |
IPublicSubnetAttributes | |
IPublicSubnetProps | |
IRequestedSubnet | Subnet requested for allocation. |
IRouteTable | An abstract route table. |
IRuleScope | The scope and id in which a given SecurityGroup rule should be defined. |
IS3DestinationOptions | Options for writing logs to a S3 destination. |
IS3DownloadOptions | Options when downloading files from S3. |
ISecurityGroup | Interface for security group-like objects. |
ISecurityGroupImportOptions | Additional options for imported security groups. |
ISecurityGroupProps | |
ISelectedSubnets | Result of selecting a subset of subnets from a VPC. |
ISsmParameterImageOptions | Properties for GenericSsmParameterImage. |
ISubnet | |
ISubnetAttributes | |
ISubnetConfiguration | Specify configuration parameters for a single subnet group in a VPC. |
ISubnetIpamOptions | CIDR Allocated Subnets. |
ISubnetNetworkAclAssociation | A SubnetNetworkAclAssociation. |
ISubnetNetworkAclAssociationProps | Properties to create a SubnetNetworkAclAssociation. |
ISubnetProps | Specify configuration parameters for a VPC subnet. |
ISubnetSelection | Customize subnets that are selected for placement of ENIs. |
ISystemdConfigFileOptions | Options for creating a SystemD configuration file. |
IVolume | An EBS Volume in AWS EC2. |
IVolumeAttributes | Attributes required to import an existing EBS Volume into the Stack. |
IVolumeProps | Properties of an EBS Volume. |
IVpc | |
IVpcAttributes | Properties that reference an external Vpc. |
IVpcEndpoint | A VPC endpoint. |
IVpcEndpointService | A VPC endpoint service. |
IVpcEndpointServiceLoadBalancer | A load balancer that can host a VPC Endpoint Service. |
IVpcEndpointServiceProps | Construction properties for a VpcEndpointService. |
IVpcIpamOptions | CIDR Allocated Vpc. |
IVpcLookupOptions | Properties for looking up an existing VPC. |
IVpcProps | Configuration for Vpc. |
IVpnConnection | |
IVpnConnectionAttributes | Attributes of an imported VpnConnection. |
IVpnConnectionOptions | |
IVpnConnectionProps | |
IVpnGateway | The virtual private gateway interface. |
IVpnGatewayProps | The VpnGateway Properties. |
IVpnTunnelOption | |
IWindowsImageProps | Configuration options for WindowsImage. |
IWindowsUserDataOptions | Options when constructing UserData for Windows. |