Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update aws.s3.Bucket notes to point to aws.s3.BucketV2 #4491

Merged
merged 4 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions docs/resource/aws_s3_bucket_legacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ description: |-
Provides a S3 bucket resource.
---

# Resource: aws_s3_bucket
# Resource: aws.s3.Bucket

Provides a S3 bucket resource.

-> This functionality is for managing S3 in an AWS Partition. To manage [S3 on Outposts](https://docs.aws.amazon.com/AmazonS3/latest/dev/S3onOutposts.html), see the `aws_s3control_bucket` resource.

-> **NOTE:** This resource might not work well if using an alternative s3-compatible provider. Please use `aws.s3.BucketV2` instead.
-> **NOTE:** Please use [aws.s3.BucketV2](https://www.pulumi.com/registry/packages/aws/api-docs/s3/bucketv2) instead.
This resource is maintained for backwards compatibility only. Please see [BucketV2 Migration
Guide](https://www.pulumi.com/registry/packages/aws/how-to-guides/bucketv2-migration/) for instructions on migrating
existing Bucket resources to BucketV2.

## Example Usage

Expand Down
200 changes: 100 additions & 100 deletions provider/cmd/pulumi-resource-aws/schema.json

Large diffs are not rendered by default.

10 changes: 10 additions & 0 deletions provider/doc_edits.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,3 +250,13 @@ func findLine(src []byte, i int) (int, int) {
}
return start, end + 1
}

// Attempts to read the contents of a given file but returns an empty array in case of failure. This is useful for
// overriding documentation files at generation time only.
func maybeReadFile(filePath string) []byte {
fileBytes, err := os.ReadFile(filePath)
if err != nil {
return nil
}
return fileBytes
}
2 changes: 1 addition & 1 deletion provider/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -3756,7 +3756,7 @@ compatibility shim in favor of the new "name" field.`)
Transform: tfbridge.TransformJSONDocument,
},
},
Docs: &tfbridge.DocInfo{Source: "../../../../docs/resource/aws_s3_bucket_legacy.md"},
Docs: &tfbridge.DocInfo{Markdown: maybeReadFile("docs/resource/aws_s3_bucket_legacy.md")},
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix to the silently ignored source here.

},
"aws_s3_bucket_inventory": {Tok: awsResource(s3Mod, "Inventory")},
"aws_s3_bucket_metric": {Tok: awsResource(s3Mod, "BucketMetric")},
Expand Down
Loading
Loading