2016-11-03 4 views

Antwort

3

Dies wird in der Dokumentation beschrieben: Sharing an Amazon EBS Snapshot

Die Schritte aws CLI sind

  1. Ändern von Berechtigungen für Ihre Schnappschüsse

teilen privat zu übersetzen mit:

aws ec2 modify-snapshot-attribute \ 
    --snapshot-id "snap-xxxxx" \ 
    --create-volume-permission "{ 
     \"Add\": [ 
      { 
       \"UserId\": \"XXXXXXX\" 
      } 
     ] 
    }" 

Um p zu teilen ublicly:

aws ec2 modify-snapshot-attribute \ 
    --snapshot-id "snap-xxxxx" \ 
    --create-volume-permission "{ 
     \"Add\": [ 
      { 
       \"Group\": \"all\" 
      } 
     ] 
    }" 
  1. Kopieren Sie den Snapshot

    aws ec2 copy-snapshot \ 
    --region "target-region" 
    --source-region "source" \ 
    --source-snapshot-id "snap-xxxxx" \ 
    --description "Example Description" 
    

vorsichtig sein, nicht zu verwechseln mit destination-region

--destination-region (string) 
     The destination region to use in the PresignedUrl parameter of a 
     snapshot copy operation. This parameter is only valid for specifying 
     the destination region in a PresignedUrl parameter, where it is 
     required. 

     NOTE: 
      copy-snapshot sends the snapshot copy to the regional endpoint 
      that you send the HTTP request to, such as ec2.us-east-1.amazon- 
      aws.com (in the AWS CLI, this is specified with the --region 
      parameter or the default region in your AWS configuration file). 
0

Anstatt „übertragen "Ein Snapshot zu einem anderen Konto ist der einfachste Weg, Berechtigungen zu ändern erlauben Sie einem anderen Konto Zugriff auf den Snapshot.

Auf diese Weise wird der Snapshot nur einmal gespeichert und nicht doppelt gespeichert.

Snapshot-Erstellung kann scheduled via Amazon CloudWatch Events sein. Sie können jedoch keine Berechtigungen festlegen. Daher müssen Sie entweder:

  • Führen Sie einen Cron-Job oder Scheduled Task Ihren eigenen Code auszuführen, auf dem eigenen Computer oder einer Instanz Amazon EC2 oder
  • Eine AWS Lambda-Funktion erstellt sowohl den Snapshot als auch die Berechtigungen
Verwandte Themen