Posts

Showing posts with the label AWS

AWS - AWS Transfer for SFTP - Set up SFTP access for S3 using AWS Transfer for SFTP

Image
To Access the AWS S3 bucket through SFTP you can do it now with AWS Transfer for SFTP. Here are the step to configure that. Create the S3 Bucket. Create a IAM Policy by giving access to the S3 bucket created on the step 1 as shown on the screenshot. Create a IAM Role and attach the policy created on the step 2. Go to the URL https://console.aws.amazon.com/transfer/home?region=us-east-1#   Then click on the button  "Create Server".   On the Create Server screen choose the endpoint according to your requirement. If you don't have any VPC configured then choose Public. Then Select the custom host name if you want to give a custom url to your SFTP service. For the identity provider you can select Service managed if you want to manage users within the service OR you can provide custom identity provider URL if you already have. choose a logging role which have access to cloudwatch to log the activity. Then click "Create server" Then it will br...

AWS-Python: Fetching credentials stored in AWS Secret Manager with Python

AWS Secret Manager is a great service to keep all the credetial secretly. Anytime you need to access them to use inside your code, you can fetch those through the AWS SDK. AWS SDK need some information to be ready before start you send any request to AWS Secret Manager AWS Access Key AWS Secret Access Key Region Name Secret Name(The name you have given to store your credential in AWS Secret Manager) Here is code snippet that you need to write to retrive the information from AWS Secret Manager. import boto3 import base64 from botocore.exceptions import ClientError def get_secret(): secret_name= "redshift\db\dbname" region_name = "us-east-1" client = boto3.client( 'secretsmanager' , aws_access_key_id = '<aws_access_key_id>' , aws_secret_access_key = '<aws_secret_access_key>' , region_name = '<region_name>' ...