[CloudFormation] IAM User 만들기

tallhyun·2020년 5월 13일
0
AWSTemplateFormatVersion: '2010-09-09'

Resources:
  createIAMUser:
    Type: AWS::IAM::User
    Properties:
      Groups:
        - 추가 할 그룹
      LoginProfile:
        Password: 사용자패스워드
      UserName:
        !Join
          - ''
          - - !Ref 'AWS::Region'
            - '_'
            - !Ref 'UserName'

  createAccessKey:
    Type: AWS::IAM::AccessKey
    Properties: 
      Status: Active
      UserName: 
        !Join
          - ''
          - - !Ref 'AWS::Region'
            - '_'
            - !Ref 'UserName'
    DependsOn: createIAMUser

Parameters:
  UserName:
    Description: UserName for IAM
    Type: String

Outputs:
  IAMtest:
    Value:
      !Join
      - ''
      - - !Ref createAccessKey
        - ' and '
        - !GetAtt createAccessKey.SecretAccessKey

참고: https://docs.aws.amazon.com/ko_kr/AWSCloudFormation/latest/UserGuide/aws-properties-iam-user.html

profile
보안, 클라우드, 풀스택에 관심이 있습니다.

0개의 댓글