Questions tagged [boto3]

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

9 questions
2
votes
1 answer

Boto3: How can I set Security Group Ids to default?

I am trying to set security group ids while creating an EC2 instance. If I have a specific security group Id list, I can do this: boto3.resource(resource, region_name=self.region) ec2 = self.resource instances = ec2.create_instances( …
1
vote
2 answers

How to set the vpc of a db instance when I create one via boto3's 'rds.create_db_instance'?

When I create a mysql db via AWS console, I can control to which VPC the db instance lands. However when i tried to use boto3 rds.create_db_instance to create a mysql db, the option is not available. At least I cannot see any VpcId parameter. How…
Anthony Kong
  • 3,288
  • 11
  • 57
  • 96
1
vote
1 answer

The option group is associated with a different VPC than the request

I am using boto3 to restore a db snapshot to a new db instance, which is not created yet. rds.restore_db_instance_from_db_snapshot( DBInstanceIdentifier=temp_db_name, DBSnapshotIdentifier=snapshot_id ) and I got this error…
Anthony Kong
  • 3,288
  • 11
  • 57
  • 96
1
vote
1 answer

Ansible Join two variables

I have two variable definition files as follows vars.yml aws_common_tags: Project: "{{ project_name }}" Application: "{{ application_name }}" Region: "{{ aws_region }}" Ansible: "Yes" instance.yml ec2_instance_tags: …
Geo
  • 575
  • 3
  • 9
  • 23
0
votes
1 answer

AWS describe-network-interfaces behavior when filtered by list of security groups & list of interface Ids

I am slightly confused with the way the following would function: profile_session = boto3.session.Session(aws_access_key_id=accessKey,aws_secret_access_key=acc essSecret,region_name=awsRegion) ec2_client =…
qre0ct
  • 123
  • 6
0
votes
2 answers

Spot instance windows auto login in User Data using Boto3

I want to launch a Windows spot instance on AWS with a specific AMI and launch the instance and run PowerShell command. The problem i am facing issue is that, when the instance is launched, it shows "Running" on the EC2 dashboard but the Windows was…
dextoruz
  • 1
  • 1
0
votes
0 answers

Is there way to monitor all aws iam users activity and send email alert using python lambda?

I have tried send alert notification for AWS IAM all users activity from lambda python, however its not working, please share any other way to work and find below cloudwatch event patter and lambda code I used in my aws account. Cloudwatch event…
0
votes
1 answer

How do I open a private static website using boto3?

I have a static website consisting of multiple HTML, CSS, and media files uploaded to a private S3 bucket. I would like to access the website using my web browser. I'm currently using boto3 to generate a presigned URL for a single HTML file. How do…
0
votes
1 answer

Can't Create Launch Configuration Due to Invalid IamInstanceProfile

Trying Create a Launch Configuration item, I get this error: Launch Config problem: An error occurred (ValidationError) when calling the operation: Invalid IamInstanceProfile:AWS_EC2_INSTANCE_PROFILE_ROLE executing this type of code w/boto…
jouell
  • 621
  • 1
  • 5
  • 20