The pyawsopstoolkit_insights package offers a comprehensive array of features designed to clean up and maintain hygiene within AWS (Amazon Web Services). It includes tools for identifying unused IAM roles, EC2 Security Groups, and more. Meticulously engineered, these features are finely tuned to meet the unique demands of the expansive AWS ecosystem, encompassing a diverse spectrum of aspects.
Ready to supercharge your AWS operations? Let's get started with pyawsopstoolkit_insights!
Install pyawsopstoolkit_insights via pip:
pip install pyawsopstoolkit_insights
This pyawsopstoolkit_insights.ec2 subpackage offers sophisticated insights specifically designed for AWS (Amazon Web Services) Elastic Compute Cloud (EC2). It provides tools to analyze and manage EC2 instances, and associated resources, ensuring efficient and secure AWS operations.
The SecurityGroup class represents insights related to EC2 security groups.
SecurityGroup(session: Session) -> None
: Initializes a new SecurityGroup object with the provided session.
unused_security_groups() -> list
: Returns a list of unused EC2 security groups.
session
: Anpyawsopstoolkit.session.Session
object providing access to AWS services.
from pyawsopstoolkit.session import Session
from pyawsopstoolkit_insights.ec2 import SecurityGroup
# Create a session using the default profile
session = Session(profile_name='default')
# Initialize the EC2 Security Group object
sg_object = SecurityGroup(session=session)
# Retrieve unused EC2 security groups
unused_security_groups = sg_object.unused_security_groups()
# Print the list of unused security groups
print(unused_security_groups)
This pyawsopstoolkit_insights.iam subpackage offers sophisticated insights specifically designed for AWS (Amazon Web Services) Identity and Access Management (IAM). It provides tools to analyze and manage IAM roles and users, ensuring efficient and secure AWS operations.
The Role class represents insights related to IAM roles.
Role(session: Session) -> None
: Initializes a new Role object with the provided session.
unused_roles(no_of_days: Optional[int] = 90, include_newly_created: Optional[bool] = False) -> list
: Returns a list of unused IAM roles based on the specified parameters.
session
: Anpyawsopstoolkit.session.Session
object providing access to AWS services.
from pyawsopstoolkit.session import Session
from pyawsopstoolkit_insights.iam import Role
# Create a session using the default profile
session = Session(profile_name='default')
# Initialize the IAM Role object
role_object = Role(session=session)
# Retrieve IAM roles unused for the last 90 days
unused_roles = role_object.unused_roles()
# Print the list of unused roles
print(unused_roles)
The User class represents insights related to IAM users.
User(session: Session) -> None
: Initializes a new User object with the provided session
unused_users(no_of_days: Optional[int] = 90, include_newly_created: Optional[bool] = False) -> list
: Returns a list of unused IAM users based on the specified parameters.
session
: Anpyawsopstoolkit.session.Session
object providing access to AWS services.
from pyawsopstoolkit.session import Session
from pyawsopstoolkit_insights.iam import User
# Create a session using the default profile
session = Session(profile_name='default')
# Initialize the IAM User object
user_object = User(session=session)
# Retrieve IAM users unused for the last 90 days
unused_users = user_object.unused_users()
# Print the list of unused users
print(unused_users)
Please refer to the MIT License within the project for more information.
We welcome contributions from the community! Whether you have ideas for new features, bug fixes, or enhancements, feel free to open an issue or submit a pull request on GitHub.