Tweet-bot : Re-tweet the tweets contaning keyword using AWS lambda

Tweet-bot : Re-tweet the tweets contaning keyword using AWS lambda

Greetings! From last week I got the idea to automatically retweet the tweet with particular keyword. In this article we will discuss how to do that using AWS Lambda using Python 3.6 runtime and serverless framework. This is first I have used the serverless framework. Let's get started. First the serverless environment should be in place. To install serverless architecture you can visit this link. Next step is to setup AWS credentials and you can more information here. Now you should create a twitter account if you don't have or if you want…Read more …
Extract Mircrosoft Active Directory GPO report via PowerShell

Extract Mircrosoft Active Directory GPO report via PowerShell

Greetings! Domain policy management is one of critical task. We divide polices into multiple GPO depending upon our requirement. PowerShell is one of the powerful tool we have now. In this article we will see how we can create reports for our GPO using PowerShell. First step you need GroupPolicy available on your machine. It is part of Group Policy Management tools which is available as feature on our Windows Server. Once you have installed this feature you have all cmdlets available which are required to manage GPO using PowerShell. You can check…Read more …
Get AWS IAM custom policies and action assigned to it using AWS lambda

Get AWS IAM custom policies and action assigned to it using AWS lambda

Greetings! When it comes to public cloud, access control is very important part in it. It is recommended to use roles for services then using crentials when using AWS lambda. Custom plocies are then very important and there mangement ver critical. You should be in control of what roles has what kind of access. This sctipt lists all your custom policies and actions assigned to it. You can find script here. Please note you will not get inline policies with this. Happy Coding!Read more …
Get all snapshots in your AWS environment using AWS lambda

Get all snapshots in your AWS environment using AWS lambda

Greetings! Managing snapshots is very critical and complex topic in any environment. You should keep a track of snapshots with their creation date. You should be aware when one snapshot should be deleted, as it would be consuming space. In this lambda script you can get consolidated report for all snapshots in your environment. I have excluded the snapshots which are copied from same or different zone. Those snapshots have volume id as vol-ffffffff. I think those should be managed separately but if you want to track those also you can simply remove…Read more …
Search for particular tag name for all instances using AWS lambda

Search for particular tag name for all instances using AWS lambda

Greetings! Tags are very helpful feature in AWS. You can store information related to your business or resource configuration using tags. It helps us to query for resources based on particular condition. This lambda function queries for name tag for all instances in particular region in a particular account and returns its value. You can find script here. Happy coding!  Read more …
Get public IP addresses of all EC2 instances in single AWS account

Get public IP addresses of all EC2 instances in single AWS account

Greetings! When you are working in big organization and server count is very high it is very tedious to manage networks. Public IP address management is very critical, you should be aware what machines are exposed to Internet. This python lambda scripts gets list of all public IP addresses availble in your account. You can find script here. Happy Coding!Read more …
Get all EC2 instances from all regions and store it in dynamodb

Get all EC2 instances from all regions and store it in dynamodb

Greetings! In AWS we have multiple regions, if you want to check resources or services of particular region you need to switch to that region first. This script will fetch EC2 instance name, ID and type from all regions. The script has two parts which I have divided into two functions. One functions collects all the information and second adds that to dynamodb. you can skip second part and save it in csv in S3 bucket. You can find script here. Happy Coding!Read more …
AWS Connect and Lambda integration to get caller ID

AWS Connect and Lambda integration to get caller ID

Greetings! IT Service Desk is backbone for support for any company to function. It’s the face of IT operations. what if you can take few tasks service desk performs and automate them. I am going dig into this. Last year Amazon announced service called connect, with this you can be up and running within minutes. In this article we will connect AWS Connect with lambda. We will capture the called ID of user and if user exists in database we will greet user. To start with, we will first create IAM role and…Read more …
Get all AWS IAM user information

Get all AWS IAM user information

Greetings! Access rights is very critical for any project. You need to be certain who should have access to which resources and then manage that. You should regularly audit users and access rights they have. In this article I tried to get all AWS IAM users, policies they have attached, is multi factor authentication enabled and groups they are member of. For code I have used python and boto3 to fetch data from AWS. I have used lambda function to execute this code. Script will fetch the data and export it to file…Read more …
Re-execute User Data script for windows instance in AWS

Re-execute User Data script for windows instance in AWS

User data is one of the cool feature of AWS. You can define the code which want to execute immediately after instance is created. But once it is executed the feature is immediately disabled. If you will execute the user data changes want apply. If you want to execute code using user data in later, you need to make changes to “config.xml”. You can use below script to enable user data feature. Example, from the documentation: $EC2SettingsFile="C:\Program Files\Amazon\Ec2ConfigService\Settings\Config.xml" $xml = [xml](get-content $EC2SettingsFile) $xmlElement = $xml.get_DocumentElement() $xmlElementToModify = $xmlElement.Plugins foreach ($element in $xmlElementToModify.Plugin)  …Read more …