Hi All,

Looking for some help enabling cross account communication within Nifi!

My goal: There are files stored from CloudTrail in an S3 bucket in VPC B. My 
Nifi machines are in VPC A. I want Nifi to be able to get those files from VPC 
B. VPC A and VPC B need to be communicating in the FetchS3Object component.

See this link for some additional info: 
http://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-sharing-logs-assume-role.html

I have communication working manually on the Nifi machines in VPC A when I use 
the AWS CLI. The process is as follows:

1.     Run sts -assume-role on my Nifi machine (VPC A) to assume a role I've 
created in VPC B that is configured to have access to the S3 bucket in VPC B.

2.     This will generate temporary keys that need to be refreshed every hour. 
There is no way to have assume role create permanent keys. Export the keys as 
environment variables.

3.     Set up ~/.aws/config to have a profile "crossaccountrole" that connects 
to the arn of the role created in VPC B.

4.     Run the following command --> "aws s3 cp s3://<object path> <object name 
locally> --profile crossaccountrole"

Most importantly, if I ever try to run this without the --profile flag, then it 
will not allow me to download the file.  It seems like perhaps to get it to 
work with Nifi I need a place to pass in the profile that needs to be used in 
order for the communication to work.

I've been trying to implement this in Nifi. Within the FetchS3Object, I have 
created an AWSCredentialsProviderService which has the following properties:

·      Access Key: VPC A access key

·      Secret Key: VPC A secret key

·      Assume Role ARN: VPC B role

·      Assume Role Session Name: crossaccountrole

·      Session Time: 3600
The general properties in the FetchS3Object are as follows:

·      Bucket: VPC B bucket name

·      Object: Filename of VPC B bucket object

·      Access Key: VPC A access key

·      Secret Key: VPC A secret key

·      AWS Credentials Provider Service: <see above>

However, when this tries to run I get Access Denied. I've been going through 
the source code for Nifi and I'm not sure if short-lived tokens get passed 
through. Can anyone please provide me some guidance or suggestions on how to 
get this to work? :)

Best,
Keren
________________________________________________________

The information contained in this e-mail is confidential and/or proprietary to 
Capital One and/or its affiliates and may only be used solely in performance of 
work or services for Capital One. The information transmitted herewith is 
intended only for use by the individual or entity to which it is addressed. If 
the reader of this message is not the intended recipient, you are hereby 
notified that any review, retransmission, dissemination, distribution, copying 
or other use of, or taking of any action in reliance upon this information is 
strictly prohibited. If you have received this communication in error, please 
contact the sender and delete the material from your computer.

Reply via email to