AWS config documentation change
Summary
Added IAM role creation example with PowerShell V5
Security assessment
Documents IAM role creation process including security policy handling, but does not address vulnerabilities. Improves security configuration guidance.
Diff
diff --git a/config/latest/developerguide/gs-cli-prereq.md b/config/latest/developerguide/gs-cli-prereq.md index 65781d877..e7d199b58 100644 --- a//config/latest/developerguide/gs-cli-prereq.md +++ b//config/latest/developerguide/gs-cli-prereq.md @@ -2553,0 +2554,47 @@ PowerShell +**Tools for PowerShell V5** + + +**Example 1: This example creates a new role named`MyNewRole` and attaches to it the policy found in the file `NewRoleTrustPolicy.json`. Note that you must use the `-Raw` switch parameter to successfully process the JSON policy file. The policy document displayed in the output is URL encoded. It is decoded in this example with the `UrlDecode` .NET method. ** + + + $results = New-IAMRole -AssumeRolePolicyDocument (Get-Content -raw NewRoleTrustPolicy.json) -RoleName MyNewRole + $results + + +**Output:** + + + Arn : arn:aws:iam::123456789012:role/MyNewRole + AssumeRolePolicyDocument : %7B%0D%0A%20%20%22Version%22%3A%20%222012-10-17%22%2C%0D%0A%20%20%22Statement%22 + %3A%20%5B%0D%0A%20%20%20%20%7B%0D%0A%20%20%20%20%20%20%22Sid%22%3A%20%22%22%2C + %0D%0A%20%20%20%20%20%20%22Effect%22%3A%20%22Allow%22%2C%0D%0A%20%20%20%20%20%20 + %22Principal%22%3A%20%7B%0D%0A%20%20%20%20%20%20%20%20%22AWS%22%3A%20%22arn%3Aaws + %3Aiam%3A%3A123456789012%3ADavid%22%0D%0A%20%20%20%20%20%20%7D%2C%0D%0A%20%20%20 + %20%20%20%22Action%22%3A%20%22sts%3AAssumeRole%22%0D%0A%20%20%20%20%7D%0D%0A%20 + %20%5D%0D%0A%7D + CreateDate : 4/15/2015 11:04:23 AM + Path : / + RoleId : V5PAJI2KPN4EAEXAMPLE1 + RoleName : MyNewRole + + [System.Reflection.Assembly]::LoadWithPartialName("System.Web.HttpUtility") + [System.Web.HttpUtility]::UrlDecode($results.AssumeRolePolicyDocument) + { + "Version": "2012-10-17", + "Statement": [ + { + "Sid": "", + "Effect": "Allow", + "Principal": { + "AWS": "arn:aws:iam::123456789012:David" + }, + "Action": "sts:AssumeRole" + } + ] + } + + * For API details, see [CreateRole](https://docs.aws.amazon.com/powershell/v5/reference) in _AWS Tools for PowerShell Cmdlet Reference (V5)_. + + + +