From 9af267f3f863c782a4da0be0a61346080d185d90 Mon Sep 17 00:00:00 2001 From: Manjila Singh Date: Thu, 22 Aug 2024 22:03:03 +0100 Subject: [PATCH] Add AWS S3 Sync with different keys documentation --- .../aws-best-practice/index.md} | 0 .../aws/documentation/aws-s3-sync/index.md | 82 +++++++++++++++++++ .../data-science-tools/index.md} | 2 +- .../cloudservices/aws/documentation/index.md | 15 ++++ .../tagging/index.md} | 2 +- 5 files changed, 99 insertions(+), 2 deletions(-) rename docs/services/cloudservices/aws/{AWS best Practices.md => documentation/aws-best-practice/index.md} (100%) create mode 100644 docs/services/cloudservices/aws/documentation/aws-s3-sync/index.md rename docs/services/cloudservices/aws/{datasciencetools.md => documentation/data-science-tools/index.md} (95%) create mode 100644 docs/services/cloudservices/aws/documentation/index.md rename docs/services/cloudservices/aws/{tagging.md => documentation/tagging/index.md} (98%) diff --git a/docs/services/cloudservices/aws/AWS best Practices.md b/docs/services/cloudservices/aws/documentation/aws-best-practice/index.md similarity index 100% rename from docs/services/cloudservices/aws/AWS best Practices.md rename to docs/services/cloudservices/aws/documentation/aws-best-practice/index.md diff --git a/docs/services/cloudservices/aws/documentation/aws-s3-sync/index.md b/docs/services/cloudservices/aws/documentation/aws-s3-sync/index.md new file mode 100644 index 0000000..dd3101b --- /dev/null +++ b/docs/services/cloudservices/aws/documentation/aws-s3-sync/index.md @@ -0,0 +1,82 @@ +--- +sidebar_position: 4 +title: "AWS S3 Sync with Different Access Keys" +description: "AWS S3 Sync with Different Access Keyss" +tags: + - aws + - documentation + - tutorial + - AWS + - s3 sync + - access keys +--- + + +### Step 1: Configure AWS CLI Profiles +First, set up two different profiles in your AWS CLI configuration, one for the source bucket and one for the destination bucket. + +``` +# Configure source profile +aws configure --profile source-profile +AWS Access Key ID [None]: [Enter source bucket access key] +AWS Secret Access Key [None]: [Enter source bucket secret key] +Default region name [None]: [Enter region, e.g., us-west-2] +Default output format [None]: json + +# Configure destination profile +aws configure --profile destination-profile +AWS Access Key ID [None]: [Enter destination bucket access key] +AWS Secret Access Key [None]: [Enter destination bucket secret key] +Default region name [None]: [Enter region, e.g., us-east-1] +Default output format [None]: json + +``` + +### Step 2: Verify Profiles +Verify that your profiles are set up correctly: +``` +aws configure list --profile source-profile +aws configure list --profile destination-profile +``` + +### Step 3: Use AWS S3 Sync Command +Now, you can use the aws s3 sync command with these profiles. Here's the basic syntax: +``` +aws s3 sync s3://source-bucket s3://destination-bucket \ + --source-profile source-profile \ + --profile destination-profile +``` +Examples + +``` +#Sync all contents: + +aws s3 sync s3://my-source-bucket s3://my-destination-bucket \ + --source-profile source-profile \ + --profile destination-profile + + +#Sync with specific options: + +aws s3 sync s3://my-source-bucket s3://my-destination-bucket \ + --source-profile source-profile \ + --profile destination-profile \ + --delete \ + --exclude "*.tmp" \ + --include "*.jpg" + +#Dry run (no actual changes): + +aws s3 sync s3://my-source-bucket s3://my-destination-bucket \ + --source-profile source-profile \ + --profile destination-profile \ + --dryrun +``` + +### Important Notes: +- The --source-profile is used for reading from the source bucket. +- The --profile (or --dest-profile in some AWS CLI versions) is used for writing to the destination bucket. +- Ensure both profiles have the necessary permissions on their respective buckets. +- Be cautious with the --delete flag as it removes files in the destination that don't exist in the source. +- Always test with --dryrun first to ensure the operation will do what you expect. +- Basically, you have to create two access key profile, and attach those appropriate \ No newline at end of file diff --git a/docs/services/cloudservices/aws/datasciencetools.md b/docs/services/cloudservices/aws/documentation/data-science-tools/index.md similarity index 95% rename from docs/services/cloudservices/aws/datasciencetools.md rename to docs/services/cloudservices/aws/documentation/data-science-tools/index.md index f231f62..4859b32 100644 --- a/docs/services/cloudservices/aws/datasciencetools.md +++ b/docs/services/cloudservices/aws/documentation/data-science-tools/index.md @@ -1,5 +1,5 @@ --- -sidebar_position: 6 +sidebar_position: 3 description: "AWS Data Science Tools" tags: - AWS diff --git a/docs/services/cloudservices/aws/documentation/index.md b/docs/services/cloudservices/aws/documentation/index.md new file mode 100644 index 0000000..12fe22b --- /dev/null +++ b/docs/services/cloudservices/aws/documentation/index.md @@ -0,0 +1,15 @@ +--- +sidebar_position: 3 +title: "Documentation and Tutorial" +description: "AWS documentations" +tags: + - aws + - documentation + - tutorial + - AWS +--- + + +import DocCardList from '@theme/DocCardList'; + + diff --git a/docs/services/cloudservices/aws/tagging.md b/docs/services/cloudservices/aws/documentation/tagging/index.md similarity index 98% rename from docs/services/cloudservices/aws/tagging.md rename to docs/services/cloudservices/aws/documentation/tagging/index.md index 978f6b5..ded035e 100644 --- a/docs/services/cloudservices/aws/tagging.md +++ b/docs/services/cloudservices/aws/documentation/tagging/index.md @@ -1,5 +1,5 @@ --- -sidebar_position: 1 +sidebar_position: 2 title: "Tag Resources on AWS" description: "AWS tags for cost tracking" tags: