Re: WinSCP with IAM Role
@antpas: Just check Credentials from AWS environment on the Login dialog. If the machine has an IAM role, its ephemeral credentials will be retrieved.
AmazonS3FullAccess
policy to it. Obviously, for testing at some point you may want to try a different policy – AmazonS3ReadOnlyAccess
or create your own bucket-specific policy. But it's perfect to start.
aws s3 cp myfile.txt s3://mybucket/dir1/
IAmazonS3 client = new AmazonS3Client();
var request = new PutObjectRequest
{
BucketName = bucketName,
Key = objectName,
FilePath = filePath
};
var response = await client.PutObjectAsync(request);
aws
commands) to do that myself?
--profile
option of AWS CLI, e.g. like
aws s3api list-buckets --profile <profile name>
[my_temp_aws_account_credentials]
in the example) but with a particular role.
athena_access_project_x
in the example above).
role_arn
somehow?
# temporary credentials to access the AWS account for
# user role arn:aws:iam::123456789012:role/user-role-<userid>
# from here:
# https://myappcallingcognito.mydomain.com/ssocredentials
[my_temp_aws_account_credentials]
aws_access_key_id = ...
aws_secret_access_key = ...
aws_session_token = ...
[athena_access_project_x]
# user role arn:aws:iam::123456789012:role/user-role-<userid>
# needs to be set up to be able to assum efollowing role:
role_arn = arn:aws:iam::123456789012:role/project-x-read
source_profile = my_temp_aws_account_credential
region = eu-central-1
athena_access_project_x
in this example) and is connected until the credentials expire. This also allows the organisation in question to manage their users in just one directory rather than also having to manage them in AWS IAM.