Questions tagged [boto3]

Boto 3 - The Amazon Web Services (AWS) SDK for Python

Filter by
Sorted by
Tagged with
0
votes
1answer
9 views

How to delete Rds instance along with Rds cluster using boto3 in AWS

I need to delete the RDS instance and RDS cluster using boto3 I used the below codes however getting error Syntax error in module 'lambda_function': expected an indented block (lambda_function.py, ...
0
votes
2answers
20 views

Delete all keys in a bucket of s3 which are three days old using python

How to Delete all keys in a bucket of s3 which are three days old using python s3 : mybucket001/backup/1566394660_21_08_2019_backup mybucket001/backup/1566394660_20_08_2019_backup mybucket001/...
0
votes
1answer
18 views

Identify who created a particular AWS resource

We are using multiple AWS services from last few years. Now we have many aws resources which are created but doesnt have created by tag. We would like to tag each on our resources (which supports ...
0
votes
0answers
12 views

Loop through subaccs and write api information in csv

I have assigned all roles correctly, i only have problems with the implementation of my code. I am in a subaccount, where a lambda-function is stored, which should loop through all other subaccounts ...
0
votes
1answer
16 views

Getting no information from describe_images?

I want get the image id of a specific AMI. I am doing this by using boto3.describe_images. First, I was broad and did only platform as my filter but that was too slow so I specified it to the ...
1
vote
1answer
23 views

Need to release all those elastic IP that are unassociated using boto3 in All regions

I am using boto3 along with lamda to release the unused elastic IPs. Here I need to release all those IPs present in all regions of My AWS account. def elastic_ips_cleanup(): client = boto3....
0
votes
1answer
19 views

How to specify bucket path from s3 when there are multiple buckets

I am trying to download a file from s3 bucket that is in multiple buckets. I have realized that '/' cannot be used as a delimiter. I want to know how to get around this issue. import boto3 session = ...
0
votes
1answer
24 views

uploading file to specific folder in S3 bucket using boto3

My code is working. The only issue I'm facing is that I cannot specify the folder within the S3 bucket that I would like to place my file in. Here is what I have: with open("/hadoop/prodtest/tips/ut/...
0
votes
3answers
22 views

Access the Object Keys of all the files inside a specific subfolder of s3 bucket

I have a s3 bucket inside which there are many subfolders. I want to print just the keys of all the files from the specific subfolder 'abcxyz' inside that bucket Succeeded in achieving the files of ...
0
votes
1answer
23 views

Python boto3 lambda error: 'Organizations' object has no attribute 'list_tags_for_resource'

I am developing a lamdba function to execute a python boto3 script that lists out all of my AWS accounts and tags. I've tried doing this locally and it works fine (both listing accounts and tags). ...
0
votes
0answers
16 views

Boto3 Cloudwatch API ELBv2 returning empty datapoints

I am writing a script to pull back metrics for ELBv2 (Network LB) using Boto3 but it just keeps returning empty datapoints. I have read through the AWS and Boto docs, and scoured here for answers but ...
0
votes
0answers
21 views

SSLError when AWS lambda downloads from S3 bucket

I've created a Python lambda function that downloads a file from S3 bucket. I gave this lambda the role that allows this. And this code works fine locally. But when executed on AWS Lambda it returns ...
0
votes
1answer
15 views

boto3 ec2 create instance with a name

I am new to AWS and using boto3 to launch an instance. However, I notice that when I create the instance, the "Name" field is empty. So, the way I create it is as follows: def create_instance(ami, ...
0
votes
0answers
15 views

Can I query both the Table and the Global Secondary Index in KeyConditionExpression

I have this table where I have put a Hash Key on a column called org_id and a Global Secondary Index on a column called ts. And I need to run a query against the table matching the condition, but I am ...
-1
votes
0answers
14 views

Upload Progress Callback in AWS S3 using boto3

Callback function ProgressPercentage() is not defined. I am trying to upload a file to AWS S3 using boto3 libraries. In the boto3 documentation, I see that I can provide a Callback function (shown ...
1
vote
2answers
39 views

Filter aws ec2 snapshots by current date

How to filter AWS EC2 snapshots by current day? I'm filtering snapshots by tag:Disaster_Recovery with value:Full, using python code below, and I need also filter it by the current day. import boto3 ...
0
votes
0answers
15 views

How to fix ClientError: An error occurred (AccessDenied) when calling the CreateBucket operation: Access Denied when calling create_bucket

I tried using boto3 to create a bucket in s3 but received ClientError: An error occurred (AccessDenied) when calling the CreateBucket operation: Access Denied. I have set up my aws cli credentials ...
1
vote
1answer
20 views

create aws subnet tags

I am trying to create a subnet name tag but I'm getting the error. I have no idea what is causing the error. The subnet was successfully created, however, there is an error creating the tag name. ...
0
votes
2answers
48 views

creating AWS resource group using boto3

I would like to create AWS resource group using boto3. In the resource group I would like to add ec2 instances having tags "name":"Jenkins".Below is the syntax suggested in boto3 documentation. ...
1
vote
1answer
28 views

Python Script to get the size of the S3 Bucket in csv

I am trying to get the S3 Bucket size in aws by running a script. I tried with a script that pulls with the CloudWatch Metrics. But this code gives the size for StartTime and EndTime. What I want - ...
0
votes
0answers
3 views

How to upload data in cloudsearch with boto

wanted to upload data in json format into AWS cloudsearch by using boto3 I read boto3 api documentation it is not helpling client = boto3.client('cloudsearchdomain') client.upload_documents(...
0
votes
2answers
27 views

Boto3 S3 resource get stuck on “Object.get” method

I try to get a pickle file from an S3 resource using the "Object.get()" method of the boto3 library from several processes simultaneously. This causes my program to get stuck on one of the processes (...
1
vote
1answer
19 views

Presigned URL for private S3 bucket displays AWS access key id and bucket name. Is this a security issue?

AWS Access Key ID for IAM user is displayed in img src I want to serve static files, images specifically, for my flask app on heroku using a private S3 bucket. I created a pre-signed url using boto3 ...
1
vote
1answer
26 views

How can I get a JWT Access Token from AWS Cognito as admin in Python with boto3?

I am trying to write an API test in Python for my web service. I would like to avoid using the password of the test user from my AWS Cognito pool. My strategy for this, and let me know if there's a ...
0
votes
0answers
10 views

Using boto3 with partial PrivateLink coverage and proxy services

I have a scenario where VPC egression is highly controlled by the company, and think that I could get an approval to whitelist *.amazonaws.com. I would prefer to use https proxy, to have a NAT ...
1
vote
1answer
21 views

Download S3 File Using Boto3

I'm currently writing a script in where I need to download S3 files to a created directory. I currently create a boto3 session with credentials, create a boto3 resource from that session, then use it ...
-3
votes
2answers
35 views

How to get aws ec2 instance Disk & Memory Utilization using boto3 python sdk [closed]

How to get AWS ec2 instance Disk & Memory Utilization using boto3 python sdk. Please provide any using code or url
0
votes
1answer
22 views

AWS Boto3 Iterate over JSON response

I am writing a python script to get the LoadBalancerName value from the ELBv2 endpoint using Boto3. Because the returned ?dict? has multiple levels and I do not know the index of the items, I can't ...
0
votes
1answer
33 views
+50

Upload Gzip file using Boto3

i am trying to upload files to S3 before that i am trying to Gzip files, if you see the code below, the files uploaded to the S3 have no change in the size, so i am trying to figure out if i have ...
0
votes
2answers
34 views

Setting up media file access on AWS S3

Im using boto3 and django-storage libraries for apload media files of my django project. storage_backends.py class PrivateMediaStorage(S3Boto3Storage): location = settings.AWS_STORAGE_LOCATION ...
1
vote
1answer
33 views

source_dest_check in aws_launch_configuration in terraform

I am looking to make a newly launched ec2 instance with source_dest_check = disabled (by default it is enabled) from autoscaling launch configuration. I know we can use source_dest_check = false for ...
0
votes
1answer
22 views

Python boto3 load model tar file from s3 and unpack it

I am using Sagemaker and have a bunch of model.tar.gz files that I need to unpack and load in sklearn. I've been testing using list_objects with delimiter to get to the tar.gz files: response = s3....
0
votes
2answers
25 views

How to download and upload s3 objects in same bucket (different prefixes) with boto3

I'm implementing an image processing algorithm with an AWS lambda function. I want to gather images from a 'subfolder'/prefix in an S3 bucket, run my algorithm with boto3, and upload the processed ...
0
votes
1answer
28 views

How to get quotas of AWS via boto3?

I'm working on boto3 - SDK python for AWS. I am starting with simple service quota for ec2 but always ending up with the below error, import boto3 quota_client = boto3.client('service-quotas') ...
0
votes
1answer
53 views

Can boto's get_resource_type('s3').Object(bucket_name, key) take wildcards?

I'm very new to python. I'm using this library that's using boto like this: def get_key(self, key, bucket_name=None): """ Returns a boto3.s3.Object :param key: the path to the key :...
0
votes
1answer
56 views

How can retrieve all the security group IDs and save them into a iterable list?

I want to loop through all the security groups and find those with rules wide open to internet on any ports. # This script is for identifying security groups with rules with open to internet. ...
0
votes
1answer
44 views

How can I get AWS CloudTrail event instance name using the instance Id?

I am trying to get the instance name of a CloudTrail event. I am extracting the instance ID from the event, but the event doesn't appear to have the hostname/instance name. To get the instance name, ...
0
votes
0answers
26 views

boto3 resource config options update post instantiation of s3 resouce

I am instantiating s3 resource with boto3. I have question specifically on connect_timeout, read_timeout, max_attempts. I have two set of operations - I/O and non-I/O. On the same s3 resource ...
1
vote
1answer
49 views

How to test if process is “in cloud” on AWS

I have a python application which should run remotely via an AWS pipeline and use secrets to get parameters such as database credentials. When running the application locally the parameters are loaded ...
0
votes
1answer
27 views

How do I use a local folder as collection instead of an S3 bucket?

I'm trying to compare a single human face picture to a collection of group photos in a specific folder. I'm trying to eliminate the use of S3 buckets and would like to use local folders from pprint ...
0
votes
0answers
14 views

How to fix “MissingHeaders” Error while appending where clause with s3 select

I have a csv file in the format IDATE_TIMESTAMP,OPEN,HIGH,LOW,CLOSE,VOLUME 1535535060,94.36,94.36,94.36,94.36,1 1535535120,94.36,94.36,93.8,93.8,1 1535535180,93.8,93.8,93.8,93.8,0 1535535240,93.8,93....
0
votes
0answers
11 views

Boto3 s3 put operation getting “HTTPClientError”

I started getting this error when trying to put a test csv to s3: HTTPClientError: An HTTP Client raised and unhandled exception: Timeout value connect was Timeout(connect=60, read=60, total=None)...
0
votes
1answer
19 views

Why am I getting a NoRegionError when using aws_athena_hook in airflow?

I am trying to use airflow to run a query in Athena using airflow on a schedule. The function that I have enclosed below is run using PythonOperator in airflow. from airflow.models import Variable ...
0
votes
1answer
62 views

Creating ECS cluster error: Unknown parameter in input: “tags”, must be one of: clusterName

I'm trying to create an ecs cluster and attach tags to it and I see following error " Parameter validation failed: Unknown parameter in input: "tags", must be one of: clusterName " Am currently using ...
0
votes
1answer
27 views

Does boto3 get_object(…) immediately download the actual file in python?

Background: According to the boto3 get_object() documentation, the method get_object(**kwargs) has the following response signature: { 'Body': StreamingBody(), 'DeleteMarker': True|False, ...
0
votes
0answers
11 views

How are bucket.objects.all and client.list_objects billed?

I am trying to decide how to count how many objects are located in a S3 bucket. Right now, two of my best options seem to be using bucket.objects.all() or client.list_objects(). Right now, I am trying ...
0
votes
0answers
14 views

AWS Macie: how to get vulnerabilities of s3 buckets integrated to macie using boto3

I have integrated an S3 bucket to AWS-Macie using boto3. I have inserted some sample PII data (excel sheet) into it. I am able to see the data on Macie UI. Using boto3 how can I get the information ...
0
votes
1answer
24 views

aws ssm create_activation api is failing with regex error

I am trying to activate the AWS ec2 instance at ssm manager using the boto3 api call however its failing with regex error. Issue is already raised at https://github.com/aws/aws-sdk-js/issues/2748 but ...
0
votes
1answer
24 views

Invalid Request for Boto3 Call to Textract

I am trying to make a boto3 call to Textract, but am unable to see what's wrong with my code. This is the error message I got: Traceback (most recent call last): File "run.py", line 20, in <...
1
vote
1answer
22 views

Where is boto3 credentials file in windows located at by default?

I just installed boto3 in my windows machine using pip install boto3 through cmd prompt. I'm following steps from here and not able to find the credentials file or config file mentioned in those ...