AWS での ServiceNowユーザーのIdentity Access Managerアカウントの設定

  • リリースバージョン: Australia
  • 更新日 2026年03月12日
  • 所要時間:7分
  • CloudFormation テンプレート (CFT) を使用して管理アカウントに AWS CloudFormation Identity Access Manager (IAM) ユーザーを作成し、一元化された IAM ユーザーで複数の AWS アカウントを管理できるようにします。

    始める前に

    • 必要なロール:adminAWS
    • ServiceNow IAM ユーザーアカウントには、基本的な操作を実行するために特定の AWS IAM 権限が必要です。権限の詳細については、「 Amazon Web サービス API 権限について」を参照してください。

    手順

    1. AWS管理コンソールにログインし、検索バーに「CloudFormation」と入力して選択します。
    2. CloudFormation コンソールで、[スタックの作成] を選択します。

      スタックは、単一のユニットとして管理できる AWS リソースのコレクションです。

    3. CloudFormation テンプレート (CFT) コードをファイルにコピーして、ファイルを保存します。

      ファイル拡張子は .yml にする必要があります。たとえば、CreateServiceNowUser.yml などです。

      AWSTemplateFormatVersion: '2010-09-09'
      Description: This script is executed in Management Account where the  ServiceNow user is created.
      
      Metadata:
        AWS::CloudFormation::Interface:
          ParameterGroups:
            - Label:
                default: User Credentials
              Parameters:
                - SNUserName
          ParameterLabels:
            SNUserName:
              default: User Name
      
      Parameters:
        SNUserName:
          Type: String
          Description: User name for CW Service Account user
          MinLength: '6'
          MaxLength: '15'
          ConstraintDescription: The username must be between 6 and 15 characters
      
      Resources:
        SnowCWMemberAccountAccessGroup:
          Type: 'AWS::IAM::Group'
          Properties:
            GroupName: SnowCWMemberAccountAccessGroup
      
        SnowCWAccountAccessPolicy:
          Type: 'AWS::IAM::Policy'
          Properties:
            PolicyName: SnowCWAccountAccessPolicy
            PolicyDocument:
              Statement:
                - Sid: ServiceNowCWUserAccess
                  Effect: Allow
                  Action:
                    - 'organizations:ListRoots'
                    - 'organizations:ListTagsForResource'
                    - 'organizations:DescribeAccount'
                    - 'organizations:CreateAccount'
                    - 'organizations:ListAWSServiceAccessForOrganization'
                    - 'organizations:TagResource'
                    - 'organizations:ListAccounts'
                    - 'organizations:ListRoots'
                    - 'organizations:ListTagsForResource'
                    - 'organizations:DescribeAccount'
                    - 'organizations:CreateAccount'
                    - 'organizations:ListAWSServiceAccessForOrganization'
                    - 'organizations:TagResource'
                    - 'organizations:ListAccounts'
                    - 'organizations:CloseAccount'
                    - 'organizations:DescribeOrganization'
                    - 'organizations:DescribeOrganizationalUnit'
                    - 'organizations:ListParents'
                    - 'organizations:ListOrganizationalUnitsForParent'
                    - 'organizations:MoveAccount'
                    - 'organizations:DescribeCreateAccountStatus'
                    - 'organizations:AttachPolicy'
                    - 'organizations:DescribePolicy'
                    - 'organizations:ListAccounts'
                    - 'budgets:CreateBudgetAction'
                    - 'budgets:ModifyBudget'
                    - 'budgets:ViewBudget'
                    - 'budgets:ListTagsForResource'
                    - 'iam:GetAccountSummary'
                    - 'iam:GetAccountPasswordPolicy'
                    - 'budgets:DescribeBudgetAction'
                    - 'iam:ListAccountAliases'
                    - 'sts:AssumeRole'
                    - 'iam:GetRole'
                    - 'iam:ListAccountAliases'
                    - 'iam:GetAccountPasswordPolicy'
                    - 'organizations:DetachPolicy'
                    - 'iam:GetAccountAuthorizationDetails'              
                  Resource: '*'
            Groups:
              - !Ref SnowCWMemberAccountAccessGroup
      
        CreateServicenowUser:
          Type: 'AWS::IAM::User'
          Properties:
            Path: /
            UserName: !Ref SNUserName
        AddSnowUserToSnowCWMemberAccountAccessGroup:
          Type: 'AWS::IAM::UserToGroupAddition'
          Properties:
            GroupName: SnowCWMemberAccountAccessGroup
            Users:
              - !Ref SNUserName
          DependsOn: CreateServicenowUser
      
      Outputs:
        ServiceNowUserARN:
          Description: ARN of ServiceNow user
          Value: !GetAtt 
            - CreateServicenowUser
            - Arn
      
        ServiceNowUser:
          Description: ServiceNow user
          Value: !Ref SNUserName
      
    4. [ スタックの作成 ] ページで、 既存のテンプレートを選択 > テンプレートファイルのアップロード > ファイルを選択してください をクリックして、ローカルコンピューターからテンプレートファイルを選択します。
    5. [次へ] を選択して続行し、テンプレートを検証します。
    6. [スタックの詳細を指定] ページで、[スタック名] フィールドに CloudFormation スタック名を入力します。

      スタック名は、スタックのリストから特定のスタックを見つけるのに役立つ識別子です。スタック名には、英数字 (大文字と小文字が区別) とハイフンのみを含めることができます。英字で始める必要があり、128 文字を超えることはできません。

    7. [ユーザー名] フィールドに、クラウドアカウント管理サービスアカウントのユーザー名を入力します。
    8. [次へ] を選択して続行します。
    9. [ スタックオプションの設定 ] ページで、[ AWS CloudFormation がカスタム名で IAM リソースを作成する可能性があることを承認します ] チェックボックスをオンにして、[ 次へ] を選択します。
    10. [ 確認して作成 ] ページで、[ 送信 ] を選択してスタックを起動します。
      IAM アカウントが作成されます。
    11. セキュリティ認証情報を追加するには:
      1. [リソース] を選択します。
      2. ユーザー名のリンクを選択します。
      3. [アクセス キー] セクションで、[ アクセス キーの作成] を選択します。
      4. [Access key best practices & alternatives] ページで、[Third-party service] オプションを選択します。

        このアクセスキーを使用して、 AWS リソースを監視または管理するサードパーティのアプリケーションまたはサービスのアクセスを有効にすることを計画しています。

      5. [上記の推奨事項を理解し、アクセス キーの作成に進みます] チェック ボックスをオンにして、[次へ] を選択します。
      6. [アクセスキーを作成 (Create access key)] を選択します。
      7. [ アクセス キーの確認 ] ページで、アクセス キー ファイルをダウンロードし、 [完了] を選択します。
        注:
        アクセスキーと秘密キーを Terraform アドミンおよび ServiceNow AI Platform アドミンと共有します。

    次のタスク

    サービスコントロールポリシーを使用して AWS アカウントの一時停止を設定する