Created
April 23, 2019 23:29
-
-
Save MatthewJDavis/5a8f9c79e34ec5abfd736bc3391cac99 to your computer and use it in GitHub Desktop.
Create the policy and roles for the lambda tagging
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $RoleName = 'lambda_volume_tagging' | |
| $RoleDescription = 'Allow lambda to apply tags to volumes' | |
| $PolicyName = 'lambda-volume-tagging' | |
| $PolicyDescription = 'Allow lambdas to log and also tag volumes' | |
| $policy = New-IamPolicy -PolicyName $policyName -Description $PolicyDescription -PolicyDocument (Get-Content -Path lambda-tagging-policy.json -Raw ) | |
| New-IamRole -RoleName $RoleName -Description $RoleDescription -AssumeRolePolicyDocument (Get-Content -Path lambda-trust-policy.json -Raw) | |
| Register-IAMRolePolicy -PolicyArn $policy.Arn -RoleName $RoleName |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment