AWS GovCloud での Identity Access Manager の設定

  • リリースバージョン: Australia
  • 更新日 2026年06月17日
  • 所要時間:19分
  • CloudFormation テンプレート (CFT) を使用して管理アカウントの 3 つの AWS アカウントタイプに対して AWS CloudFormation Identity Access Manager (IAM) リソースを作成し、クラウドアカウント管理 (CAM) を AWS GovCloud とServiceNow統合します。

    始める前に

    ターゲットユーザーアカウントに必要な AWS IAM 権限があることを確認します。詳細については、「Amazon Web サービス API 権限について」を参照してください。

    注:
    IAM 権限を実装するときは、常に組織のセキュリティポリシーに従ってください。

    必要なロール:AWS admin

    このタスクについて

    AWS GovCloud アカウントは常に商用アカウントにリンクされているため、IAM リソースは次の 3 つの AWS アカウントタイプにわたって作成する必要があります。

    • AWS 商用管理アカウント:GovCloud にリンクする標準 AWS アカウント。
    • AWS GovCloud ルート管理アカウント:GovCloud 環境のメインアカウント。
    • AWS GovCloud 組織管理アカウント:GovCloud 環境で組織リソースを管理するためのアカウント。

    手順

    1. 各 CloudFormation テンプレート (CFT) コードを .yml 拡張子の別のファイルにコピーし、ファイルを保存します。
    2. ルートユーザー認証情報を使用して AWS 管理コンソールにログインします。
    3. 手順に従って、各スクリプトを順番に実行します。
      1. AWS 商用管理アカウント CFT スクリプト
        1. 商用 AWS コンソールにログインします。
        2. 検索バーに「 CloudFormation 」と入力して選択し、CloudFormation コンソールにアクセスします。
        3. CloudFormation コンソールで、 スタックを作成 > 既存のテンプレートを選択 > テンプレートファイルのアップロード > ファイルを選択してください をクリックして、ローカルコンピューターからテンプレートファイルを選択します。

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

        4. 保存された商用 CFT スクリプトを使用して、 SNUserName パラメーターを設定します。
        5. 出力パラメーター SNUserARNSNUser を記録します。
        AWSTemplateFormatVersion: '2010-09-09'
        Description: This script creates a ServiceNow user in the AWS Commercial Management Account for Cloud Account Management (CAM) integration.
        
        Metadata:
          AWS::CloudFormation::Interface:
            ParameterGroups:
              - Label:
                  default: User Credentials
                Parameters:
                  - SNUserName
            ParameterLabels:
              SNUserName:
                default: User Name in the AWS Commercial environment
        
        Parameters:
          SNUserName:
            Type: String
            Description: User name for ServiceNow Cloud Workspace application in AWS Commercial Environment
            MinLength: '6'
            MaxLength: '15'
            ConstraintDescription: The username must be between 6 and 15 characters
        
        Resources:
          # AWS Commercial Resources
          SnowCWMemberAccountAccessGroup:
            Type: 'AWS::IAM::Group'
            Properties:
              GroupName: SnowCWMemberAccountAccessGroup
            Description: IAM Group for ServiceNow Cloud Workspace users with permissions to manage AWS Organizations
        
          SnowCWAccountAccessPolicy:
            Type: 'AWS::IAM::Policy'
            Properties:
              PolicyName: SnowCWAccountAccessPolicy
              PolicyDocument:
                Version: '2012-10-17'
                Statement:
                  # Create Account Workflow Permissions
                  - Sid: ServiceNowCreateAccountAccess
                    Effect: Allow
                    Action:
                      - 'budgets:CreateBudgetAction'
                      - 'budgets:DescribeBudgetAction'
                      - 'organizations:CreateGovCloudAccount'
                      - 'organizations:DescribeCreateAccountStatus'
                      - 'organizations:MoveAccount'
                      - 'organizations:TagResource'
                      - 'organizations:ListRoots'
                    Resource: '*'
                  # Account Management Workflow Permissions
                  - Sid: ServiceNowAccountManagementAccess
                    Effect: Allow
                    Action:
                      - 'budgets:ListTagsForResource'
                      - 'budgets:ModifyBudget'
                      - 'budgets:ViewBudget'
                      - 'iam:GetAccountPasswordPolicy'
                      - 'iam:GetAccountSummary'
                      - 'iam:GetRole'
                      - 'iam:ListAccountAliases'
                      - 'organizations:AttachPolicy'
                      - 'organizations:DescribePolicy'
                      - 'organizations:DetachPolicy'
                      - 'sts:AssumeRole'
                    Resource: '*'
                  # Discovery Workflow Permissions
                  - Sid: ServiceNowDiscoveryAccess
                    Effect: Allow
                    Action:
                      - 'organizations:DescribeAccount'
                      - 'organizations:DescribeOrganization'
                      - 'organizations:DescribeOrganizationalUnit'
                      - 'organizations:ListAccounts'
                      - 'organizations:ListAWSServiceAccessForOrganization'
                      - 'organizations:ListOrganizationalUnitsForParent'
                      - 'organizations:ListParents'
                      - 'organizations:ListRoots'
                      - 'organizations:ListTagsForResource'
                    Resource: '*'
              Groups:
                - !Ref SnowCWMemberAccountAccessGroup
            Description: Policy that grants permissions required for ServiceNow CAM in the AWS Commercial environment
        
          CreateServicenowUser:
            Type: 'AWS::IAM::User'
            Properties:
              Path: /
              UserName: !Ref SNUserName
              Tags:
                - Key: Purpose
                  Value: ServiceNowCAMIntegration
            Description: IAM user for ServiceNow CAM integration with AWS Commercial environment
        
          AddSnowUserToSnowCWMemberAccountAccessGroup:
            Type: 'AWS::IAM::UserToGroupAddition'
            Properties:
              GroupName: SnowCWMemberAccountAccessGroup
              Users:
                - !Ref SNUserName
            DependsOn: CreateServicenowUser
            Description: Adds the ServiceNow user to the access group
        
        Outputs:
          SNUserARN:
            Description: ARN of ServiceNow user in AWS Commercial environment
            Value: !GetAtt CreateServicenowUser.Arn
        
          SNUser:
            Description: Username of the created ServiceNow user in AWS Commercial environment
            Value: !Ref SNUserName
      2. AWS GovCloud ルート管理アカウント CFT スクリプト
        1. GovCloud AWS コンソールにログインします。
        2. 検索バーに「 CloudFormation 」と入力して選択し、CloudFormation コンソールにアクセスします。
        3. CloudFormation コンソールで、 スタックを作成 > 既存のテンプレートを選択 > テンプレートファイルのアップロード > ファイルを選択してください をクリックして、ローカルコンピューターからテンプレートファイルを選択します。
        4. 保存済みの GovCloud ルート CFT スクリプトを使用して、 SNGovUserName パラメーターを設定します。
        5. 出力パラメーター SNGovUserARNSNGovUser を記録します。
        注:

        わかりやすくするために、このテンプレートでは SnowCWGovCloudUserPolicy のリソース ARN にワイルドカード (*) を使用し、 ServiceNow ユーザーが任意の GovCloud アカウントでロールを引き受けることができるようにします。これは機能的には機能しますが、必要以上に多くの権限が付与されます。

        本番環境の場合:
        AWSTemplateFormatVersion: '2010-09-09'
        Description: This script creates a ServiceNow user in the AWS GovCloud Management Account for Cloud Account Management (CAM) integration.
        
        Metadata:
          AWS::CloudFormation::Interface:
            ParameterGroups:
              - Label:
                  default: User Credentials
                Parameters:
                  - SNGovUserName
            ParameterLabels:
              SNGovUserName:
                default: AWS User Name in the GovCloud environment
        
        Parameters:
          SNGovUserName:
            Type: String
            Description: User name for ServiceNow Cloud Workspace application in AWS GovCloud Environment
            MinLength: '6'
            MaxLength: '15'
            ConstraintDescription: The username must be between 6 and 15 characters
        
        Resources:
          # AWS GovCloud Resources
          SnowCWGovCloudAccessGroup:
            Type: 'AWS::IAM::Group'
            Properties:
              GroupName: SnowCWGovCloudAccessGroup
            Description: IAM Group for ServiceNow Cloud Workspace users in AWS GovCloud environment
        
          CreateGovCloudServicenowUser:
            Type: 'AWS::IAM::User'
            Properties:
              Path: /
              UserName: !Ref SNGovUserName
              Tags:
                - Key: Purpose
                  Value: ServiceNowCAMIntegration
            Description: IAM user for ServiceNow CAM integration with AWS GovCloud environment
        
          SnowCWGovCloudUserPolicy:
            Type: 'AWS::IAM::Policy'
            Properties:
              PolicyName: SnowCWGovCloudUserPolicy
              PolicyDocument:
                Version: '2012-10-17'
                Statement:
                  - Effect: Allow
                    Action: 'sts:AssumeRole'
                    Resource: 'arn:aws-us-gov:iam::*:role/ServiceNowGovCrossAccountRole'
                  - Effect: Allow
                    Action: 'sts:AssumeRole'
                    Resource: 'arn:aws-us-gov:iam::*:role/OrganizationAccountAccessRole'
              Groups:
                - !Ref SnowCWGovCloudAccessGroup
            Description: Policy that grants basic permissions and ability to assume the cross-account role
        
          AddSnowUserToSnowCWGovCloudAccessGroup:
            Type: 'AWS::IAM::UserToGroupAddition'
            Properties:
              GroupName: SnowCWGovCloudAccessGroup
              Users:
                - !Ref SNGovUserName
            DependsOn:
              - CreateGovCloudServicenowUser
              - SnowCWGovCloudAccessGroup
            Description: Adds the ServiceNow GovCloud user to the access group
        
        Outputs:
          SNGovUserARN:
            Description: ARN of ServiceNow user in AWS GovCloud environment
            Value: !GetAtt CreateGovCloudServicenowUser.Arn
        
          SNGovUser:
            Description: Username of the created ServiceNow user in AWS GovCloud environment
            Value: !Ref SNGovUserName
      3. AWS GovCloud 組織管理アカウント CFT スクリプト
        1. GovCloud 組織 AWS コンソールにログインします。
        2. CloudFormation コンソールにアクセスするには、検索バーに「 CloudFormation 」と入力して選択します。
        3. CloudFormation コンソールで、 スタックを作成 > 既存のテンプレートを選択 > テンプレートファイルのアップロード > ファイルを選択してください をクリックして、ローカルコンピューターからテンプレートファイルを選択します。
        4. 保存された GovCloud 組織 CFT スクリプトを使用し、 SNGovUserARN パラメーターを AWS GovCloud ルート管理アカウント CFT スクリプトから記録された出力に設定します。
        5. 出力パラメーター RoleARN を記録します。
        AWSTemplateFormatVersion: '2010-09-09'
        Description: This template creates the ServiceNowGovCrossAccountRole in the AWS Organization Management Account for ServiceNow CAM integration.
        
        Metadata:
          AWS::CloudFormation::Interface:
            ParameterGroups:
              - Label:
                  default: Role Configuration
                Parameters:
                  - SNGovUserARN
            ParameterLabels:
              SNGovUserARN:
                default: ServiceNow GovCloud User ARN
        
        Parameters:
          SNGovUserARN:
            Type: String
            Description: ARN of the ServiceNow GovCloud user that will assume this role
            AllowedPattern: '^arn:aws(-[a-z0-9-]+)?:iam::[0-9]{12}:user/.*$'
            ConstraintDescription: Must be a valid AWS IAM user ARN
        
        Resources:
          ServiceNowGovCrossAccountRole:
            Type: 'AWS::IAM::Role'
            Properties:
              RoleName: ServiceNowGovCrossAccountRole
              Description: Role used by ServiceNow CAM for cross-account operations in AWS GovCloud
              AssumeRolePolicyDocument:
                Version: '2012-10-17'
                Statement:
                  - Effect: Allow
                    Principal:
                      AWS: !Ref SNGovUserARN
                    Action: 'sts:AssumeRole'
              Policies:
                - PolicyName: ServiceNowGovCloudPolicy
                  PolicyDocument:
                    Version: '2012-10-17'
                    Statement:
                      # Create Account Workflow Permissions
                      - Sid: ServiceNowGovCreateAccountAccess
                        Effect: Allow
                        Action:
                          - 'organizations:InviteAccountToOrganization'
                          - 'organizations:ListRoots'
                          - 'organizations:MoveAccount'
                          - 'organizations:TagResource'
                        Resource: '*'
                      # Account Management Workflow Permissions
                      - Sid: ServiceNowGovAccountManagementAccess
                        Effect: Allow
                        Action:
                          - 'iam:GetAccountAuthorizationDetails'
                          - 'iam:GetAccountPasswordPolicy'
                          - 'iam:GetAccountSummary'
                          - 'iam:GetRole'
                          - 'iam:ListAccountAliases'
                          - 'organizations:AttachPolicy'
                          - 'organizations:DescribePolicy'
                          - 'organizations:DetachPolicy'
                        Resource: '*'
                      # Discovery Workflow Permissions
                      - Sid: ServiceNowGovDiscoveryAccess
                        Effect: Allow
                        Action:
                          - 'ec2:DescribeRegions'
                          - 'organizations:DescribeAccount'
                          - 'organizations:DescribeOrganization'
                          - 'organizations:DescribeOrganizationalUnit'
                          - 'organizations:ListAccounts'
                          - 'organizations:ListAWSServiceAccessForOrganization'
                          - 'organizations:ListOrganizationalUnitsForParent'
                          - 'organizations:ListParents'
                          - 'organizations:ListRoots'
                          - 'organizations:ListTagsForResource'
                        Resource: '*'
        
        Outputs:
          RoleARN:
            Description: ARN of the ServiceNowGovCrossAccountRole
            Value: !GetAtt ServiceNowGovCrossAccountRole.Arn
    4. [ 次へ ] を選択して続行し、テンプレートを検証します。
    5. [ スタックの詳細を指定 (Specify stack details )] ページで、[ スタック名 ] フィールドにテンプレートの名前を入力します。
      スタック名:
      • 大文字と小文字を区別する英数字とハイフンのみを使用できます
      • 英字で始まる必要があります
      • 128 文字以内にする必要があります
    6. [ユーザー名] フィールドに、クラウドアカウント管理サービスアカウントのユーザー名を入力します。
    7. [次へ] を選択します。
    8. [ スタックオプションの設定 ] ページで、[ AWS CloudFormation がカスタム名で IAM リソースを作成する可能性があることを承認します ] チェックボックスをオンにして、[ 次へ] を選択します。
    9. [ 確認して作成 ] ページで、[ 送信 ] を選択してスタックを起動します。
      IAM アカウントが作成されます。
    10. 作成した 2 人のユーザーのセキュリティ認証情報を追加するには:
      1. [リソース] を選択します。
      2. ユーザー名のリンクを選択します。
      3. [アクセス キー] セクションで、[ アクセス キーの作成] を選択します。
      4. [Access key best practices & alternatives] ページで、[Third-party service] オプションを選択します。

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

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