Skip to content

Instantly share code, notes, and snippets.

@bearpelican
Created July 13, 2018 12:28
Show Gist options
  • Select an option

  • Save bearpelican/692408a8b3cb299531953dc35de240cd to your computer and use it in GitHub Desktop.

Select an option

Save bearpelican/692408a8b3cb299531953dc35de240cd to your computer and use it in GitHub Desktop.
# creating snapshot
v = #volume
snapshot = ec2.create_snapshot(
Description='Imagenet data snapshot',
VolumeId=v.id,
TagSpecifications=[
{
'ResourceType': 'snapshot',
'Tags': [
{
'Key': 'Name',
'Value': 'imagenet_high_perf_snapshot'
},
]
},
]
)
# creating duplicate ebs volumes
tag_specs = [{
'ResourceType': 'volume',
'Tags': [{
'Key': 'Name',
'Value': 'imagenet_high_perf_8'
}]
}]
volume = ec2.create_volume(Size=600, VolumeType='io1', TagSpecifications=tag_specs,
AvailabilityZone='us-west-2c', SnapshotId=snapshot.id, Iops=15000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment