1
0
記事投稿キャンペーン 「2024年!初アウトプットをしよう」

AWS Data Provider for SAPのアクセス許可ポリシーを作成する。SAP on AWS ハンズオン①

Last updated at Posted at 2024-01-06

ソース

技術的要件
https://docs.aws.amazon.com/sap/latest/general/data-provider-req.html#data-provider-iam-roles

PAS試験用まとめ

  • 必要な権限
    EC2:DescribeInstances→インスタンスのパラメータを一覧表示する
    EC2:DescribeVolumes→EBSボリュームのパラメータを一覧表示する
    cloudwatch:GetMetricStatistics→CloudWatchメトリクスのデータポイントを取得する
    s3:GetObject→対象のS3バケットからオブジェクトを取得する

cloudwatch:GetMetricStatisticsに関しては以下。
https://dev.classmethod.jp/articles/get-data-points-for-cloudwatch-metrics-with-api/

DescribeInstancesは単なるインスタンスの一覧ではなく、インスタンスのパラメーターなど説明要素を返してもらう、だからDescribeなんですね。

公式のレスポンス例がわかりやすいです。
https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_DescribeInstances.html#:~:text=eyJOZXh0VG9rZW4iOiBudWxsLCAiYm90b190cnVuY2F0ZV9hbW91bnQiEXAMPLE%3D%0A%26AUTHPARAMS-,%E4%BE%8B%202%3A%20%E3%82%A4%E3%83%B3%E3%82%B9%E3%82%BF%E3%83%B3%E3%82%B9%E3%81%AE%E8%AA%AC%E6%98%8E,-%E3%81%93%E3%81%AE%E4%BE%8B%E3%81%A7%E3%81%AF

ポリシーの作成

マネジメントコンソール→IAM→ポリシー→ポリシーの作成→JSON

以下貼り付けJSON。

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VisualEditor0",
            "Effect": "Allow",
            "Action": [
                "EC2:DescribeInstances",
                "cloudwatch:GetMetricStatistics",
                "EC2:DescribeVolumes"
            ],
            "Resource": "*"
        },
        {
            "Sid": "VisualEditor1",
            "Effect": "Allow",
            "Action": "s3:GetObject",
            "Resource": [
                "arn:aws:s3:::aws-sap-dataprovider-ap-northeast-1/config.properties"
            ]
        }
    ]
}

上記を貼り付けして、ポリシーの作成で完了。

次にやること

完成したポリシーをIAMロールにアタッチする。
作成したIAMロールをEC2へアタッチする。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0