What IAM policies were used for the AWS Transfer Family managed workflows video tutorial?

0

What IAM policies can be used to replicate the two demos in AWS Transfer Family Managed Workflows Demo | Amazon Web Services?

AWS
blayze
已提問 2 年前檢視次數 637 次
1 個回答
0
已接受的答案

The following IAM policies can be used for the video's demo's AWS Transfer Family workflow execution roles. For more information, read Construct an execution role for workflows , and create an IAM role with a trust policy for transfer.amazonaws.com.

Demo 1

This demo covers AWS Transfer Family copy and tag steps. The workflow copies an object to an archive bucket and tags the object. Copy requires reading from the source bucket, writing to the destination bucket, and HeadObject access. Tagging requires two actions since the S3 bucket has versioning enabled, and can be limited to a condition with the specific tag the workflow is applying. If doing this in your environment, ensure your IAM policy resources are set to the most restrictive for your workflow.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "CopyRead",
            "Effect": "Allow",
            "Action": [
                "s3:GetObject",
                "s3:GetObjectTagging"
            ],
            "Resource": "arn:${Partition}:s3:::${SourceBucketName}/${ObjectName}"
        },
        {
            "Sid": "CopyWrite",
            "Effect": "Allow",
            "Action": [
                "s3:PutObject",
                "s3:PutObjectTagging"
            ],
            "Resource": "arn:${Partition}:s3:::${DestinationBucketName}/${ObjectName}"
        },
        {
            "Sid": "CopyList",
            "Effect": "Allow",
            "Action": "s3:ListBucket",
            "Resource": [
                "arn:${Partition}:s3:::${SourceBucketName}",
                "arn:${Partition}:s3:::${DestinationBucketName}"
            ]
        },
        {
            "Sid": "Tag",
            "Effect": "Allow",
            "Action": [
                "s3:PutObjectTagging",
                "s3:PutObjectVersionTagging"
            ],
            "Resource": "arn:${Partition}:s3:::${DestinationBucketName}/${ObjectName}",
            "Condition": {
                "StringEquals": {
                    "s3:RequestObjectTag/Archive": "yes"
                }
            }
        }
    ]
}

Demo 2

This demo covers AWS Transfer Family workflow custom and delete steps. The workflow invokes an AWS Lambda function, then deletes the S3 object, and has a custom step as an exception handler. It requires s3:DeleteObject access and lambda:InvokeFunction access for the two AWS Lambda functions. If doing this in your environment, ensure your IAM policy resources are set to the most restrictive for your workflow.

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "Delete",
            "Effect": "Allow",
            "Action": [
                "s3:DeleteObject"
            ],
            "Resource": "arn:${Partition}:s3:::${BucketName}/${ObjectName}"
        },
        {
            "Sid": "Custom",
            "Effect": "Allow",
            "Action": [
                "lambda:InvokeFunction"
            ],
            "Resource": [
                "arn:${Partition}:lambda:${Region}:${Account}:function:${FunctionName}",
                "arn:${Partition}:lambda:${Region}:${Account}:function:${FunctionName}"
            ]
        }
    ]
}
AWS
blayze
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南