Created
October 4, 2022 00:53
-
-
Save timmyers/8bf261e633a197397389cb0d1f40023d to your computer and use it in GitHub Desktop.
Pulumi IaC IAM User Change #2
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 defaultTags = { Creator: 'pulumi' }; | |
const timUser = new aws.iam.User('tim.myers', { | |
name: 'tim.myers', | |
tags: defaultTags, | |
}); | |
new aws.iam.UserPolicyAttachment('tim.myers-readonly', { | |
user: timUser.name, | |
policyArn: aws.iam.getPolicyOutput({ name: 'ReadOnlyAccess'}).arn, | |
}); | |
new aws.iam.UserPolicyAttachment('tim.myers-password', { | |
user: timUser.name, | |
policyArn: aws.iam.getPolicyOutput({ name: 'IAMUserChangePassword'}).arn, | |
}); | |
ew aws.iam.UserPolicy('tim.myers-infrastructure-role', { | |
user: timUser.name, | |
policy: { | |
Version: '2012-10-17', | |
Statement: [{ | |
Effect: 'Allow', | |
Action: 'sts:AssumeRole', | |
Resource: infrastructureRole.arn, | |
}] | |
}, | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment