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

Fix s3 example URLs in the artifacts docs #15123

Merged
merged 2 commits into from Nov 7, 2022
Merged

Fix s3 example URLs in the artifacts docs #15123

merged 2 commits into from Nov 7, 2022

Conversation

ghost
Copy link

@ghost ghost commented Nov 3, 2022

Unfortunately, s3 urls prefixed with https:// do NOT work with the underlying go-getter library. As such, this fixes the examples so that they are working examples that won't cause problems for people reading the docs.

This is a known limitation of the go-getter lib since at least 2016 per #1113

I've also put up a PR with the underlying go-getter lib to fix their docs as well: hashicorp/go-getter#394

Unfortunately, s3 urls prefixed with https:// do NOT work with the underlying go-getter library. As such, this fixes the examples so that they are working examples that won't cause problems for people reading the docs.
See discussion in #1113 circa 2016.
Copy link
Contributor

@lgfa29 lgfa29 left a comment

Choose a reason for hiding this comment

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

Thanks for the fix @twunderlich-grapl!

Per your findings and existing documentation ("non-Amazon S3-compatible endpoints like Minio are supported, but you must explicitly set the "s3::" prefix.") using the explicit s3:// protocol may be the example that is most likely to work in different scenarios.

How do you feel about setting it in the docs?

@@ -210,7 +210,7 @@ This example uses path-based notation on a publicly-accessible bucket:

```hcl
artifact {
source = "https://my-bucket-example.s3-us-west-2.amazonaws.com/my_app.tar.gz"
source = "my-bucket-example.s3-us-west-2.amazonaws.com/my_app.tar.gz"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
source = "my-bucket-example.s3-us-west-2.amazonaws.com/my_app.tar.gz"
source = "s3://my-bucket-example.s3-us-west-2.amazonaws.com/my_app.tar.gz"

Copy link
Author

Choose a reason for hiding this comment

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

I've updated this in a follow-up commit

@@ -240,7 +240,7 @@ Alternatively you can use virtual hosted style:

```hcl
artifact {
source = "https://my-bucket-example.s3-eu-west-1.amazonaws.com/my_app.tar.gz"
source = "my-bucket-example.s3-eu-west-1.amazonaws.com/my_app.tar.gz"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
source = "my-bucket-example.s3-eu-west-1.amazonaws.com/my_app.tar.gz"
source = "s3://my-bucket-example.s3-eu-west-1.amazonaws.com/my_app.tar.gz"

Copy link
Author

Choose a reason for hiding this comment

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

I've updated this in a follow-up commit

Per the discussion in #15123,
we're going to use the explicit s3 protocol in the examples since that
is the likeliest to work in all scenarios
@ghost ghost requested a review from lgfa29 November 7, 2022 15:06
@ghost
Copy link
Author

ghost commented Nov 7, 2022

@lgfa29,
I've updated the example based on your suggestion. I agree that its the most likely way to avoid confusion since it will have an explicit protocol.

Copy link
Contributor

@lgfa29 lgfa29 left a comment

Choose a reason for hiding this comment

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

Awesome, thanks!

@github-actions
Copy link

github-actions bot commented Mar 8, 2023

I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport/website This will backport PR changes to `stable-website` && the latest release-branch backport/1.0.x backport to 1.0.x release line backport/1.1.x backport to 1.1.x release line backport/1.2.x backport to 1.1.x release line backport/1.3.x backport to 1.3.x release line backport/1.4.x backport to 1.4.x release line
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants