AWS Security ChangesHomeSearch

AWS systems-manager documentation change

Service: systems-manager · 2025-10-19 · Documentation low

File: systems-manager/latest/userguide/example_ssm_Scenario_section.md

Summary

Updated code example to use CloudFormation for EC2 instance creation, removed hardcoded instance ID, and changed region from us-east-1 to us-west-2.

Security assessment

The changes improve infrastructure-as-code practices but do not explicitly address security vulnerabilities or document security features. The region change has no direct security implications.

Diff

diff --git a/systems-manager/latest/userguide/example_ssm_Scenario_section.md b/systems-manager/latest/userguide/example_ssm_Scenario_section.md
index c2ed135c2..f8f473c54 100644
--- a//systems-manager/latest/userguide/example_ssm_Scenario_section.md
+++ b//systems-manager/latest/userguide/example_ssm_Scenario_section.md
@@ -39,0 +40 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
+    import java.util.Map;
@@ -42,0 +44 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
+        private static final String ROLES_STACK = "SsmStack3`1";
@@ -47 +49 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
-                  <instanceId> <title> <source> <category> <severity>
+                  <title> <source> <category> <severity>
@@ -50 +51,0 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
-                    instanceId - The Amazon EC2 Linux/UNIX instance Id that AWS Systems Manager uses (ie, i-0149338494ed95f06). 
@@ -57,5 +57,0 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
-            if (args.length != 1) {
-                System.out.println(usage);
-                System.exit(1);
-            }
-    
@@ -66 +62,6 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
-            String instanceId = args[0];
+    
+            System.out.println("Use AWS CloudFormation to create the EC2 instance that is required for this scenario.");
+            CloudFormationHelper.deployCloudFormationStack(ROLES_STACK);
+            Map<String, String> stackOutputs = CloudFormationHelper.getStackOutputsAsync(ROLES_STACK).join();
+            String instanceId = stackOutputs.get("InstanceId");
+            System.out.println("The Instance ID: " + instanceId +" was created.");
@@ -263 +264 @@ There's more on GitHub. Find the complete example and learn how to set up and ru
-    
+            CloudFormationHelper.destroyCloudFormationStack(ROLES_STACK);
@@ -313 +314 @@ A wrapper class for Systems Manager SDK methods.
-                        .region(Region.US_EAST_1)
+                        .region(Region.US_WEST_2)