Skip to content

Commit 1f8819a

Browse files
committed
changes
0 parents  commit 1f8819a

File tree

240 files changed

+279009
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

240 files changed

+279009
-0
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
*Issue #, if available:*
2+
3+
*Description of changes:*
4+
5+
6+
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

CODE_OF_CONDUCT.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
## Code of Conduct
2+
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
3+
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
4+
[email protected] with any additional questions or comments.

CONTRIBUTING.md

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
# Contributing Guidelines
2+
3+
Thank you for your interest in contributing to our project. Whether it's a bug report, new feature, correction, or additional
4+
documentation, we greatly value feedback and contributions from our community.
5+
6+
Please read through this document before submitting any issues or pull requests to ensure we have all the necessary
7+
information to effectively respond to your bug report or contribution.
8+
9+
10+
## Reporting Bugs/Feature Requests
11+
12+
We welcome you to use the GitHub issue tracker to report bugs or suggest features.
13+
14+
When filing an issue, please check [existing open](https://github.com/aws-samples/aws-net-guides/issues), or [recently closed](https://github.com/aws-samples/aws-net-guides/issues?utf8=%E2%9C%93&q=is%3Aissue%20is%3Aclosed%20), issues to make sure somebody else hasn't already
15+
reported the issue. Please try to include as much information as you can. Details like these are incredibly useful:
16+
17+
* A reproducible test case or series of steps
18+
* The version of our code being used
19+
* Any modifications you've made relevant to the bug
20+
* Anything unusual about your environment or deployment
21+
22+
23+
## Contributing via Pull Requests
24+
Contributions via pull requests are much appreciated. Before sending us a pull request, please ensure that:
25+
26+
1. You are working against the latest source on the *master* branch.
27+
2. You check existing open, and recently merged, pull requests to make sure someone else hasn't addressed the problem already.
28+
3. You open an issue to discuss any significant work - we would hate for your time to be wasted.
29+
30+
To send us a pull request, please:
31+
32+
1. Fork the repository.
33+
2. Modify the source; please focus on the specific change you are contributing. If you also reformat all the code, it will be hard for us to focus on your change.
34+
3. Ensure local tests pass.
35+
4. Commit to your fork using clear commit messages.
36+
5. Send us a pull request, answering any default questions in the pull request interface.
37+
6. Pay attention to any automated CI failures reported in the pull request, and stay involved in the conversation.
38+
39+
GitHub provides additional document on [forking a repository](https://help.github.com/articles/fork-a-repo/) and
40+
[creating a pull request](https://help.github.com/articles/creating-a-pull-request/).
41+
42+
43+
## Finding contributions to work on
44+
Looking at the existing issues is a great way to find something to contribute on. As our projects, by default, use the default GitHub issue labels ((enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'](https://github.com/aws-samples/aws-net-guides/labels/help%20wanted) issues is a great place to start.
45+
46+
47+
## Code of Conduct
48+
This project has adopted the [Amazon Open Source Code of Conduct](https://aws.github.io/code-of-conduct).
49+
For more information see the [Code of Conduct FAQ](https://aws.github.io/code-of-conduct-faq) or contact
50+
[email protected] with any additional questions or comments.
51+
52+
53+
## Security issue notifications
54+
If you discover a potential security issue in this project we ask that you notify AWS/Amazon Security via our [vulnerability reporting page](http://aws.amazon.com/security/vulnerability-reporting/). Please do **not** create a public github issue.
55+
56+
57+
## Licensing
58+
59+
See the [LICENSE](https://github.com/aws-samples/aws-net-guides/blob/master/LICENSE) file for our project's licensing. We will ask you to confirm the licensing of your contribution.
60+
61+
We may ask you to sign a [Contributor License Agreement (CLA)](http://en.wikipedia.org/wiki/Contributor_License_Agreement) for larger changes.
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# .NET Core Console Application using Parameter Store for configuration
2+
3+
## Step-by-Step Walkthrough
4+
--------
5+
6+
**Overview and Services Used:**
7+
8+
This walk-through comprises a Microsoft Word doc, along with a .NET Core application. The application provides a basic console application that retrieves configuration values from AWS Systems Manager Parameter Store.
9+
10+
The walk-through includes creating test values in Parameter Store, creating and testing an application that reads from Parameter Store in either Visual Studio 2017, or via the .NET Core CLI, and then deleting the test values from Parameter Store.
11+
12+
+ Links to documentation
13+
* AWS Systems Manager Page: https://aws.amazon.com/systems-manager/
14+
* AWS Systems Manager Parameter User Guide: https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-paramstore.html
15+
16+
+ Prerequisites
17+
* AWS CLI
18+
* .NET Core 2.x SDK or higher installed
19+
* AWS Account with credentials configured locally in Visual Studio or using the CLI
20+
* Optional: Visual Studio 2017 or Visual Studio Mac
21+
22+
+ External libraries:
23+
* NuGet Package AWSSDK.SimpleSystemsManagement
24+
N.B. Adding packages is included in the walk-through
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
using System;
2+
using System.Threading.Tasks;
3+
using Amazon.SimpleSystemsManagement;
4+
using Amazon.SimpleSystemsManagement.Model;
5+
6+
namespace TestParameterStore
7+
{
8+
class Program
9+
{
10+
static void Main(string[] args)
11+
{
12+
GetConfiguration().Wait();
13+
Console.ReadLine();
14+
}
15+
16+
static async Task GetConfiguration()
17+
{
18+
var region = Amazon.RegionEndpoint.USEast1;
19+
20+
var request = new GetParameterRequest()
21+
{
22+
Name = "/TestParameterStore/EnvironmentName"
23+
};
24+
25+
using (var client = new AmazonSimpleSystemsManagementClient(region))
26+
{
27+
try
28+
{
29+
var response = await client.GetParameterAsync(request);
30+
Console.WriteLine("Parameter Value: {0}", response.Parameter.Value);
31+
}
32+
catch (Exception ex)
33+
{
34+
Console.Error.WriteLine("Error occurred: {0}", ex.Message);
35+
}
36+
}
37+
}
38+
}
39+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>netcoreapp2.0</TargetFramework>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Include="AWSSDK.SimpleSystemsManagement" Version="3.3.17.2" />
10+
</ItemGroup>
11+
12+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.27428.2015
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestParameterStore", "TestParameterStore.csproj", "{11699736-BD2B-4AE6-9883-6EB16896BE38}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{11699736-BD2B-4AE6-9883-6EB16896BE38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{11699736-BD2B-4AE6-9883-6EB16896BE38}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{11699736-BD2B-4AE6-9883-6EB16896BE38}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{11699736-BD2B-4AE6-9883-6EB16896BE38}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {CAAE3174-EFA3-48F5-8633-1F58EE4C179B}
24+
EndGlobalSection
25+
EndGlobal
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
using System;
2+
using Amazon.SimpleEmail;
3+
using Amazon.SimpleEmail.Model;
4+
5+
namespace ses_sendmail_example
6+
{
7+
class Program
8+
{
9+
static void Main(string[] args)
10+
{
11+
Console.WriteLine("Sending Email...");
12+
// new Body(new Content("This is an email message sent from SES."))
13+
using (var client = new AmazonSimpleEmailServiceClient(region: Amazon.RegionEndpoint.USEast1))
14+
{
15+
var sendRequest = new SendEmailRequest
16+
{
17+
Source = "[email protected]",
18+
Destination = new Destination { ToAddresses = { "[email protected]" } },
19+
Message = new Message
20+
{
21+
Subject = new Content("Hello from the Amazon Simple Email Service!"),
22+
Body = new Body
23+
{
24+
Html = new Content("<html><body><h2>Hello from Amazon SES</h2><ul><li>I'm a list item</li><li>So am I!</li></body></html>")
25+
}
26+
}
27+
};
28+
29+
try
30+
{
31+
var response = client.SendEmailAsync(sendRequest).Result;
32+
Console.WriteLine("Email sent! Message ID = {0}", response.MessageId);
33+
} catch (Exception ex)
34+
{
35+
Console.WriteLine("Send failed with exception: {0}", ex.Message);
36+
}
37+
}
38+
Console.Write("Press any key to continue...");
39+
Console.ReadKey();
40+
}
41+
}
42+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# **Sending Emails with AWS SES and .NET**
2+
3+
## Step-by-Step Walkthrough
4+
### Level 200 Content
5+
--------
6+
7+
#### Create a .NET Framework or .NET Core 2 App to Send Email via Amazon Simple Email Service
8+
9+
--------
10+
11+
**Overview and Services Used:**
12+
13+
This walk-through comprises a Microsoft Word doc, along with a .NET Core console application. The only service used is Amazon Simple Email Service (SES). The walk-through includes verifying the sender email address in the console, creating and configuring a simple console app in either Visual Studio or via the command line, and then running the app to actually send the email. The code could easily be run in a Lambda function or anywhere else .NET code (Framework or Core) can run.
14+
15+
+ Links to documentation
16+
* SES Service Page: https://aws.amazon.com/ses/
17+
* SES Documentation: https://docs.aws.amazon.com/ses/latest/DeveloperGuide/Welcome.html
18+
19+
+ Prerequisites
20+
* .NET Framework 3.5 or higher, **or** .NET Core 2.0 or higher installed
21+
* AWS Account with credentials configured locally in Visual Studio or using the CLI
22+
* Optional: Visual Studio 2017 (you can also use the command line for .NET Core)
23+
24+
+ External libraries:
25+
* NuGet Package AWSSDK.SimpleEmail (adding package is included in walk-through)
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>netcoreapp2.0</TargetFramework>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<PackageReference Include="AWSSDK.SimpleEmail" Version="3.3.6.3" />
10+
</ItemGroup>
11+
12+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.27428.2015
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ses-sendmail-example", "ses-sendmail-example.csproj", "{EA56A999-57C7-43D4-8E69-75653DAA35FF}"
7+
EndProject
8+
Global
9+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
10+
Debug|Any CPU = Debug|Any CPU
11+
Release|Any CPU = Release|Any CPU
12+
EndGlobalSection
13+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
14+
{EA56A999-57C7-43D4-8E69-75653DAA35FF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15+
{EA56A999-57C7-43D4-8E69-75653DAA35FF}.Debug|Any CPU.Build.0 = Debug|Any CPU
16+
{EA56A999-57C7-43D4-8E69-75653DAA35FF}.Release|Any CPU.ActiveCfg = Release|Any CPU
17+
{EA56A999-57C7-43D4-8E69-75653DAA35FF}.Release|Any CPU.Build.0 = Release|Any CPU
18+
EndGlobalSection
19+
GlobalSection(SolutionProperties) = preSolution
20+
HideSolutionNode = FALSE
21+
EndGlobalSection
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {B9CF1858-D4C0-45D6-AE21-33E1A8A94FDD}
24+
EndGlobalSection
25+
EndGlobal
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# **Deploying an ASP.NET Core Application to Fargate**
2+
3+
## Step-by-Step Walkthrough
4+
### Level 200 (using Visual Studio), Level 300 (using CLI)
5+
--------
6+
7+
#### Create an ASP.NET MVC Core web-application and Deploy to Fargate using Visual Studio or Command Line
8+
9+
--------
10+
11+
**Overview and Services Used:**
12+
13+
This walk-through includes a Word document, and two zipped files:
14+
+ Visual-Studio-fargate-sample-app.zip
15+
+ Command-line-fargate-sample-app.zip
16+
17+
The Word document walks you through creating a new ASP.NET MVC Core application, and deploying it as a multi-AZ service to Fargate using the Container Publishing Wizard in the AWS Toolkit for Visual Studio. As part of the deployment, you will create and configure an Application Load Balancer (ALB) and ECS Cluster, all within the publishing wizard. Finally, you will view the website via the public IP addresses of the Tasks (containers) themselves, and also via the ALB's public DNS.
18+
19+
There is an optional second set of instructions for creating the application via the dotnet CLI, adding docker support, building and pushing the container image and registering the Task definition all from the command line (Windows/Mac OS X/Linux), along with creating the ALB and ECS Cluster via the AWS Management Console. These steps are somewhat less detailed, and are suitable for people comfortable with the command line and management console.
20+
21+
The two zipped project files are equivalent to what you will create in the walk-through, and are provided in case you wish to simply skip to the deployment step. If you do that, you will still need to edit the task definition file as indicated in the instructions. If you are following all the steps in the Word file, you do not need the zipped project files.
22+
23+
+ Links to documentation
24+
* [Fargate Service Page](https://aws.amazon.com/fargate/) (link)
25+
* [AWS Fargate Documentation](https://docs.aws.amazon.com/AmazonECS/latest/developerguide/ECS_GetStarted.html) (link)
26+
27+
+ Prerequisites
28+
* [.NET Core 2.0](https://www.microsoft.com/net/download/) or higher installed
29+
* AWS Account with credentials configured locally in Visual Studio or using the CLI
30+
* [Docker for Windows](https://docs.docker.com/docker-for-windows/?install_site=vsonwin) (link)
31+
* Visual Studio 2017* (free community edition is sufficient)
32+
* [AWS Toolkit for Visual Studio](https://aws.amazon.com/visualstudio/)*
33+
34+
*If you are following the steps in the optional task using the command line, you do not need Visual Studio or the Toolkit, and can use Windows, Mac OS X or Linux.
35+
36+
+ External libraries: None
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
.dockerignore
2+
.env
3+
.git
4+
.gitignore
5+
.vs
6+
.vscode
7+
docker-compose.yml
8+
docker-compose.*.yml
9+
*/bin
10+
*/obj
11+
!obj/Docker/publish/*
12+
!obj/Docker/empty/

Containers/Deploy-ASP.NET-Core-To-Fargate/Visual-Studio-fargate-sample-app/DockerFile

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
version: '3.4'
2+
3+
services:
4+
ci-build:
5+
image: microsoft/aspnetcore-build:1.0-2.0
6+
volumes:
7+
- .:/src
8+
working_dir: /src
9+
command: /bin/bash -c "dotnet restore ./fargate-sample-app.sln && dotnet publish ./fargate-sample-app.sln -c Release -o ./obj/Docker/publish"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="15.0" Sdk="Microsoft.Docker.Sdk">
3+
<PropertyGroup Label="Globals">
4+
<ProjectVersion>2.1</ProjectVersion>
5+
<DockerTargetOS>Linux</DockerTargetOS>
6+
<ProjectGuid>5488f427-bb69-4d73-9d05-a3af99bb0f73</ProjectGuid>
7+
<DockerLaunchBrowser>True</DockerLaunchBrowser>
8+
<DockerServiceUrl>http://localhost:{ServicePort}</DockerServiceUrl>
9+
<DockerServiceName>fargate-sample-app</DockerServiceName>
10+
</PropertyGroup>
11+
<ItemGroup>
12+
<None Include="docker-compose.override.yml">
13+
<DependentUpon>docker-compose.yml</DependentUpon>
14+
</None>
15+
<None Include="docker-compose.yml" />
16+
<None Include=".dockerignore" />
17+
<None Include="docker-compose.ci.build.yml" />
18+
</ItemGroup>
19+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: '3.4'
2+
3+
services:
4+
fargate-sample-app:
5+
environment:
6+
- ASPNETCORE_ENVIRONMENT=Development
7+
ports:
8+
- "80"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
version: '3.4'
2+
3+
services:
4+
fargate-sample-app:
5+
image: fargate-sample-app
6+
build:
7+
context: .
8+
dockerfile: fargate-sample-app/Dockerfile

0 commit comments

Comments
 (0)