SCP::IAM::Role

SCP::IAM::Role

SCP::IAM::Role

Description

An IAM Role that grants permissions through attached policies. A role can be assumed by the configured principals, such as an account, SRN, SAML provider, or service.

Version

1.4.0

Syntax

To declare this entity in your Infrastructure Builder template, use the following syntax:

JSON

{
  "Type" : "SCP::IAM::Role",
  "Properties" : {
    "Name" : "String",
    "Description" : "String",
    "AccountId" : "String",
    "MaxSessionDuration" : "Integer",
    "PolicyIds" : [String],
    "Principals" : [Principals, ...],
    "AssumeRolePolicyDocument" : "AssumeRolePolicyDocument"
  }
}

YAML

Type: SCP::IAM::Role
Properties:
  Name: String
  Description: String
  AccountId: String
  MaxSessionDuration: Integer
  PolicyIds: [String]
  Principals: 
    - Principals
  AssumeRolePolicyDocument: AssumeRolePolicyDocument

Properties

Name

The name of the role. Used to identify the role within the account. After creation, the name cannot be changed. - minLength : 1 - maxLength : 64 - pattern : ^[a-zA-Z0-9+=,.@-_]*$

AttributeValue
RequiredYes
TypeString
Pattern^[a-zA-Z0-9\+\=\,\.\@\-\_]*$
Length constraints1–64
Update requiresReplacement

Description

A brief explanation or note about this role. This helps identify the purpose or usage of the role. - maxLength : 1000

AttributeValue
RequiredNo
TypeString
Length constraintsMax: 1000
Update requiresNo interruption

AccountId

The account ID that the role belongs to. It can only be set by an admin. When omitted, the role is created in the caller account.

AttributeValue
RequiredNo
TypeString
Update requiresNo interruption

MaxSessionDuration

The maximum session duration in seconds for a user who assumes the role. - minimum : 3600 - maximum : 43200 - default : 3600

AttributeValue
RequiredNo
TypeInteger
Range3600–43200
Update requiresNo interruption

PolicyIds

The list of policy IDs to bind to the role. The role is granted the permissions defined in these policies.

AttributeValue
RequiredNo
TypeArray of String
Update requiresNo interruption

Principals

The principals that are allowed to assume the role. At least one principal is required.

AttributeValue
RequiredNo
TypeArray of Principals
Update requiresNo interruption

For more information, see Principals.

AssumeRolePolicyDocument

The trust policy document of the role.

AttributeValue
RequiredNo
TypeAssumeRolePolicyDocument
Update requiresNo interruption

For more information, see AssumeRolePolicyDocument.

Return Values

Ref

When you pass the logical ID of this resource to the Ref function, Ref returns the value of the Id.

Fn::GetAtt

AttributeDescription
NameThe name of the role. Used to identify the role within the account. After creation, the name cannot be changed. - minLength : 1 - maxLength : 64 - pattern : ^[a-zA-Z0-9+=,.@-_]*$
DescriptionA brief explanation or note about this role. This helps identify the purpose or usage of the role. - maxLength : 1000
AccountIdThe account ID that the role belongs to. It can only be set by an admin. When omitted, the role is created in the caller account.
MaxSessionDurationThe maximum session duration in seconds for a user who assumes the role. - minimum : 3600 - maximum : 43200 - default : 3600
PolicyIdsThe list of policy IDs to bind to the role. The role is granted the permissions defined in these policies.
PrincipalsThe principals that are allowed to assume the role. At least one principal is required.
TypeThe type of the role. - enum : [USER_DEFINED, SERVICE, SERVICE_LINKED]
CreatorNameThe name of the user who created the role.
CreatorEmailThe email of the user who created the role.
ModifierNameThe name of the user who last modified the role.
ModifierEmailThe email of the user who last modified the role.

Sample Template

Create a StackSet Admin role

Creates an Admin role for StackSet Self Managed permissions

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

Create a StackSet Execution role

Creates an Execution role for StackSet Self Managed permissions

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

Create a ServiceWatch log collection role

Creates a role for ServiceWatch log collection

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

Create a ServiceWatch Cross Account role

Creates a role for ServiceWatch to read account resources

SCPTemplateFormatVersion: '2026-01-01'
Description: 'ServiceWatch Cross Account 공유 역할 샘플'

Parameters:
  RoleName:
    Type: String
    Default: ServiceWatch-CrossAccountSharingRole
    Description: 역할 이름 (ServiceWatch-CrossAccountSharing 로 시작)
  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

Create an Object Storage read policy and role

Creates a read-only policy for an existing Object Storage bucket and a role granted the policy

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