IAM

IAM 샘플 템플릿은 역할, 정책, 사용자, 그룹을 생성합니다.

참고
템플릿에 IAM 리소스를 생성하는 구성이 포함된 경우 스택을 생성할 때 파라미터 설정 단계에서 Infrastructure Builder에서 IAM 리소스를 생성할 수 있도록 승인합니다. 항목을 선택해야 다음 버튼이 활성화됩니다. 자세한 내용은 스택 생성하기를 참고하세요.

사용자를 생성하여 그룹에 추가

사용자와 그룹을 생성하고, 생성한 사용자를 생성한 그룹에 가입시킵니다.

  • AccountId, UserName, UserPassword는 필수로 입력해야 합니다.
  • UserPassword는 입력값이 마스킹되어 표시됩니다(NoEcho). 템플릿에 비밀번호를 직접 작성하지 말고 스택을 생성할 때 파라미터로 입력하세요.
  • TemporaryPassword가 true로 지정되어 있으며, 최초 로그인 후 비밀번호를 변경하는 것을 권장합니다.
  • UserName을 변경하면 사용자 리소스가 교체됩니다.
배경색 변경
SCPTemplateFormatVersion: '2026-01-01'
Description: 'IAM 사용자/그룹 생성 및 그룹 가입 샘플'

Parameters:
  AccountId:
    Type: String
    Description: '사용자를 생성할 계정 ID'
  UserName:
    Type: String
    Description: '사용자 이름 (변경 시 리소스 교체)'
  UserPassword:
    Type: String
    NoEcho: true
    Description: '사용자 비밀번호 (최초 로그인 후 변경 권장)'
  GroupName:
    Type: String
    Default: example-group
    Description: '그룹 이름 (3~24자)'

Resources:
  ExampleGroup:
    Type: SCP::IAM::Group
    Properties:
      Name: !Ref GroupName
      Description: '예제 그룹'
      UserIds:
        - !Ref ExampleUser
  ExampleUser:
    Type: SCP::IAM::User
    Properties:
      AccountId: !Ref AccountId
      UserName: !Ref UserName
      TemporaryPassword: true
      Password: !Ref UserPassword
      Description: '예제 사용자'

Outputs:
  UserId:
    Description: '생성된 사용자의 ID'
    Value: !Ref ExampleUser
  GroupId:
    Description: '생성된 그룹의 ID'
    Value: !Ref ExampleGroup
SCPTemplateFormatVersion: '2026-01-01'
Description: 'IAM 사용자/그룹 생성 및 그룹 가입 샘플'

Parameters:
  AccountId:
    Type: String
    Description: '사용자를 생성할 계정 ID'
  UserName:
    Type: String
    Description: '사용자 이름 (변경 시 리소스 교체)'
  UserPassword:
    Type: String
    NoEcho: true
    Description: '사용자 비밀번호 (최초 로그인 후 변경 권장)'
  GroupName:
    Type: String
    Default: example-group
    Description: '그룹 이름 (3~24자)'

Resources:
  ExampleGroup:
    Type: SCP::IAM::Group
    Properties:
      Name: !Ref GroupName
      Description: '예제 그룹'
      UserIds:
        - !Ref ExampleUser
  ExampleUser:
    Type: SCP::IAM::User
    Properties:
      AccountId: !Ref AccountId
      UserName: !Ref UserName
      TemporaryPassword: true
      Password: !Ref UserPassword
      Description: '예제 사용자'

Outputs:
  UserId:
    Description: '생성된 사용자의 ID'
    Value: !Ref ExampleUser
  GroupId:
    Description: '생성된 그룹의 ID'
    Value: !Ref ExampleGroup
코드 블럭. 사용자를 생성하여 그룹에 추가 템플릿

정책을 생성하여 그룹과 역할에 연결

정책을 생성하고 그룹과 역할에 연결합니다.

  • GroupName, RoleName, TrustedAccountId는 필수로 입력해야 합니다.
  • TrustedAccountId에는 역할을 위임받을 Account ID를 입력하세요.
배경색 변경
SCPTemplateFormatVersion: '2026-01-01'
Description: 'IAM 정책 생성 및 그룹/역할 연결 샘플'

Parameters:
  PolicyName:
    Type: String
    Default: example-policy
    Description: '정책 이름 (3~128자)'
  GroupName:
    Type: String
    Description: '정책을 부여할 그룹 이름 (3~24자)'
  RoleName:
    Type: String
    Description: '정책을 부여할 역할 이름 (1~64자)'
  TrustedAccountId:
    Type: String
    Description: '역할을 Assume 할 계정 ID'

Resources:
  ExamplePolicy:
    Type: SCP::IAM::Policy
    Properties:
      PolicyName: !Ref PolicyName
      Description: '예제 정책'
      PolicyVersion:
        PolicyVersionName: POLICY_VERSION_1
        PolicyDocument:
          Version: '2024-07-01'
          Statement:
            - Sid: ReadOnly
              Effect: Allow
              Action:
                - 'iam:Get*'
              Resource:
                - '*'
  ExampleGroup:
    Type: SCP::IAM::Group
    Properties:
      Name: !Ref GroupName
      Description: '정책이 연결된 그룹'
      PolicyIds:
        - !Ref ExamplePolicy
  ExampleRole:
    Type: SCP::IAM::Role
    Properties:
      Name: !Ref RoleName
      Description: '정책이 연결된 역할'
      PolicyIds:
        - !Ref ExamplePolicy
      Principals:
        - Type: ACCOUNT
          Value: !Ref TrustedAccountId

Outputs:
  PolicyId:
    Description: '생성된 정책의 ID'
    Value: !Ref ExamplePolicy
SCPTemplateFormatVersion: '2026-01-01'
Description: 'IAM 정책 생성 및 그룹/역할 연결 샘플'

Parameters:
  PolicyName:
    Type: String
    Default: example-policy
    Description: '정책 이름 (3~128자)'
  GroupName:
    Type: String
    Description: '정책을 부여할 그룹 이름 (3~24자)'
  RoleName:
    Type: String
    Description: '정책을 부여할 역할 이름 (1~64자)'
  TrustedAccountId:
    Type: String
    Description: '역할을 Assume 할 계정 ID'

Resources:
  ExamplePolicy:
    Type: SCP::IAM::Policy
    Properties:
      PolicyName: !Ref PolicyName
      Description: '예제 정책'
      PolicyVersion:
        PolicyVersionName: POLICY_VERSION_1
        PolicyDocument:
          Version: '2024-07-01'
          Statement:
            - Sid: ReadOnly
              Effect: Allow
              Action:
                - 'iam:Get*'
              Resource:
                - '*'
  ExampleGroup:
    Type: SCP::IAM::Group
    Properties:
      Name: !Ref GroupName
      Description: '정책이 연결된 그룹'
      PolicyIds:
        - !Ref ExamplePolicy
  ExampleRole:
    Type: SCP::IAM::Role
    Properties:
      Name: !Ref RoleName
      Description: '정책이 연결된 역할'
      PolicyIds:
        - !Ref ExamplePolicy
      Principals:
        - Type: ACCOUNT
          Value: !Ref TrustedAccountId

Outputs:
  PolicyId:
    Description: '생성된 정책의 ID'
    Value: !Ref ExamplePolicy
코드 블럭. 정책을 생성하여 그룹과 역할에 연결 템플릿

Object Storage 버킷 읽기 전용 역할

기존 Object Storage 버킷에 대한 읽기 전용 정책을 생성하고, 이 정책을 부여한 역할을 생성합니다.

  • BucketSrn, TrustedAccountId는 필수로 입력해야 합니다.
  • BucketSrn에는 읽기 권한을 부여할 버킷의 SRN을 srn:<환경>::<계정ID>:<리전>::objectstorage:bucket/<버킷이름> 형식으로 입력하세요.
  • 정책은 버킷 목록 조회, 정보 조회, 객체 다운로드 작업을 허용합니다.
배경색 변경
SCPTemplateFormatVersion: '2026-01-01'
Description: 'Object Storage 읽기 전용 정책과 역할 생성 샘플'

Parameters:
  PolicyName:
    Type: String
    Default: ObjectStorageReadOnlyPolicy
    Description: '정책 이름 (3~128자)'
  RoleName:
    Type: String
    Default: ObjectStorageReadRole
    Description: '역할 이름 (1~64자)'
  BucketSrn:
    Type: String
    Description: '읽기 권한을 부여할 버킷 SRN (형식: srn:<환경>::<계정ID>:<리전>::objectstorage:bucket/<버킷이름>)'
  TrustedAccountId:
    Type: String
    Description: '역할을 Assume 할 계정 ID'

Resources:
  ReadOnlyPolicy:
    Type: SCP::IAM::Policy
    Properties:
      PolicyName: !Ref PolicyName
      Description: '특정 버킷에 대한 읽기 전용 권한'
      PolicyVersion:
        PolicyVersionName: POLICY_VERSION_1
        PolicyDocument:
          Version: '2024-07-01'
          Statement:
            - Sid: ReadBucket
              Effect: Allow
              Action:
                - 'objectstorage:List*'
                - 'objectstorage:Show*'
                - 'objectstorage:DownloadBucketObject'
              Resource:
                - !Ref BucketSrn
  ReadOnlyRole:
    Type: SCP::IAM::Role
    Properties:
      Name: !Ref RoleName
      Description: '버킷 읽기 전용 역할'
      PolicyIds:
        - !Ref ReadOnlyPolicy
      Principals:
        - Type: ACCOUNT
          Value: !Ref TrustedAccountId

Outputs:
  PolicyIdOutput:
    Description: '생성된 정책의 ID'
    Value: !Ref ReadOnlyPolicy
  RoleIdOutput:
    Description: '생성된 역할의 ID'
    Value: !Ref ReadOnlyRole
SCPTemplateFormatVersion: '2026-01-01'
Description: 'Object Storage 읽기 전용 정책과 역할 생성 샘플'

Parameters:
  PolicyName:
    Type: String
    Default: ObjectStorageReadOnlyPolicy
    Description: '정책 이름 (3~128자)'
  RoleName:
    Type: String
    Default: ObjectStorageReadRole
    Description: '역할 이름 (1~64자)'
  BucketSrn:
    Type: String
    Description: '읽기 권한을 부여할 버킷 SRN (형식: srn:<환경>::<계정ID>:<리전>::objectstorage:bucket/<버킷이름>)'
  TrustedAccountId:
    Type: String
    Description: '역할을 Assume 할 계정 ID'

Resources:
  ReadOnlyPolicy:
    Type: SCP::IAM::Policy
    Properties:
      PolicyName: !Ref PolicyName
      Description: '특정 버킷에 대한 읽기 전용 권한'
      PolicyVersion:
        PolicyVersionName: POLICY_VERSION_1
        PolicyDocument:
          Version: '2024-07-01'
          Statement:
            - Sid: ReadBucket
              Effect: Allow
              Action:
                - 'objectstorage:List*'
                - 'objectstorage:Show*'
                - 'objectstorage:DownloadBucketObject'
              Resource:
                - !Ref BucketSrn
  ReadOnlyRole:
    Type: SCP::IAM::Role
    Properties:
      Name: !Ref RoleName
      Description: '버킷 읽기 전용 역할'
      PolicyIds:
        - !Ref ReadOnlyPolicy
      Principals:
        - Type: ACCOUNT
          Value: !Ref TrustedAccountId

Outputs:
  PolicyIdOutput:
    Description: '생성된 정책의 ID'
    Value: !Ref ReadOnlyPolicy
  RoleIdOutput:
    Description: '생성된 역할의 ID'
    Value: !Ref ReadOnlyRole
코드 블럭. Object Storage 버킷 읽기 전용 역할 템플릿

ServiceWatch 로그 연계 역할

각 Account의 감사 로그와 시스템 로그를 ServiceWatch로 전달하기 위한 역할을 생성합니다.

  • 모든 파라미터에 기본값이 있어 필수로 입력할 파라미터는 없습니다.
배경색 변경
SCPTemplateFormatVersion: '2026-01-01'
Description: 'ServiceWatch 로그 수집 역할 샘플'

Parameters:
  RoleName:
    Type: String
    Default: ServiceRoleForServiceWatchLogCollection
    Description: '역할 이름을 입력하세요. (1~64자)'
  PolicyName:
    Type: String
    Default: servicewatch-log-collection-policy
    Description: '정책 이름을 입력하세요. (3~128자)'

Resources:
  ServiceWatchLogPolicy:
    Type: SCP::IAM::Policy
    Properties:
      PolicyName: !Ref PolicyName
      Description: 'ServiceWatch 로그 수집·전송 권한'
      PolicyVersion:
        PolicyVersionName: POLICY_VERSION_1
        PolicyDocument:
          Version: '2024-07-01'
          Statement:
            - Sid: SendLogsToServiceWatch
              Effect: Allow
              Action:
                - 'servicewatch:CollectLogGroupLogStream'
                - 'servicewatch:CreateBulkServiceLogEvents'
              Resource:
                - '*'
  ServiceWatchLogRole:
    Type: SCP::IAM::Role
    Properties:
      Name: !Ref RoleName
      Description: 'ServiceWatch 로그 연계 역할'
      PolicyIds:
        - !Ref ServiceWatchLogPolicy
      Principals:
        - Type: SERVICE
          Value: loggingaudit.samsungsdscloud.com

Outputs:
  PolicyIdOutput:
    Description: '생성된 정책의 ID'
    Value: !Ref ServiceWatchLogPolicy
  RoleIdOutput:
    Description: '생성된 역할의 ID'
    Value: !Ref ServiceWatchLogRole
SCPTemplateFormatVersion: '2026-01-01'
Description: 'ServiceWatch 로그 수집 역할 샘플'

Parameters:
  RoleName:
    Type: String
    Default: ServiceRoleForServiceWatchLogCollection
    Description: '역할 이름을 입력하세요. (1~64자)'
  PolicyName:
    Type: String
    Default: servicewatch-log-collection-policy
    Description: '정책 이름을 입력하세요. (3~128자)'

Resources:
  ServiceWatchLogPolicy:
    Type: SCP::IAM::Policy
    Properties:
      PolicyName: !Ref PolicyName
      Description: 'ServiceWatch 로그 수집·전송 권한'
      PolicyVersion:
        PolicyVersionName: POLICY_VERSION_1
        PolicyDocument:
          Version: '2024-07-01'
          Statement:
            - Sid: SendLogsToServiceWatch
              Effect: Allow
              Action:
                - 'servicewatch:CollectLogGroupLogStream'
                - 'servicewatch:CreateBulkServiceLogEvents'
              Resource:
                - '*'
  ServiceWatchLogRole:
    Type: SCP::IAM::Role
    Properties:
      Name: !Ref RoleName
      Description: 'ServiceWatch 로그 연계 역할'
      PolicyIds:
        - !Ref ServiceWatchLogPolicy
      Principals:
        - Type: SERVICE
          Value: loggingaudit.samsungsdscloud.com

Outputs:
  PolicyIdOutput:
    Description: '생성된 정책의 ID'
    Value: !Ref ServiceWatchLogPolicy
  RoleIdOutput:
    Description: '생성된 역할의 ID'
    Value: !Ref ServiceWatchLogRole
코드 블럭. ServiceWatch 로그 연계 역할 템플릿

ServiceWatch Cross Account 역할

ServiceWatch가 대상 Account의 지표와 대시보드를 모니터링 Account에 공유할 수 있도록 위임하는 역할을 생성합니다.

  • MonitoringAccountId는 필수로 입력해야 합니다. 지표와 대시보드를 공유받을 모니터링 Account ID를 입력하세요.
  • ServiceWatch-CrossAccountSharingPolicy는 기본 정책으로 이미 생성되어 있으므로 같은 이름으로 정책을 생성하면 충돌할 수 있습니다. PolicyName에는 다른 이름을 사용하세요. 기본값은 CustomServiceWatchCrossAccountSharingPolicy입니다.
배경색 변경
SCPTemplateFormatVersion: '2026-01-01'
Description: 'ServiceWatch Cross Account 공유 역할 샘플'

Parameters:
  RoleName:
    Type: String
    Default: ServiceWatch-CrossAccountSharingRole
    Description: '역할 이름을 입력하세요.'
  PolicyName:
    Type: String
    Default: CustomServiceWatchCrossAccountSharingPolicy
    Description: '정책 이름을 입력하세요. (3~128자)'
  MonitoringAccountId:
    Type: String
    Description: '지표와 대시보드를 공유받을 모니터링 Account ID'

Resources:
  CrossAccountSharingPolicy:
    Type: SCP::IAM::Policy
    Properties:
      PolicyName: !Ref PolicyName
      Description: '모니터링 Account에 공유할 ServiceWatch 조회 권한'
      PolicyVersion:
        PolicyVersionName: POLICY_VERSION_1
        PolicyDocument:
          Version: '2024-07-01'
          Statement:
            - Sid: ShareServiceWatch
              Effect: Allow
              Action:
                - 'servicewatch:ListDashboards'
                - 'servicewatch:ShowDashboard'
                - 'servicewatch:ListSearchOptions'
                - 'servicewatch:ListSearchOptionTags'
                - 'servicewatch:ListMetricInfos'
                - 'servicewatch:ListMetricSeries'
                - 'servicewatch:ListDimensionValues'
                - 'servicewatch:ListDimensionColumns'
                - 'servicewatch:ListKeyMetrics'
                - 'servicewatch:ListMetricData'
                - 'servicewatch:ShowMetricDataJson'
                - 'servicewatch:DownloadMetricDataCsv'
                - 'servicewatch:DownloadMetricDataImage'
                - 'servicewatch:ExportMetricData'
                - 'servicewatch:ListMetricComparePeriods'
                - 'servicewatch:DownloadMetricComparePeriodsCsv'
                - 'servicewatch:ExportMetricComparePeriods'
                - 'resourcemanager:ListResources'
                - 'resourcemanager:ListTags'
              Resource:
                - '*'
  CrossAccountSharingRole:
    Type: SCP::IAM::Role
    Properties:
      Name: !Ref RoleName
      Description: 'ServiceWatch Cross Account 공유 역할'
      PolicyIds:
        - !Ref CrossAccountSharingPolicy
      Principals:
        - Type: ACCOUNT
          Value: !Ref MonitoringAccountId

Outputs:
  PolicyIdOutput:
    Description: '생성된 정책의 ID'
    Value: !Ref CrossAccountSharingPolicy
  RoleIdOutput:
    Description: '생성된 역할의 ID'
    Value: !Ref CrossAccountSharingRole
SCPTemplateFormatVersion: '2026-01-01'
Description: 'ServiceWatch Cross Account 공유 역할 샘플'

Parameters:
  RoleName:
    Type: String
    Default: ServiceWatch-CrossAccountSharingRole
    Description: '역할 이름을 입력하세요.'
  PolicyName:
    Type: String
    Default: CustomServiceWatchCrossAccountSharingPolicy
    Description: '정책 이름을 입력하세요. (3~128자)'
  MonitoringAccountId:
    Type: String
    Description: '지표와 대시보드를 공유받을 모니터링 Account ID'

Resources:
  CrossAccountSharingPolicy:
    Type: SCP::IAM::Policy
    Properties:
      PolicyName: !Ref PolicyName
      Description: '모니터링 Account에 공유할 ServiceWatch 조회 권한'
      PolicyVersion:
        PolicyVersionName: POLICY_VERSION_1
        PolicyDocument:
          Version: '2024-07-01'
          Statement:
            - Sid: ShareServiceWatch
              Effect: Allow
              Action:
                - 'servicewatch:ListDashboards'
                - 'servicewatch:ShowDashboard'
                - 'servicewatch:ListSearchOptions'
                - 'servicewatch:ListSearchOptionTags'
                - 'servicewatch:ListMetricInfos'
                - 'servicewatch:ListMetricSeries'
                - 'servicewatch:ListDimensionValues'
                - 'servicewatch:ListDimensionColumns'
                - 'servicewatch:ListKeyMetrics'
                - 'servicewatch:ListMetricData'
                - 'servicewatch:ShowMetricDataJson'
                - 'servicewatch:DownloadMetricDataCsv'
                - 'servicewatch:DownloadMetricDataImage'
                - 'servicewatch:ExportMetricData'
                - 'servicewatch:ListMetricComparePeriods'
                - 'servicewatch:DownloadMetricComparePeriodsCsv'
                - 'servicewatch:ExportMetricComparePeriods'
                - 'resourcemanager:ListResources'
                - 'resourcemanager:ListTags'
              Resource:
                - '*'
  CrossAccountSharingRole:
    Type: SCP::IAM::Role
    Properties:
      Name: !Ref RoleName
      Description: 'ServiceWatch Cross Account 공유 역할'
      PolicyIds:
        - !Ref CrossAccountSharingPolicy
      Principals:
        - Type: ACCOUNT
          Value: !Ref MonitoringAccountId

Outputs:
  PolicyIdOutput:
    Description: '생성된 정책의 ID'
    Value: !Ref CrossAccountSharingPolicy
  RoleIdOutput:
    Description: '생성된 역할의 ID'
    Value: !Ref CrossAccountSharingRole
코드 블럭. ServiceWatch Cross Account 역할 템플릿

스택 세트 관리자 역할(Self Managed)

스택 세트의 권한 모델로 Self Managed를 사용할 때 필요한 Admin 역할을 생성합니다. 스택 세트 서비스가 이 역할을 Assume하여 대상 Account의 Execution 역할에 작업을 위임하도록 구성합니다.

  • 모든 파라미터에 기본값이 있어 필수로 입력할 파라미터는 없습니다.
  • ExecutionRoleName에는 위임받을 대상 Execution 역할의 이름을 지정하며, 기본값은 스택 세트 실행 역할(Self Managed) 샘플이 생성하는 역할 이름입니다.
배경색 변경
SCPTemplateFormatVersion: '2026-01-01'
Description: 'StackSet Self Managed 권한을 위한 Admin 역할 샘플'

Parameters:
  RoleName:
    Type: String
    Default: SCPInfrastructureBuilderStackSetAdministrationRole
    Description: '역할 이름을 입력하세요. (1~64자)'
  PolicyName:
    Type: String
    Default: stackset-admin-policy
    Description: '정책 이름을 입력하세요. (3~128자)'
  ExecutionRoleName:
    Type: String
    Default: SCPInfrastructureBuilderStackSetExecutionRole
    Description: 'Assume 대상 Execution 역할 이름'

Resources:
  StackSetAdminPolicy:
    Type: SCP::IAM::Policy
    Properties:
      PolicyName: !Ref PolicyName
      Description: 'StackSet 이 Execution Role 을 Assume 하기 위한 정책'
      PolicyVersion:
        PolicyVersionName: POLICY_VERSION_1
        PolicyDocument:
          Version: '2024-07-01'
          Statement:
            - Sid: AssumeExecutionRole
              Effect: Allow
              Action:
                - 'sts:AssumeRole'
              Resource:
                - '*'
              Condition:
                StringLike:
                  "scp:RequestAttribute/body['roleIndicator']":
                    - !Sub '*:*:${ExecutionRoleName}*'
  StackSetAdminRole:
    Type: SCP::IAM::Role
    Properties:
      Name: !Ref RoleName
      Description: 'Infrastructure Builder StackSet Self Managed Admin 역할'
      PolicyIds:
        - !Ref StackSetAdminPolicy
      Principals:
        - Type: SERVICE
          Value: infrastructure-builder.samsungsdscloud.com

Outputs:
  PolicyIdOutput:
    Description: '생성된 정책의 ID'
    Value: !Ref StackSetAdminPolicy
  RoleIdOutput:
    Description: '생성된 역할의 ID'
    Value: !Ref StackSetAdminRole
SCPTemplateFormatVersion: '2026-01-01'
Description: 'StackSet Self Managed 권한을 위한 Admin 역할 샘플'

Parameters:
  RoleName:
    Type: String
    Default: SCPInfrastructureBuilderStackSetAdministrationRole
    Description: '역할 이름을 입력하세요. (1~64자)'
  PolicyName:
    Type: String
    Default: stackset-admin-policy
    Description: '정책 이름을 입력하세요. (3~128자)'
  ExecutionRoleName:
    Type: String
    Default: SCPInfrastructureBuilderStackSetExecutionRole
    Description: 'Assume 대상 Execution 역할 이름'

Resources:
  StackSetAdminPolicy:
    Type: SCP::IAM::Policy
    Properties:
      PolicyName: !Ref PolicyName
      Description: 'StackSet 이 Execution Role 을 Assume 하기 위한 정책'
      PolicyVersion:
        PolicyVersionName: POLICY_VERSION_1
        PolicyDocument:
          Version: '2024-07-01'
          Statement:
            - Sid: AssumeExecutionRole
              Effect: Allow
              Action:
                - 'sts:AssumeRole'
              Resource:
                - '*'
              Condition:
                StringLike:
                  "scp:RequestAttribute/body['roleIndicator']":
                    - !Sub '*:*:${ExecutionRoleName}*'
  StackSetAdminRole:
    Type: SCP::IAM::Role
    Properties:
      Name: !Ref RoleName
      Description: 'Infrastructure Builder StackSet Self Managed Admin 역할'
      PolicyIds:
        - !Ref StackSetAdminPolicy
      Principals:
        - Type: SERVICE
          Value: infrastructure-builder.samsungsdscloud.com

Outputs:
  PolicyIdOutput:
    Description: '생성된 정책의 ID'
    Value: !Ref StackSetAdminPolicy
  RoleIdOutput:
    Description: '생성된 역할의 ID'
    Value: !Ref StackSetAdminRole
코드 블럭. 스택 세트 관리자 역할(Self Managed) 템플릿

스택 세트 실행 역할(Self Managed)

Admin 역할로부터 위임을 받아 대상 Account에서 실제로 리소스를 배포하는 Execution 역할을 생성합니다. 대상 Account마다 생성해야 합니다.

  • AdminRoleSrn은 필수로 입력해야 합니다. 신뢰할 Admin 역할의 SRN을 입력하세요.
주의
이 샘플은 모든 작업(*)과 모든 리소스(*)를 허용하는 정책을 사용합니다. 운영 환경에서는 스택 세트로 배포하는 리소스에 필요한 권한만 허용하도록 범위를 줄이세요.
배경색 변경
SCPTemplateFormatVersion: '2026-01-01'
Description: 'StackSet Self Managed 권한을 위한 Execution 역할 샘플'

Parameters:
  RoleName:
    Type: String
    Default: SCPInfrastructureBuilderStackSetExecutionRole
    Description: '역할 이름을 입력하세요. (1~64자)'
  PolicyName:
    Type: String
    Default: stackset-execution-policy
    Description: '정책 이름을 입력하세요. (3~128자)'
  AdminRoleSrn:
    Type: String
    Description: '신뢰할 Admin 역할의 SRN'

Resources:
  StackSetExecutionPolicy:
    Type: SCP::IAM::Policy
    Properties:
      PolicyName: !Ref PolicyName
      Description: 'StackSet 배포에 필요한 전체 권한 정책'
      PolicyVersion:
        PolicyVersionName: POLICY_VERSION_1
        PolicyDocument:
          Version: '2024-07-01'
          Statement:
            - Sid: FullAccess
              Effect: Allow
              Action:
                - '*'
              Resource:
                - '*'
  StackSetExecutionRole:
    Type: SCP::IAM::Role
    Properties:
      Name: !Ref RoleName
      Description: 'Infrastructure Builder StackSet Self Managed Execution 역할'
      PolicyIds:
        - !Ref StackSetExecutionPolicy
      Principals:
        - Type: SRN
          Value: !Ref AdminRoleSrn

Outputs:
  ExecutionRoleId:
    Description: '생성된 Execution 역할의 ID'
    Value: !Ref StackSetExecutionRole
SCPTemplateFormatVersion: '2026-01-01'
Description: 'StackSet Self Managed 권한을 위한 Execution 역할 샘플'

Parameters:
  RoleName:
    Type: String
    Default: SCPInfrastructureBuilderStackSetExecutionRole
    Description: '역할 이름을 입력하세요. (1~64자)'
  PolicyName:
    Type: String
    Default: stackset-execution-policy
    Description: '정책 이름을 입력하세요. (3~128자)'
  AdminRoleSrn:
    Type: String
    Description: '신뢰할 Admin 역할의 SRN'

Resources:
  StackSetExecutionPolicy:
    Type: SCP::IAM::Policy
    Properties:
      PolicyName: !Ref PolicyName
      Description: 'StackSet 배포에 필요한 전체 권한 정책'
      PolicyVersion:
        PolicyVersionName: POLICY_VERSION_1
        PolicyDocument:
          Version: '2024-07-01'
          Statement:
            - Sid: FullAccess
              Effect: Allow
              Action:
                - '*'
              Resource:
                - '*'
  StackSetExecutionRole:
    Type: SCP::IAM::Role
    Properties:
      Name: !Ref RoleName
      Description: 'Infrastructure Builder StackSet Self Managed Execution 역할'
      PolicyIds:
        - !Ref StackSetExecutionPolicy
      Principals:
        - Type: SRN
          Value: !Ref AdminRoleSrn

Outputs:
  ExecutionRoleId:
    Description: '생성된 Execution 역할의 ID'
    Value: !Ref StackSetExecutionRole
코드 블럭. 스택 세트 실행 역할(Self Managed) 템플릿
Sample Template
VPC