{"id":118,"date":"2017-04-26T15:56:30","date_gmt":"2017-04-26T23:56:30","guid":{"rendered":"http:\/\/nerdsector.com\/ns\/?p=118"},"modified":"2017-04-27T10:02:37","modified_gmt":"2017-04-27T18:02:37","slug":"aws-s3-cp-command-line-example-change-encryption-keys","status":"publish","type":"post","link":"https:\/\/nerdsector.com\/ns\/2017\/04\/26\/aws-s3-cp-command-line-example-change-encryption-keys\/","title":{"rendered":"AWS S3 CP Command Line Example to Change Encryption keys"},"content":{"rendered":"<p>The AWS Console allows you to upload files to a bucket and set the server side encryption. \u00a0This defaults to AES256. \u00a0However, there are times when you may want to encrypt a S3 object using a specific key. \u00a0For example, RDS SQL database native restore. \u00a0 Therefore at times you may need to change the key used to encrypt a S3 object. \u00a0In that case, this command line example may prove useful to others.<\/p>\n<p>To change an existing AES256 encrypted object to another encryption key in KMS use the AWS S3 CP command:<\/p>\n<pre>aws s3 cp s3:\/\/mybucket\/test.txt s3:\/\/mybucket\/test2.txt --sse aws:kms --sse-kms-key-id &lt;key arn&gt;<\/pre>\n<p>Because the original file was encrypted with default server side encryption of AES 256 it will automatically assume AES256 and decrypt the file as part of the copy process to re-encrypt with the new key.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The AWS Console allows you to upload files to a bucket and set the server side encryption. \u00a0This defaults to AES256. \u00a0However, there are times when you may want to encrypt a S3 object using a specific key. \u00a0For example, RDS SQL database native restore. \u00a0 Therefore at times you may need to change the &hellip; <a href=\"https:\/\/nerdsector.com\/ns\/2017\/04\/26\/aws-s3-cp-command-line-example-change-encryption-keys\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;AWS S3 CP Command Line Example to Change Encryption keys&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[22],"tags":[23,27,29,28],"class_list":["post-118","post","type-post","status-publish","format-standard","hentry","category-aws","tag-aws","tag-aws-s3","tag-s3-command-line","tag-s3-encryption"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>AWS S3 CP Command Line Example to Change Encryption keys - Nerdsector.com<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/nerdsector.com\/ns\/2017\/04\/26\/aws-s3-cp-command-line-example-change-encryption-keys\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"AWS S3 CP Command Line Example to Change Encryption keys - Nerdsector.com\" \/>\n<meta property=\"og:description\" content=\"The AWS Console allows you to upload files to a bucket and set the server side encryption. \u00a0This defaults to AES256. \u00a0However, there are times when you may want to encrypt a S3 object using a specific key. \u00a0For example, RDS SQL database native restore. \u00a0 Therefore at times you may need to change the &hellip; Continue reading &quot;AWS S3 CP Command Line Example to Change Encryption keys&quot;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/nerdsector.com\/ns\/2017\/04\/26\/aws-s3-cp-command-line-example-change-encryption-keys\/\" \/>\n<meta property=\"og:site_name\" content=\"Nerdsector.com\" \/>\n<meta property=\"article:published_time\" content=\"2017-04-26T23:56:30+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-04-27T18:02:37+00:00\" \/>\n<meta name=\"author\" content=\"mrcaution\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"mrcaution\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/nerdsector.com\\\/ns\\\/2017\\\/04\\\/26\\\/aws-s3-cp-command-line-example-change-encryption-keys\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/nerdsector.com\\\/ns\\\/2017\\\/04\\\/26\\\/aws-s3-cp-command-line-example-change-encryption-keys\\\/\"},\"author\":{\"name\":\"mrcaution\",\"@id\":\"https:\\\/\\\/nerdsector.com\\\/ns\\\/#\\\/schema\\\/person\\\/c44c899761720267903204249c3cab2f\"},\"headline\":\"AWS S3 CP Command Line Example to Change Encryption keys\",\"datePublished\":\"2017-04-26T23:56:30+00:00\",\"dateModified\":\"2017-04-27T18:02:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/nerdsector.com\\\/ns\\\/2017\\\/04\\\/26\\\/aws-s3-cp-command-line-example-change-encryption-keys\\\/\"},\"wordCount\":137,\"commentCount\":0,\"keywords\":[\"AWS\",\"AWS S3\",\"S3 Command Line\",\"S3 Encryption\"],\"articleSection\":[\"AWS\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/nerdsector.com\\\/ns\\\/2017\\\/04\\\/26\\\/aws-s3-cp-command-line-example-change-encryption-keys\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/nerdsector.com\\\/ns\\\/2017\\\/04\\\/26\\\/aws-s3-cp-command-line-example-change-encryption-keys\\\/\",\"url\":\"https:\\\/\\\/nerdsector.com\\\/ns\\\/2017\\\/04\\\/26\\\/aws-s3-cp-command-line-example-change-encryption-keys\\\/\",\"name\":\"AWS S3 CP Command Line Example to Change Encryption keys - Nerdsector.com\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/nerdsector.com\\\/ns\\\/#website\"},\"datePublished\":\"2017-04-26T23:56:30+00:00\",\"dateModified\":\"2017-04-27T18:02:37+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/nerdsector.com\\\/ns\\\/#\\\/schema\\\/person\\\/c44c899761720267903204249c3cab2f\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/nerdsector.com\\\/ns\\\/2017\\\/04\\\/26\\\/aws-s3-cp-command-line-example-change-encryption-keys\\\/\"]}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/nerdsector.com\\\/ns\\\/#website\",\"url\":\"https:\\\/\\\/nerdsector.com\\\/ns\\\/\",\"name\":\"Nerdsector.com\",\"description\":\"Technology News, Tips and More\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/nerdsector.com\\\/ns\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/nerdsector.com\\\/ns\\\/#\\\/schema\\\/person\\\/c44c899761720267903204249c3cab2f\",\"name\":\"mrcaution\",\"url\":\"https:\\\/\\\/nerdsector.com\\\/ns\\\/author\\\/mrcaution\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"AWS S3 CP Command Line Example to Change Encryption keys - Nerdsector.com","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/nerdsector.com\/ns\/2017\/04\/26\/aws-s3-cp-command-line-example-change-encryption-keys\/","og_locale":"en_US","og_type":"article","og_title":"AWS S3 CP Command Line Example to Change Encryption keys - Nerdsector.com","og_description":"The AWS Console allows you to upload files to a bucket and set the server side encryption. \u00a0This defaults to AES256. \u00a0However, there are times when you may want to encrypt a S3 object using a specific key. \u00a0For example, RDS SQL database native restore. \u00a0 Therefore at times you may need to change the &hellip; Continue reading \"AWS S3 CP Command Line Example to Change Encryption keys\"","og_url":"https:\/\/nerdsector.com\/ns\/2017\/04\/26\/aws-s3-cp-command-line-example-change-encryption-keys\/","og_site_name":"Nerdsector.com","article_published_time":"2017-04-26T23:56:30+00:00","article_modified_time":"2017-04-27T18:02:37+00:00","author":"mrcaution","twitter_misc":{"Written by":"mrcaution","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/nerdsector.com\/ns\/2017\/04\/26\/aws-s3-cp-command-line-example-change-encryption-keys\/#article","isPartOf":{"@id":"https:\/\/nerdsector.com\/ns\/2017\/04\/26\/aws-s3-cp-command-line-example-change-encryption-keys\/"},"author":{"name":"mrcaution","@id":"https:\/\/nerdsector.com\/ns\/#\/schema\/person\/c44c899761720267903204249c3cab2f"},"headline":"AWS S3 CP Command Line Example to Change Encryption keys","datePublished":"2017-04-26T23:56:30+00:00","dateModified":"2017-04-27T18:02:37+00:00","mainEntityOfPage":{"@id":"https:\/\/nerdsector.com\/ns\/2017\/04\/26\/aws-s3-cp-command-line-example-change-encryption-keys\/"},"wordCount":137,"commentCount":0,"keywords":["AWS","AWS S3","S3 Command Line","S3 Encryption"],"articleSection":["AWS"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/nerdsector.com\/ns\/2017\/04\/26\/aws-s3-cp-command-line-example-change-encryption-keys\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/nerdsector.com\/ns\/2017\/04\/26\/aws-s3-cp-command-line-example-change-encryption-keys\/","url":"https:\/\/nerdsector.com\/ns\/2017\/04\/26\/aws-s3-cp-command-line-example-change-encryption-keys\/","name":"AWS S3 CP Command Line Example to Change Encryption keys - Nerdsector.com","isPartOf":{"@id":"https:\/\/nerdsector.com\/ns\/#website"},"datePublished":"2017-04-26T23:56:30+00:00","dateModified":"2017-04-27T18:02:37+00:00","author":{"@id":"https:\/\/nerdsector.com\/ns\/#\/schema\/person\/c44c899761720267903204249c3cab2f"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/nerdsector.com\/ns\/2017\/04\/26\/aws-s3-cp-command-line-example-change-encryption-keys\/"]}]},{"@type":"WebSite","@id":"https:\/\/nerdsector.com\/ns\/#website","url":"https:\/\/nerdsector.com\/ns\/","name":"Nerdsector.com","description":"Technology News, Tips and More","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/nerdsector.com\/ns\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/nerdsector.com\/ns\/#\/schema\/person\/c44c899761720267903204249c3cab2f","name":"mrcaution","url":"https:\/\/nerdsector.com\/ns\/author\/mrcaution\/"}]}},"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p2Ldd1-1U","jetpack_likes_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/nerdsector.com\/ns\/wp-json\/wp\/v2\/posts\/118","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nerdsector.com\/ns\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nerdsector.com\/ns\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nerdsector.com\/ns\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nerdsector.com\/ns\/wp-json\/wp\/v2\/comments?post=118"}],"version-history":[{"count":5,"href":"https:\/\/nerdsector.com\/ns\/wp-json\/wp\/v2\/posts\/118\/revisions"}],"predecessor-version":[{"id":123,"href":"https:\/\/nerdsector.com\/ns\/wp-json\/wp\/v2\/posts\/118\/revisions\/123"}],"wp:attachment":[{"href":"https:\/\/nerdsector.com\/ns\/wp-json\/wp\/v2\/media?parent=118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nerdsector.com\/ns\/wp-json\/wp\/v2\/categories?post=118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nerdsector.com\/ns\/wp-json\/wp\/v2\/tags?post=118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}