-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Dotnetv4: Add CreatePresignedPost in S3 #7536
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
Merged
Merged
Changes from 19 commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
b8064bb
Add CreatePresignedPost examples for dotnetv4
GarrettBeatty 4cc7533
update console
GarrettBeatty a7b2ae6
add snippets
GarrettBeatty eebb399
remove extra
GarrettBeatty 2a0781e
update examples
GarrettBeatty b01250a
fix readme
GarrettBeatty e1e2f42
update metadata
GarrettBeatty fc789b4
Add gen ai tag
GarrettBeatty b96731f
update names
GarrettBeatty 0cd7322
update files
GarrettBeatty 14002c8
update metadata
GarrettBeatty a413e7e
Fix snippets
GarrettBeatty 47df32f
pr comments
GarrettBeatty 6cc06d5
add httpfactory
GarrettBeatty 21a8d2d
fix lint
GarrettBeatty 0d6e34b
update readme
GarrettBeatty 65cc86f
remove extra whitespace
GarrettBeatty 4c230d3
dotnet format
GarrettBeatty 2e576cc
dotnet format
GarrettBeatty 632f162
remove console log for response body
GarrettBeatty cd2fdad
fix solution
GarrettBeatty File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
# Amazon S3 code examples for the SDK for .NET (v4) | ||
|
||
## Overview | ||
|
||
Shows how to use the AWS SDK for .NET (v4) to work with Amazon Simple Storage Service (Amazon S3). | ||
|
||
<!--custom.overview.start--> | ||
<!--custom.overview.end--> | ||
|
||
_Amazon S3 is storage for the internet. You can use Amazon S3 to store and retrieve any amount of data at any time, from anywhere on the web._ | ||
|
||
## ⚠ Important | ||
|
||
* Running this code might result in charges to your AWS account. For more details, see [AWS Pricing](https://aws.amazon.com/pricing/) and [Free Tier](https://aws.amazon.com/free/). | ||
* Running the tests might result in charges to your AWS account. | ||
* We recommend that you grant your code least privilege. At most, grant only the minimum permissions required to perform the task. For more information, see [Grant least privilege](https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html#grant-least-privilege). | ||
* This code is not tested in every AWS Region. For more information, see [AWS Regional Services](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services). | ||
|
||
<!--custom.important.start--> | ||
<!--custom.important.end--> | ||
|
||
## Code examples | ||
|
||
### Prerequisites | ||
|
||
For prerequisites, see the [README](../README.md#Prerequisites) in the `dotnetv4` folder. | ||
|
||
|
||
<!--custom.prerequisites.start--> | ||
<!--custom.prerequisites.end--> | ||
|
||
### Single actions | ||
|
||
Code excerpts that show you how to call individual service functions. | ||
|
||
- [CreatePresignedPost](Scenarios/S3_CreatePresignedPost/S3Wrapper.cs#L35) | ||
|
||
### Scenarios | ||
|
||
Code examples that show you how to accomplish a specific task by calling multiple | ||
functions within the same service. | ||
|
||
- [Create a presigned URL](Scenarios/S3_CreatePresignedPost/CreatePresignedPostBasics.cs) | ||
|
||
|
||
<!--custom.examples.start--> | ||
<!--custom.examples.end--> | ||
|
||
## Run the examples | ||
|
||
### Instructions | ||
|
||
|
||
<!--custom.instructions.start--> | ||
<!--custom.instructions.end--> | ||
|
||
|
||
|
||
#### Create a presigned URL | ||
|
||
This example shows you how to create a presigned URL for Amazon S3 and upload an object. | ||
|
||
|
||
<!--custom.scenario_prereqs.s3_Scenario_PresignedUrl.start--> | ||
<!--custom.scenario_prereqs.s3_Scenario_PresignedUrl.end--> | ||
|
||
|
||
<!--custom.scenarios.s3_Scenario_PresignedUrl.start--> | ||
<!--custom.scenarios.s3_Scenario_PresignedUrl.end--> | ||
|
||
### Tests | ||
|
||
⚠ Running tests might result in charges to your AWS account. | ||
|
||
|
||
To find instructions for running these tests, see the [README](../README.md#Tests) | ||
in the `dotnetv4` folder. | ||
|
||
|
||
|
||
<!--custom.tests.start--> | ||
<!--custom.tests.end--> | ||
|
||
## Additional resources | ||
|
||
- [Amazon S3 User Guide](https://docs.aws.amazon.com/AmazonS3/latest/userguide/Welcome.html) | ||
- [Amazon S3 API Reference](https://docs.aws.amazon.com/AmazonS3/latest/API/Welcome.html) | ||
- [SDK for .NET (v4) Amazon S3 reference](https://docs.aws.amazon.com/sdkfornet/v4/apidocs/items/S3/NS3.html) | ||
|
||
<!--custom.resources.start--> | ||
<!--custom.resources.end--> | ||
|
||
--- | ||
|
||
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. | ||
|
||
SPDX-License-Identifier: Apache-2.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
Microsoft Visual Studio Solution File, Format Version 12.00 | ||
# Visual Studio Version 17 | ||
VisualStudioVersion = 17.5.33414.496 | ||
MinimumVisualStudioVersion = 10.0.40219.1 | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Actions", "Actions", "{863BD09D-4F48-4BFF-B5E7-941503A41F0A}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "S3Actions", "Actions\S3Actions.csproj", "{F4A82877-7CC6-4DB8-A4C0-AC4E008DDD85}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Scenarios", "Scenarios", "{C13DDD1A-438D-4E52-90FB-A496A54516C7}" | ||
EndProject | ||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{C51625C8-3B42-4810-BF1B-0E3C6C716FA6}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Basics", "Scenarios\S3_CreatePresignedPost\Basics.csproj", "{22C217CC-E2D9-9F79-EE15-24F9D262655E}" | ||
EndProject | ||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "S3Tests", "Tests\S3Tests.csproj", "{FB41CEEB-5F32-3E4A-F9C6-1FACCBDAFF3C}" | ||
EndProject | ||
Global | ||
GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||
Debug|Any CPU = Debug|Any CPU | ||
Release|Any CPU = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(ProjectConfigurationPlatforms) = postSolution | ||
{F4A82877-7CC6-4DB8-A4C0-AC4E008DDD85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{F4A82877-7CC6-4DB8-A4C0-AC4E008DDD85}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{F4A82877-7CC6-4DB8-A4C0-AC4E008DDD85}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{F4A82877-7CC6-4DB8-A4C0-AC4E008DDD85}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{22C217CC-E2D9-9F79-EE15-24F9D262655E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{22C217CC-E2D9-9F79-EE15-24F9D262655E}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{22C217CC-E2D9-9F79-EE15-24F9D262655E}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{22C217CC-E2D9-9F79-EE15-24F9D262655E}.Release|Any CPU.Build.0 = Release|Any CPU | ||
{FB41CEEB-5F32-3E4A-F9C6-1FACCBDAFF3C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | ||
{FB41CEEB-5F32-3E4A-F9C6-1FACCBDAFF3C}.Debug|Any CPU.Build.0 = Debug|Any CPU | ||
{FB41CEEB-5F32-3E4A-F9C6-1FACCBDAFF3C}.Release|Any CPU.ActiveCfg = Release|Any CPU | ||
{FB41CEEB-5F32-3E4A-F9C6-1FACCBDAFF3C}.Release|Any CPU.Build.0 = Release|Any CPU | ||
EndGlobalSection | ||
GlobalSection(SolutionProperties) = preSolution | ||
HideSolutionNode = FALSE | ||
EndGlobalSection | ||
GlobalSection(NestedProjects) = preSolution | ||
{F4A82877-7CC6-4DB8-A4C0-AC4E008DDD85} = {863BD09D-4F48-4BFF-B5E7-941503A41F0A} | ||
{22C217CC-E2D9-9F79-EE15-24F9D262655E} = {C13DDD1A-438D-4E52-90FB-A496A54516C7} | ||
{FB41CEEB-5F32-3E4A-F9C6-1FACCBDAFF3C} = {C51625C8-3B42-4810-BF1B-0E3C6C716FA6} | ||
EndGlobalSection | ||
GlobalSection(ExtensibilityGlobals) = postSolution | ||
SolutionGuid = {5ACB5B08-E8F8-453C-B63B-6C0C9DE67780} | ||
EndGlobalSection | ||
EndGlobal |
18 changes: 18 additions & 0 deletions
18
dotnetv4/S3/Scenarios/S3_CreatePresignedPost/Basics.csproj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net8.0</TargetFramework> | ||
<ImplicitUsings>enable</ImplicitUsings> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="AWSSDK.S3" Version="4.0.6.1" /> | ||
<PackageReference Include="AWSSDK.Extensions.NETCore.Setup" Version="4.0.2" /> | ||
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.0" /> | ||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.0" /> | ||
<PackageReference Include="Microsoft.Extensions.Http" Version="9.0.0" /> | ||
</ItemGroup> | ||
|
||
</Project> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.