AWS S3Client with AWS Direct Connect #2691
-
Hello Forum, We have existing code that connects to AWS S3 and backs up data. Our current implementation uses the Aws::Client::ClientConfiguration class to specify things such as region, scheme and so on. Is it possible to configure our client to use an AWS Direct Connect link? Apologies for being so vague but I've only learnt of the existence of AWS Direct Connect today. Thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 2 replies
-
Hello @pcaswell , Thank you very much for your submission. Best regards, Yasmine |
Beta Was this translation helpful? Give feedback.
-
Hello Yasmine, Thank you very much for your reply. I think the use case we are thinking of is the "Use a private IP address over Direct Connect (with an interface VPC endpoint)" listed in your link. If I understand that correctly we'd do the following:
So it looks as though we should be able to set region to whatever we need (we do this already) and set the endpointOverride value to the VPC endpoint. Does this sound right to you? |
Beta Was this translation helpful? Give feedback.
-
@github-actions proposed-answer Thank you very much for your answer. If you take a look at the java v2 example: Region region = Region.US_EAST_1;
s3Client = S3Client.builder().region(region)
.endpointOverride(URI.create("https://bucket.vpce-1a2b3c4d-5e6f.s3.us-east-1.vpce.amazonaws.com"))
.build(); The equivalent using the CPP SDK would be as follow: Aws::Client::ClientConfiguration clientConfig;
clientConfig.endpointOverride("bucket.vpce-1a2b3c4d-5e6f.s3.us-east-1.vpce.amazonaws.com");
clientConfig.region = "us-east-1";
clientConfig.
Aws::S3::S3Client(clientConfig); Does everything works on your end or do you have any further questions? Best regards, Yasmine |
Beta Was this translation helpful? Give feedback.
-
I have no further questions. We haven't made this work yet we just wanted to be sure it was possible before investing time and effort into it. Many thanks for your help. Paul |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
@github-actions proposed-answer
Hello @pcaswell ,
Thank you very much for your answer.
Yes this looks right. There are actually samples provided in Java and python here: https://docs.aws.amazon.com/AmazonS3/latest/userguide/privatelink-interface-endpoints.html#privatelink-aws-sdk-examples (which I am assuming is the documentation you are referring to, just linking here for context in case someone else is searching for this) the process is quite similar for the CPP SDK.
If you take a look at the java v2 example: