での ServiceNow ユーザーのIdentity Access Managerアカウントの設定 AWS
CloudFormation テンプレート (CFT) を使用して管理アカウントに AWS CloudFormation Identity Access Manager (IAM) ユーザーを作成し、一元化された IAM ユーザーで複数の AWS アカウントを管理できるようにします。
始める前に
- 必要なロール:AWS アドミン
-
ServiceNow IAM ユーザーアカウントには、基本的な操作を実行するために特定の AWS IAM 権限が必要です。権限の詳細については、「 Amazon Web サービス API 権限について」を参照してください。
手順
- AWS管理コンソールにログインし、検索バーに「CloudFormation」と入力して選択します。
-
CloudFormation コンソールで、[スタックの作成] を選択します。
スタックは、単一のユニットとして管理できる AWS リソースのコレクションです。
-
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 - [ スタックの作成 ] ページで、 既存のテンプレートを選択 > テンプレートファイルのアップロード > ファイルを選択してください をクリックして、ローカルコンピューターからテンプレートファイルを選択します。
- [次へ] を選択して続行し、テンプレートを検証します。
-
[スタックの詳細を指定] ページで、[スタック名] フィールドに CloudFormation スタック名を入力します。
スタック名は、スタックのリストから特定のスタックを見つけるのに役立つ識別子です。スタック名には、英数字 (大文字と小文字が区別) とハイフンのみを含めることができます。英字で始める必要があり、128 文字を超えることはできません。
- [ユーザー名] フィールドに、クラウドアカウント管理サービスアカウントのユーザー名を入力します。
- [次へ] を選択して続行します。
- [ スタックオプションの設定 ] ページで、[ AWS CloudFormation がカスタム名で IAM リソースを作成する可能性があることを承認します ] チェックボックスをオンにして、[ 次へ] を選択します。
-
[ 確認して作成 ] ページで、[ 送信 ] を選択してスタックを起動します。
IAM アカウントが作成されます。
-
セキュリティ認証情報を追加するには:
- [リソース] を選択します。
- ユーザー名のリンクを選択します。
- [アクセス キー] セクションで、[ アクセス キーの作成] を選択します。
-
[Access key best practices & alternatives] ページで、[Third-party service] オプションを選択します。
このアクセスキーを使用して、 AWS リソースを監視または管理するサードパーティのアプリケーションまたはサービスのアクセスを有効にすることを計画しています。
- [上記の推奨事項を理解し、アクセス キーの作成に進みます] チェック ボックスをオンにして、[次へ] を選択します。
- [アクセスキーを作成 (Create access key)] を選択します。
-
[ アクセス キーの確認 ] ページで、アクセス キー ファイルをダウンロードし、 [完了] を選択します。
注:アクセスキーと秘密キーを Terraform アドミンおよび ServiceNow AI Platform アドミンと共有します。