Last active
September 30, 2022 19:41
-
-
Save timmyers/801a0223d44ffbff7efbf31f42d3543e to your computer and use it in GitHub Desktop.
Pulumi IaC IAM User Import
This file contains 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
import * as aws from '@pulumi/aws'; | |
const timUser = new aws.iam.User('tim.myers', { | |
name: 'tim.myers', | |
}, { import: 'tim.myers'}); | |
new aws.iam.UserPolicyAttachment('tim.myers-admin', { | |
user: timUser.name, | |
policyArn: aws.iam.getPolicyOutput({ name: 'AdministratorAccess'}).arn, | |
}, { import: 'tim.myers/arn:aws:iam::aws:policy/AdministratorAccess' }); | |
new aws.iam.UserPolicyAttachment('tim.myers-password', { | |
user: timUser.name, | |
policyArn: aws.iam.getPolicyOutput({ name: 'IAMUserChangePassword'}).arn, | |
}, { import: 'tim.myers/arn:aws:iam::aws:policy/IAMUserChangePassword' }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment