AWS IAM documentation change
Summary
Updated code examples with Kotlin multi-line strings and fromEnvironment() client initialization
Security assessment
Code formatting changes only. The S3 policy remains permissive ('Resource': '*') but this was not introduced in the change. No security-specific documentation added.
Diff
diff --git a/IAM/latest/UserGuide/id_roles_use_switch-role-api.md b/IAM/latest/UserGuide/id_roles_use_switch-role-api.md index 1c8b4c7ee..f1b43338f 100644 --- a//IAM/latest/UserGuide/id_roles_use_switch-role-api.md +++ b//IAM/latest/UserGuide/id_roles_use_switch-role-api.md @@ -4178,13 +4178,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() @@ -4198 +4199 @@ Create functions that wrap IAM user actions. - IamClient { region = "AWS_GLOBAL" }.use { iamClient -> + IamClient.fromEnvironment { region = "AWS_GLOBAL" }.use { iamClient -> @@ -4232 +4233 @@ Create functions that wrap IAM user actions. - IamClient { region = "AWS_GLOBAL" }.use { iamClient -> + IamClient.fromEnvironment { region = "AWS_GLOBAL" }.use { iamClient -> @@ -4275,5 +4276 @@ Create functions that wrap IAM user actions. - val stsClient = - StsClient { - region = "us-east-1" - } - + val stsClient = StsClient.fromEnvironment { region = "us-east-1" } @@ -4292,2 +4289 @@ Create functions that wrap IAM user actions. - val staticCredentials = - StaticCredentialsProvider { + val staticCredentials = StaticCredentialsProvider { @@ -4300,3 +4296 @@ Create functions that wrap IAM user actions. - val s3 = - S3Client { - credentialsProvider = staticCredentials + val s3 = S3Client.fromEnvironment { @@ -4303,0 +4298 @@ Create functions that wrap IAM user actions. + credentialsProvider = staticCredentials @@ -4325 +4320 @@ Create functions that wrap IAM user actions. - val iam = IamClient { region = "AWS_GLOBAL" } + val iam = IamClient.fromEnvironment { region = "AWS_GLOBAL" } @@ -4356 +4351 @@ Create functions that wrap IAM user actions. - val iam = IamClient { region = "AWS_GLOBAL" } + val iam = IamClient.fromEnvironment { region = "AWS_GLOBAL" }