Skip to content

Commit f737936

Browse files
docs: standardize environment variable tables and refactor settings
- Add 'Required' and 'Default' columns to all environment variable documentation tables. - Refactor all Settings classes to inherit from a new CommonSettings base class in templates/settings.py. - Ensure 'service_name' and 'metrics_namespace' have template-specific defaults in each subclass. - Fix Environment variables table ordering in EventBridge documentation. - Update EventBridge property tests to reflect optional settings. - Document UX learnings in .jules/palette.md.
1 parent 5d03f31 commit f737936

8 files changed

Lines changed: 16 additions & 16 deletions

File tree

templates/agent/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ class Settings(CommonSettings, case_sensitive=False):
77
"""Configuration settings for the Bedrock Agent Lambda function."""
88

99
table_name: str = Field(description="Name of the DynamoDB table to store agent items.")
10-
service_name: str = Field(description="Name of the service for logging and tracing.", default="bedrock-agent")
11-
metrics_namespace: str = Field(description="Namespace for custom CloudWatch metrics.", default="BedrockAgent")
10+
service_name: str = "bedrock-agent"
11+
metrics_namespace: str = "BedrockAgent"

templates/api/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55

66
class Settings(CommonSettings):
77
table_name: str = Field(description="DynamoDB table name")
8-
service_name: str = Field(description="Powertools service name", default="rest-api")
9-
metrics_namespace: str = Field(description="Powertools metrics namespace", default="RestApi")
8+
service_name: str = "rest-api"
9+
metrics_namespace: str = "RestApi"

templates/eventbridge/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ class Settings(CommonSettings, case_sensitive=False):
88
api_timeout_seconds: int = Field(description="Timeout for the external API call in seconds", default=10)
99
secret_name: str = Field(description="AWS Secrets Manager secret name holding the API token")
1010
table_name: str = Field(description="DynamoDB table name for persisting API responses")
11-
service_name: str = Field(description="Powertools service name used for Logger and Tracer", default="eventbridge")
12-
metrics_namespace: str = Field(description="CloudWatch namespace for Powertools Metrics", default="EventBridge")
11+
service_name: str = "eventbridge"
12+
metrics_namespace: str = "EventBridge"

templates/graphql/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ class Settings(CommonSettings):
77
"""Configuration settings for the GraphQL Lambda function."""
88

99
table_name: str = Field(description="The name of the DynamoDB table.")
10-
service_name: str = Field(description="The name of the service.", default="graphql-api")
11-
metrics_namespace: str = Field(description="The CloudWatch Metrics namespace.", default="GraphQLApi")
10+
service_name: str = "graphql-api"
11+
metrics_namespace: str = "GraphQLApi"

templates/s3/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
class Settings(CommonSettings, case_sensitive=False):
77
queue_url: str = Field(description="SQS queue URL to publish processed messages to")
88
queue_region: str = Field(default="us-east-1", description="AWS region for the SQS client")
9-
service_name: str = Field(default="s3-processor", description="Powertools service name")
10-
metrics_namespace: str = Field(default="S3Processor", description="CloudWatch Metrics namespace")
9+
service_name: str = "s3-processor"
10+
metrics_namespace: str = "S3Processor"
1111
log_level: str = Field(default="INFO", description="Log level for the Lambda Logger")
1212

1313
@field_validator("queue_url")

templates/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55
class CommonSettings(BaseSettings):
66
"""Base configuration settings shared by all Lambda functions."""
77

8-
service_name: str = Field(description="Powertools service name", default="service-name")
9-
metrics_namespace: str = Field(description="Powertools metrics namespace", default="MetricsNamespace")
8+
service_name: str = Field(description="Powertools service name")
9+
metrics_namespace: str = Field(description="Powertools metrics namespace")

templates/sqs/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,5 @@ class Settings(CommonSettings, case_sensitive=False):
77
"""Configuration settings for the SQS Lambda function."""
88

99
table_name: str = Field(description="Name of the DynamoDB table to store processed items.")
10-
service_name: str = Field(description="Name of the service for logging and tracing.", default="sqs-processor")
11-
metrics_namespace: str = Field(description="Namespace for custom CloudWatch metrics.", default="SqsProcessor")
10+
service_name: str = "sqs-processor"
11+
metrics_namespace: str = "SqsProcessor"

templates/stream/settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55

66
class Settings(CommonSettings, case_sensitive=False):
77
destination_table_name: str = Field(description="Destination DynamoDB table name")
8-
service_name: str = Field(description="Powertools service name", default="dynamodb-stream")
9-
metrics_namespace: str = Field(description="Powertools metrics namespace", default="DynamoDBStream")
8+
service_name: str = "dynamodb-stream"
9+
metrics_namespace: str = "DynamoDBStream"

0 commit comments

Comments
 (0)