Skip to content

Commit 3897038

Browse files
authored
Generating regional STS endpoints to allow for default EBS encryption in opt-in regions (#284)
* Moving assume_role method to process_enable_ebs_encryption_by_default so that we can build a regional STS endpoint. * Using AWS_STS_REGIONAL_ENDPOINTS env variable instead of generating regional endpoint. * Adding entry to changelog and updating table of contents. * Resolving linting issue W293
1 parent de490b9 commit 3897038

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

CHANGELOG.md

+7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
## Table of Contents<!-- omit in toc -->
44

55
- [Introduction](#introduction)
6+
- [2025-02-04](#2025-02-04)
7+
- [2025-01-21](#2025-01-21)
8+
- [2025-01-08](#2025-01-08)
69
- [2024-09-18](#2024-09-18)
710
- [2024-08-22](#2024-08-22)
811
- [2024-07-17](#2024-07-17)
@@ -64,6 +67,10 @@ All notable changes to this project will be documented in this file.
6467

6568
- Added [Bedrock](aws_sra_examples/solutions/genai/bedrock_org) solution to deploy the sra-bedrock-org solution for GenAI deep-dive Bedrock capability one security controls. See https://github.com/aws-samples/aws-security-reference-architecture-examples (sra-1u3sd7f8n)
6669

70+
### Updated<!-- omit in toc -->
71+
72+
- Updated [EC2 Default EBS Encryption](aws_sra_examples/solutions/ec2/ec2_default_ebs_encryption) solution with STS environment variable to enable enforcement in opt-in regions.
73+
6774
## 2025-01-21
6875

6976
### Updated<!-- omit in toc -->

aws_sra_examples/solutions/ec2/ec2_default_ebs_encryption/lambda/src/app.py

+3
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@ def assume_role(role: str, role_session_name: str, account: str = None, session:
7676
Returns:
7777
Session object for the specified AWS account
7878
"""
79+
# set regional endpoint environment variable to account for potential opt-in regions
80+
os.environ["AWS_STS_REGIONAL_ENDPOINTS"] = "regional"
81+
7982
if not session:
8083
session = boto3.Session()
8184
sts_client: STSClient = session.client("sts", config=BOTO3_CONFIG)

0 commit comments

Comments
 (0)