IAM Identity Center 認証の Athena ワークグループを作成する際に「Value '' at 'configuration.identityCenterConfiguration.identityCenterInstanceArn' failed to satisfy constraint: Member must satisfy regular expression pattern ...」が発生する際の対応方法
いわさです。
IAM Identity Center を使うと、その認証コンテキストを介していくつかの AWS サービスの認証制御に使うことが出来ます。
対応しているサービスのひとつに Athena がありまして、ワークグループ作成時に認証方法として IAM Identity Center を選択します。
今回このワークグループを作成しようとしてエラーが発生したので解決策を探しました。その様子を紹介します。
ワークグループ作成時のエラーが発生
しかし、本日時点でこのワークグループをマネジメントコンソールから作成する際に次のエラーが発生することがあります。
ワークグループ の作成中にエラーが発生しました
1 validation error detected: Value '' at 'configuration.identityCenterConfiguration.identityCenterInstanceArn' failed to satisfy constraint: Member must satisfy regular expression pattern: ^arn:(aws|aws-us-gov|aws-cn|aws-iso|aws-iso-b):sso:::instance/(sso)?ins-[a-zA-Z0-9-.]{16}$
CloudTrail の Athena ワークグループ作成イベントを確認してみると、次のようにconfiguration.identityCenterConfiguration.identityCenterInstanceArn
は設定されているのですが、うまく作成出来ていません。
{
:
"eventSource": "athena.amazonaws.com",
"eventName": "CreateWorkGroup",
"awsRegion": "ap-northeast-1",
"errorCode": "InvalidRequestException",
"errorMessage": "Misconfigured service role. Make sure that athena.amazonaws.com has been allowed for sts:AssumeRole and sts:SetContext.",
"requestParameters": {
"name": "hoge0713athena",
"configuration": {
"resultConfiguration": {
"outputLocation": "s3://hoge0713athena/"
},
"enforceWorkGroupConfiguration": true,
"publishCloudWatchMetricsEnabled": false,
"bytesScannedCutoffPerQuery": 1099511627776000,
"requesterPaysEnabled": false,
"engineVersion": {
"selectedEngineVersion": "AUTO"
},
"identityCenterConfiguration": {
"enableIdentityCenter": true,
"identityCenterInstanceArn": "arn:aws:sso:::instance/ssoins-7758571eb0e448d1"
},
"executionRole": "arn:aws:iam::123456789012:role/service-role/AWSAthenaSQLRole-kq1r5ywy",
"enableMinimumEncryptionConfiguration": false,
"queryResultsS3AccessGrantsConfiguration": {
"enableS3AccessGrants": true,
"createUserLevelPrefix": false,
"authenticationType": "DIRECTORY_IDENTITY"
}
},
"description": "hoge0713athena"
},
"responseElements": null,
:
}
コンソールの言語を日本語に変更する
私が確認した限りでは、CloudTrail のエラーメッセージとコンソール上表示されるメッセージが異なっており、コンソールで出力されたメッセージは確認出来ません。
色々試してみたのですが、どうやら本日時点では日本語版のコンソールだとうまく機能しないようです。
英語版コンソールに変更することでワークグループの作成が出来ました。
次のように認証が IAM Identity Center のワークグループを作成出来ました。
作成に成功した場合でもリクエストパラメータは先程と同じです。
{
:
"eventSource": "athena.amazonaws.com",
"eventName": "CreateWorkGroup",
"awsRegion": "ap-northeast-1",
"requestParameters": {
"name": "hoge0713athena",
"configuration": {
"resultConfiguration": {
"outputLocation": "s3://hoge0713athena/"
},
"enforceWorkGroupConfiguration": true,
"publishCloudWatchMetricsEnabled": false,
"bytesScannedCutoffPerQuery": 1099511627776000,
"requesterPaysEnabled": false,
"engineVersion": {
"selectedEngineVersion": "AUTO"
},
"identityCenterConfiguration": {
"enableIdentityCenter": true,
"identityCenterInstanceArn": "arn:aws:sso:::instance/ssoins-7758571eb0e448d1"
},
"executionRole": "arn:aws:iam::123456789012:role/service-role/AWSAthenaSQLRole-kq1r5ywy",
"enableMinimumEncryptionConfiguration": false,
"queryResultsS3AccessGrantsConfiguration": {
"enableS3AccessGrants": true,
"createUserLevelPrefix": false,
"authenticationType": "DIRECTORY_IDENTITY"
}
},
"description": "hoge0713athena"
},
"responseElements": null,
:
}
さいごに
本日は IAM Identity Center 認証の Athena ワークグループを作成する際に「Value '' at 'configuration.identityCenterConfiguration.identityCenterInstanceArn' failed to satisfy constraint: Member must satisfy regular expression pattern ...」が発生したので対処方法を探してみました。
いずれ修正される可能性はありますが、同じエラーメッセージでワークグループが作成できない際にはお試しください。