-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy path20_create-codecommit-user.yaml
More file actions
49 lines (45 loc) · 1.41 KB
/
Copy path20_create-codecommit-user.yaml
File metadata and controls
49 lines (45 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
---
AWSTemplateFormatVersion: '2010-09-09'
Description: 'creates an iam user & group, assigns the user to the group, sets up https codecommit credentials'
Parameters:
username:
Type: String
Default: ""
Description: Name for the CodeCommit User
Resources:
iamUser:
Type: "AWS::IAM::User"
Properties:
UserName:
!Ref username
iamkeys:
Type: "AWS::IAM::AccessKey"
Properties:
UserName: !Ref iamUser
addUserToGroup:
Type: AWS::IAM::UserToGroupAddition
Properties:
GroupName:
!ImportValue sharedinf-codecommitgroup
Users:
- !Ref iamUser
HttpsCredsCustomResource:
DependsOn: addUserToGroup
Type: "Custom::LambdaHttpsCreds" # or AWS::CloudFormation::CustomResource
Properties:
ServiceToken: !ImportValue sharedinf-httpscredsarn # The ARN of the lambda function - only mandatory property
# "Provider Defined Properties" Below..
user: !Ref username
Outputs:
userkey:
Description: Support Access Key ID
Value: !Ref iamkeys
usersecretkey:
Description: Support Secret Access Key
Value: !GetAtt iamkeys.SecretAccessKey
httpscredsusername:
Description: IAM User CodeCommit HTTPS credentials username
Value: !GetAtt HttpsCredsCustomResource.ServiceUserName
httpscredspassword:
Description: IAM User CodeCommit HTTPS credentials password
Value: !GetAtt HttpsCredsCustomResource.ServicePassword