Skip to content

Instantly share code, notes, and snippets.

@MatthewJDavis
Created April 23, 2019 23:29
Show Gist options
  • Select an option

  • Save MatthewJDavis/5a8f9c79e34ec5abfd736bc3391cac99 to your computer and use it in GitHub Desktop.

Select an option

Save MatthewJDavis/5a8f9c79e34ec5abfd736bc3391cac99 to your computer and use it in GitHub Desktop.
Create the policy and roles for the lambda tagging
$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