공부/IaC
[AWS CloudFormation] #6 IAM User, Policy 생성
haejang
2021. 1. 6. 16:47
728x90
728x90
1. IAM User 바로 만들기
Resources:
AdminUser:
Type: AWS::IAM::User
Properties:
LoginProfile:
Password: P@ssw0rd
Policies:
- PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action: '*'
Resource: '*'
PolicyName: Admin
UserName: Admin1
AdministratorAccess의 정책을 가져와봤다
2. IAM Policy를 만들어서 User에 붙이기
Resources:
AdminUser:
Type: AWS::IAM::User
Properties:
LoginProfile:
Password: P@ssw0rd
UserName: Admin2
AdminPolicy:
Type: AWS::IAM::Policy
Properties:
PolicyDocument:
Version: 2012-10-17
Statement:
- Effect: Allow
Action: '*'
Resource: '*'
PolicyName: Admin
Users:
- !Ref AdminUser
깡통User를 하나 만든 후, Policy에 AdministratorAccess 내용 넣어준 후 User를 연결해줬다
iam-user.yaml
0.00MB
iam-user-policy.yaml
0.00MB
스택을 생성해보면
2개가 잘 만들어졌다
들어가보면 둘 다
Admin 정책이 연결되어 있다
끝
728x90
728x90