Skip to content

Commit 6b01786

Browse files
Add field s3 path to google_storage_transfer_job (#7932) (#14610)
* Add field s3 path to google_storage_transfer_job * chore: remove unnecessary variables * feat: make field optional * fix: the way to make field optional * fix: prepare awsS3Data * fix alignment Signed-off-by: Modular Magician <[email protected]>
1 parent 7923647 commit 6b01786

File tree

3 files changed

+12
-0
lines changed

3 files changed

+12
-0
lines changed

.changelog/7932.txt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
```release-note: enhancement
2+
storagetransfer: added field `path` to `transfer_spec.aws_s3_data_source` in `google_storage_transfer_job`
3+
```

google/resource_storage_transfer_job.go

+7
Original file line numberDiff line numberDiff line change
@@ -443,6 +443,11 @@ func awsS3DataSchema() *schema.Resource {
443443
Type: schema.TypeString,
444444
Description: `S3 Bucket name.`,
445445
},
446+
"path": {
447+
Optional: true,
448+
Type: schema.TypeString,
449+
Description: `S3 Bucket path in bucket to transfer.`,
450+
},
446451
"aws_access_key": {
447452
Type: schema.TypeList,
448453
Optional: true,
@@ -944,12 +949,14 @@ func expandAwsS3Data(awsS3Datas []interface{}) *storagetransfer.AwsS3Data {
944949
BucketName: awsS3Data["bucket_name"].(string),
945950
AwsAccessKey: expandAwsAccessKeys(awsS3Data["aws_access_key"].([]interface{})),
946951
RoleArn: awsS3Data["role_arn"].(string),
952+
Path: awsS3Data["path"].(string),
947953
}
948954
}
949955

950956
func flattenAwsS3Data(awsS3Data *storagetransfer.AwsS3Data, d *schema.ResourceData) []map[string]interface{} {
951957
data := map[string]interface{}{
952958
"bucket_name": awsS3Data.BucketName,
959+
"path": awsS3Data.Path,
953960
"role_arn": awsS3Data.RoleArn,
954961
}
955962
if awsS3Data.AwsAccessKey != nil {

website/docs/r/storage_transfer_job.html.markdown

+2
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,8 @@ A duration in seconds with up to nine fractional digits, terminated by 's'. Exam
211211

212212
* `bucket_name` - (Required) S3 Bucket name.
213213

214+
* `path` - (Optional) Root path to transfer objects. Must be an empty string or full path name that ends with a '/'. This field is treated as an object prefix. As such, it should generally not begin with a '/'.
215+
214216
* `aws_access_key` - (Optional) AWS credentials block.
215217

216218
* `role_arn` - (Optional) The Amazon Resource Name (ARN) of the role to support temporary credentials via 'AssumeRoleWithWebIdentity'. For more information about ARNs, see [IAM ARNs](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-arns). When a role ARN is provided, Transfer Service fetches temporary credentials for the session using a 'AssumeRoleWithWebIdentity' call for the provided role using the [GoogleServiceAccount][] for this project.

0 commit comments

Comments
 (0)