github.com/aavshr/aws-sdk-go@v1.41.3/example/service/s3/usingPrivateLink/README.md (about) 1 # Example 2 3 This example demonstrates how you can use the AWS SDK for Go's Amazon S3 client 4 to use AWS PrivateLink for Amazon S3. 5 6 # Usage 7 8 To access S3 bucket data using the s3 interface endpoints, prefix the vpc 9 endpoint with `bucket`. For eg, use endpoint url as `https://bucket.vpce-0xxxxxxx-xxx8xxg.s3.us-west-2.vpce.amazonaws.com` 10 to access S3 bucket data via the associated vpc endpoint. The SDK may mutate 11 this endpoint as per the input provided to work with ARNs. 12 13 To access S3 access point data using the s3 interface endpoints, prefix the vpc 14 endpoint with `accesspoint`. For eg, use endpoint url as `https://accesspoint.vpce-0xxxxxxx-xxxx8xxg.s3.us-west-2.vpce.amazonaws.com` 15 to access S3 access point data via the associated vpc endpoint. The SDK may 16 mutate this endpoint as per the input provided to work with ARNs. 17 18 To work with S3 control using the s3 interface endpoints, prefix the vpc endpoint 19 with `control`. For eg, use endpoint url as `https://control.vpce-0xxxxxxx-xxx8xxg.s3.us-west-2.vpce.amazonaws.com` 20 to use S3 Control operations with the associated vpc endpoint. The SDK may mutate 21 this endpoint as per the input provided to work with ARNs. 22 23 The example will create s3 client's that use appropriate vpc endpoint url. The example 24 will then create a bucket of the name provided in code. Replace the value of 25 the `accountID` const with the account ID for your AWS account. The 26 `vpcBucketEndpointUrl`, `vpcAccesspointEndpoint`, `vpcControlEndpoint`, `bucket`, 27 `keyName`, and `accessPoint` const variables need to be updated to match the name 28 of the appropriate vpc endpoint, Bucket, Object Key, and Access Point that will be 29 created by the example. 30 31 ```sh 32 AWS_REGION=<region> go run -tags example usingPrivateLink.go 33 ```