Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{
"Resources": {
"VolumeA92988D3": {
"Type": "AWS::EC2::Volume",
"Properties": {
"AvailabilityZone": "us-east-1a",
"MultiAttachEnabled": false,
"Size": 1,
"SnapshotId": "snap-123456789abcdef0",
"VolumeInitializationRate": 100,
"VolumeType": "gp3"
},
"UpdateReplacePolicy": "Retain",
"DeletionPolicy": "Retain"
}
},
"Parameters": {
"BootstrapVersion": {
"Type": "AWS::SSM::Parameter::Value<String>",
"Default": "/cdk-bootstrap/hnb659fds/version",
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
}
},
"Rules": {
"CheckBootstrapVersion": {
"Assertions": [
{
"Assert": {
"Fn::Not": [
{
"Fn::Contains": [
[
"1",
"2",
"3",
"4",
"5"
],
{
"Ref": "BootstrapVersion"
}
]
}
]
},
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
}
]
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import * as cdk from 'aws-cdk-lib';
import * as integ from '@aws-cdk/integ-tests-alpha';
import * as ec2 from 'aws-cdk-lib/aws-ec2';

const app = new cdk.App();

const stack = new cdk.Stack(app, 'volume-initialization-rate-stack');

const snapshotId = process.env.SNAPSHOT_ID ?? 'snap-123456789abcdef0';

new ec2.Volume(stack, 'Volume', {
availabilityZone: 'us-east-1a',
size: cdk.Size.gibibytes(1),
volumeType: ec2.EbsDeviceVolumeType.GP3,
volumeInitializationRate: cdk.Size.mebibytes(100),
snapshotId,
});

new integ.IntegTest(app, 'volume-initialization-rate-integ', {
testCases: [stack],
});
19 changes: 19 additions & 0 deletions packages/aws-cdk-lib/aws-ec2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1843,6 +1843,25 @@ new ec2.Volume(this, 'Volume', {
});
```

#### Volume initialization rate

When creating an EBS volume from a snapshot, you can specify the [volume initialization rate](https://docs.aws.amazon.com/ebs/latest/userguide/initalize-volume.html#volume-initialization-rate) at which the snapshot blocks are downloaded from Amazon S3 to the volume.
Specifying a volume initialization rate ensures that the volume is initialized at a predictable and consistent rate after creation.

```ts
new ec2.Volume(this, 'Volume', {
availabilityZone: 'us-east-1a',
size: Size.gibibytes(500),
snapshotId: 'snap-1234567890abcdef0',
volumeInitializationRate: Size.mebibytes(250),
});
```

The `volumeInitializationRate` must be:

* Between 100 and 300 MiB/s
* Only specified when creating a volume from a snapshot

### Configuring Instance Metadata Service (IMDS)

#### Toggling IMDSv1
Expand Down
Loading
Loading