Configure CloudWatch logging role
To set access, you create a resource-based IAM policy and an IAM role that provides that access information.
To enable Amazon CloudWatch logging, you start by creating an IAM policy that enables CloudWatch logging. You then create an IAM role and attach the policy to it. You can do this when you are creating a server or by editing an existing server. For more information about CloudWatch, see What is Amazon CloudWatch? and What is Amazon CloudWatch logs? in the Amazon CloudWatch User Guide.
Use the following example IAM policies to allow CloudWatch logging.
You then create a role and attach the CloudWatch Logs policy that you created.
To create an IAM role and attach a policy
-
In the navigation pane, choose Roles, and then choose Create role.
On the Create role page, make sure that AWS service is chosen.
-
Choose Transfer from the service list, and then choose Next: Permissions. This establishes a trust relationship between AWS Transfer Family and the IAM role. Additionally, add
aws:SourceAccount
andaws:SourceArn
condition keys to protect yourself against the confused deputy problem. See the following documentation for more details:-
Procedure for establishing a trust relationship with AWS Transfer Family: To establish a trust relationship
-
Description for confused deputy problem: the confused deputy problem
-
-
In the Attach permissions policies section, locate and choose the CloudWatch Logs policy that you just created, and choose Next: Tags.
-
(Optional) Enter a key and value for a tag, and choose Next: Review.
-
On the Review page, enter a name and description for your new role, and then choose Create role.
-
To view the logs, choose the Server ID to open the server configuration page, and choose View logs. You are redirected to the CloudWatch console where you can see your log streams.
On the CloudWatch page for your server, you can see records of user authentication (success
and failure), data uploads (PUT
operations), and data downloads
(GET
operations).