amazon-web-services

How to get a specific key in a list of dicts in JSON

How to get a specific key in a list of dicts in JSON Question: I am trying to get the StackId through list_stacks() of the last deleted stack with the name BastionInfraStack (the most recent one). The list_stacks() command returns the following: { "StackSummaries": [ { "StackId": "arn:aws:cloudformation:us-east-2:111111111:stack/Dev-BastionInfraStack/34deb540-9c2f-11ed-90a7-022b01b65a64", "StackName": "Dev-BastionInfraStack", "CreationTime": "2023-01-24T21:36:48.468000+00:00", "LastUpdatedTime": "2023-01-24T21:37:26.782000+00:00", "DeletionTime": …

Total answers: 1

Clone private github repo to launched EC2 instance

Clone private github repo to launched EC2 instance Question: I’m building a scrip that launches and connects to an EC2 instance. After all setup of the instance I have to copy my private repo to it, and then run it. The code works fine for public repo. Also if I manually launch an instance, connect …

Total answers: 1

How to read text file on AWS Lambda environment

How to read text file on AWS Lambda environment Question: I am trying to read and store the values of a text file in a variable so that I can covert that text file into CSV file afterwards. But I am getting this error that the file is not found. I used the exact path …

Total answers: 1

How are environment variables accessed from ".env" file if Django project deployed to AWS from Github?

How are environment variables accessed from ".env" file if Django project deployed to AWS from Github? Question: I have a Django project deployed on AWS EBS from a Github repo. My secret key is kept on a .env file. I’ve included the following: settings.py from decouple import config "SECRET_KEY" = config("MY_SECRET_KEY") requirements.txt python-decouple==3.7 .env MY_SECRET_KEY …

Total answers: 1

How to upload excel file to AWS S3 using an AWS lambda function in python

How to upload excel file to AWS S3 using an AWS lambda function in python Question: I have an excel file in generated from a Lamba function, stored in the /tmp/ folder, I want to store it in a S3 bucket, I have setup the permisions and the bucket, but when I complete the function …

Total answers: 2

boto3 : SSM Parameter get_parameters()

boto3 : SSM Parameter get_parameters() Question: I am creating lambda function where I am fetching SSM parameter for EKS-Optimized AMI ID, now about EKS-Optimized AMI, it is the default AMI provided by EKS if we are not specifying any AMI explicitly. EKS-Optimized AMI are different per region & K8 version. I am working on upgrading …

Total answers: 2

Streamlit on AWS: serverless options?

Streamlit on AWS: serverless options? Question: My goal is to deploy a Streamlit application to an AWS Serverless architecture. Streamlit does not appear to function properly without a Docker container, so the architecture would need to support containers. From various tutorials, EC2 is the most popular deployment option for Streamlit, which I have no interest …

Total answers: 1

string manipulation in python for reading json object and '' removal

string manipulation in python for reading json object and '' removal Question: I am trying to construct a role in AWS where I am trying to have list of resources. Below is an example shared ={ "mts":{ "account_id":"11111", "workbench":"aaaaa", "prefix":"rad600-ars-sil,rad600-srr-sil-stage1,rad600-srr-sil-stage2" }, "tsf":{ "account_id":"22222", "workbench":"bbbbb", "prefix":"yyyy" } } I am trying to construct a list with …

Total answers: 2

How to update count in dynamo table with 2 fields

How to update count in dynamo table with 2 fields Question: The Dynamodb table has 1 partition key and 2 fields. I’m trying to increment a or b by 1. I get cur_count for a or b(which is 0) from the table and +1 to it. The error: An error occurred (ValidationException) When calling the …

Total answers: 1