AWS Security ChangesHomeSearch

AWS IAM documentation change

Service: IAM · 2025-07-18 · Documentation low

File: IAM/latest/UserGuide/iam_example_iam_Scenario_CreateUserAssumeRole_section.md

Summary

Updated code examples to use Kotlin multi-line strings and fromEnvironment() method for client initialization

Security assessment

Changes are syntax improvements and code style updates. No security vulnerabilities addressed or security features documented. The S3 policy still uses 'Resource': '*' which is a security concern but this was not modified in the change.

Diff

diff --git a/IAM/latest/UserGuide/iam_example_iam_Scenario_CreateUserAssumeRole_section.md b/IAM/latest/UserGuide/iam_example_iam_Scenario_CreateUserAssumeRole_section.md
index 86d03c141..ff8137289 100644
--- a//IAM/latest/UserGuide/iam_example_iam_Scenario_CreateUserAssumeRole_section.md
+++ b//IAM/latest/UserGuide/iam_example_iam_Scenario_CreateUserAssumeRole_section.md
@@ -4156,13 +4156,14 @@ Create functions that wrap IAM user actions.
-        val policyDocumentValue: String =
-            "{" +
-                "  \"Version\": \"2012-10-17\"," +
-                "  \"Statement\": [" +
-                "    {" +
-                "        \"Effect\": \"Allow\"," +
-                "        \"Action\": [" +
-                "            \"s3:*\"" +
-                "       ]," +
-                "       \"Resource\": \"*\"" +
-                "    }" +
-                "   ]" +
-                "}"
+        val policyDocumentValue = """
+        {
+            "Version": "2012-10-17",
+            "Statement": [
+                {
+                    "Effect": "Allow",
+                    "Action": [
+                        "s3:*"
+                    ],
+                    "Resource": "*"
+                }
+            ]
+        }
+        """.trimIndent()
@@ -4176 +4177 @@ Create functions that wrap IAM user actions.
-        IamClient { region = "AWS_GLOBAL" }.use { iamClient ->
+        IamClient.fromEnvironment { region = "AWS_GLOBAL" }.use { iamClient ->
@@ -4210 +4211 @@ Create functions that wrap IAM user actions.
-        IamClient { region = "AWS_GLOBAL" }.use { iamClient ->
+        IamClient.fromEnvironment { region = "AWS_GLOBAL" }.use { iamClient ->
@@ -4253,5 +4254 @@ Create functions that wrap IAM user actions.
-        val stsClient =
-            StsClient {
-                region = "us-east-1"
-            }
-    
+        val stsClient = StsClient.fromEnvironment { region = "us-east-1" }
@@ -4270,2 +4267 @@ Create functions that wrap IAM user actions.
-        val staticCredentials =
-            StaticCredentialsProvider {
+        val staticCredentials = StaticCredentialsProvider {
@@ -4278,3 +4274 @@ Create functions that wrap IAM user actions.
-        val s3 =
-            S3Client {
-                credentialsProvider = staticCredentials
+        val s3 = S3Client.fromEnvironment {
@@ -4281,0 +4276 @@ Create functions that wrap IAM user actions.
+            credentialsProvider = staticCredentials
@@ -4303 +4298 @@ Create functions that wrap IAM user actions.
-        val iam = IamClient { region = "AWS_GLOBAL" }
+        val iam = IamClient.fromEnvironment { region = "AWS_GLOBAL" }
@@ -4334 +4329 @@ Create functions that wrap IAM user actions.
-        val iam = IamClient { region = "AWS_GLOBAL" }
+        val iam = IamClient.fromEnvironment { region = "AWS_GLOBAL" }