Skip to content

start of gliffy #232

Merged
merged 50 commits into from
Sep 30, 2025
Merged

start of gliffy #232

merged 50 commits into from
Sep 30, 2025

Conversation

morga471
Copy link
Contributor

So we can collaborate via comments.

@morga471 morga471 requested a review from badra001 March 14, 2025 18:55
@morga471 morga471 self-assigned this Mar 14, 2025
# Capture tags for exclusion check
tags = {tag['Key']: tag['Value'] for tag in instance.get('Tags', [])}

resources["ec2_instances"].append({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add the private ip (v4) to this please

# Capture tags for exclusion check
tags = {tag['Key']: tag['Value'] for tag in instance.get('Tags', [])}

resources["ec2_instances"].append({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

private ip here too

logger.warning(f"Error getting tags for RDS instance {instance['DBInstanceIdentifier']}: {tag_e}")

resources["rds_instances"].append({
"id": instance['DBInstanceIdentifier'],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add rds dns name here (and below in the Next processing)

# Capture tags for exclusion check
cluster_tags = cluster_info['cluster'].get('tags', {})

resources["eks_clusters"].append({
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add eks version if possible (here and below)


return resources

def shutdown_ec2_instances(credentials, instances, account_id):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for the output in skipping, add the Name tag

timestamp = datetime.datetime.now().isoformat()

# Tag the instance before stopping
logger.info(f"Tagging EC2 instance {instance['id']} with {STOP_TAG}={timestamp}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add Name tag value to the log

)

# Stop the instance
logger.info(f"Stopping EC2 instance {instance['id']} in region {region}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add Name tag and ip to this log line

Comment on lines 524 to 542
logger.info(f"Saving original ASG {asg_name} sizes: min={current_min_size}, desired={current_desired_size}")
autoscaling_client.create_or_update_tags(
Tags=[
{
'ResourceId': asg_name,
'ResourceType': 'auto-scaling-group',
'Key': TAG_KEY_ORIGINAL_MIN_SIZE,
'Value': str(current_min_size),
'PropagateAtLaunch': False
},
{
'ResourceId': asg_name,
'ResourceType': 'auto-scaling-group',
'Key': TAG_KEY_ORIGINAL_DESIRED_SIZE,
'Value': str(current_desired_size),
'PropagateAtLaunch': False
}
]
)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing max size

Copy link
Contributor

@badra001 badra001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A pile of recommedations. Basically, for output of log lines include

  • ec2: ip, name tag
  • rds: name tag, dns fqdn

@morga471 morga471 requested a review from a team as a code owner April 1, 2025 22:59
Copy link
Contributor

@badra001 badra001 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

approving so we can potentially use it, and then work further changes and enhancements

@badra001
Copy link
Contributor

moving forward

@badra001 badra001 merged commit 1c9199a into master Sep 30, 2025
@badra001 badra001 deleted the gliffy branch September 30, 2025 18:59
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants