Manjunath Rao
Manjunath Rao

Reputation: 1511

Convert String to <S3Uri>

I am working on a PowerShell script, which calls AWS CLI commands. I am using the below Sync command, however the command expects the bucket name as <S3Uri>. The script will get the bucket in the form of String. Can anyone please tell me how to convert String type to <S3Uri> type. It has to be either a Powershell cmdlet or AWS CLI command.

Command:

aws --endpoint-url $endpoint s3 sync $InputPath $BucketName --profile test

Upvotes: 1

Views: 5844

Answers (1)

John Rotenstein
John Rotenstein

Reputation: 269666

An S3Uri simply looks like:

s3://bucket-name/path/object.txt

By the way, it is rare that you will need to use --endpoint-url. You should typically use --region. It is mostly used when pointing to an S3-compatible service, such as a local Snowball device.

Upvotes: 7

Related Questions