Skip to content

AWS Config for Python using Code Loom#7566

Closed
beqqrry-aws wants to merge 4 commits intoawsdocs:mainfrom
beqqrry-aws:python-config-CL2
Closed

AWS Config for Python using Code Loom#7566
beqqrry-aws wants to merge 4 commits intoawsdocs:mainfrom
beqqrry-aws:python-config-CL2

Conversation

@beqqrry-aws
Copy link
Copy Markdown
Contributor


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions github-actions Bot added the Python This issue relates to the AWS SDK for Python (boto3) label Sep 5, 2025
@github-actions github-actions Bot added the Tools This issue relates to a custom tooling to streamline development tasks label Sep 5, 2025
@@ -0,0 +1,195 @@
# zexi 0.4.0
config_PutConfigurationRecorder:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks like it edited the old file and made a new one. We should decide which to keep.

def __init__(self, config_wrapper, s3_resource, iam_resource):
"""
:param config_wrapper: An object that wraps AWS Config operations.
:param s3_resource: A Boto3 S3 resource.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is it using resources instead of clients?

# Get IAM role ARN
self.role_arn = q.ask(
"Enter the ARN of an IAM role that grants AWS Config permissions to access your resources "
"(e.g., arn:aws:iam::123456789012:role/config-role): ",
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think we want it to create this role, right?

# Show recorder status
print("Checking configuration recorder status...")
try:
statuses = self.config_wrapper.describe_configuration_recorder_status([self.recorder_name])
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should this change the configuration of the bucket so that there is something to view? Maybe I'm not seeing it.

print("-" * 60)

if self.recorder_name:
cleanup = q.ask(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is there a bucket (and maybe a role?) to clean up also?

recorders = response.get('ConfigurationRecorders', [])

if recorders:
print(f"Found {len(recorders)} configuration recorder(s):")
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Should use pagination for all of the listing operations.


import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'll have to run the tests, they look like they could follow the pattern better.

error_code=error_code,
)

def stub_put_configuration_recorder(self, recorder, error_code=None):
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good that it added the stubber functions.

@beqqrry-aws beqqrry-aws changed the title AWS Config for Python AWS Config for Python using Code Loom Sep 10, 2025
@beqqrry-aws beqqrry-aws self-assigned this Sep 11, 2025
@brmur
Copy link
Copy Markdown
Collaborator

brmur commented Oct 21, 2025

We've taken lessons learned from this output, so closing

@brmur brmur closed this Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Python This issue relates to the AWS SDK for Python (boto3) Tools This issue relates to a custom tooling to streamline development tasks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants