Skip to content

Commit 94718aa

Browse files
committed
[fix] automatic management of /ssm/parameter-store/high-throughput-enabled
1 parent 37893f2 commit 94718aa

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

installer/SOCAInstallerIamPolicy.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@
176176
"ssm:AddTagsToResource",
177177
"ssm:PutParameter",
178178
"ssm:GetParameter*",
179+
"ssm:GetServiceSetting",
180+
"ssm:ResetServiceSetting",
181+
"ssm:UpdateServiceSetting",
179182
"sts:DecodeAuthorizationMessage",
180183
"sts:GetCallerIdentity"
181184
],

installer/resources/src/install_soca.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2302,6 +2302,9 @@ def override_keys(keys_to_override, install_properties):
23022302
fsx = session.client(
23032303
"fsx", region_name=install_parameters["region"], config=boto_extra_config
23042304
)
2305+
ssm = session.client(
2306+
"ssm", region_name=install_parameters["region"], config=boto_extra_config
2307+
)
23052308

23062309
cloudformation = session.client(
23072310
"cloudformation",
@@ -2481,11 +2484,35 @@ def override_keys(keys_to_override, install_properties):
24812484
install_parameters["cluster_id"],
24822485
)
24832486

2487+
# Temporarily disable SSM Throughput if needed (https://docs.aws.amazon.com/systems-manager/latest/userguide/parameter-store-throughput.html)
2488+
# Settings will be re-disabled if needed post deployment
2489+
disable_ssm_high_throughput_post_install = False
2490+
2491+
_check_ssm_high_throughput = ssm.get_service_setting(
2492+
SettingId="/ssm/parameter-store/high-throughput-enabled"
2493+
)
2494+
2495+
if _check_ssm_high_throughput.get("ServiceSetting").get("SettingValue") == "false":
2496+
logger.warning("Temporarily enabling /ssm/parameter-store/high-throughput-enabled for SOCA deployment")
2497+
ssm.update_service_setting(
2498+
SettingId="/ssm/parameter-store/high-throughput-enabled",
2499+
SettingValue="true"
2500+
)
2501+
disable_ssm_high_throughput_post_install = True
2502+
24842503
# Then launch the actual SOCA installer
24852504
logger.info("\n====== Deploying SOCA ======\n")
24862505
launch_installer = os.system(cmd) # nosec
24872506

24882507
if cdk_cmd == "deploy":
2508+
# Optional - Re-enable SSM default high-throughput settings
2509+
if disable_ssm_high_throughput_post_install:
2510+
logger.warning(
2511+
"Restoring /ssm/parameter-store/high-throughput-enabled to its previous value post-deployment")
2512+
ssm.update_service_setting(
2513+
SettingId="/ssm/parameter-store/high-throughput-enabled",
2514+
SettingValue="false")
2515+
24892516
if int(launch_installer) == 0:
24902517
# SOCA is installed. We will now wait until SOCA is fully configured (when the ELB returns HTTP 200)
24912518
logger.info(f"[bold green]SOCA was installed successfully![/bold green]")

0 commit comments

Comments
 (0)