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
[HttpGet] | |
public async Task<ActionResult<IEnumerable<WeatherForecast>>> GetAsync() | |
{ | |
var rng = new Random(); | |
var notFound = false; | |
var response = Enumerable.Range(1, 5).Select(index => new WeatherForecast | |
{ | |
Date = DateTime.Now.AddDays(index), | |
TemperatureC = rng.Next(-20, 55), | |
Summary = Summaries[rng.Next(Summaries.Length)] |
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
@startuml | |
title ECS Fargate API and Aurora MySQL | |
cloud Internet { | |
} | |
node "ECS Cluster" { | |
node "ECS Fargate Service" { | |
node "ECS Task" { |
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
@startuml Simple Sequence Diagram | |
title Simple Sequence Diagram Example | |
actor Chris | |
boundary PlantUMLServer | |
Chris->PlantUMLServer: Edit PlantUML Code | |
PlantUMLServer->PlantUMLServer: Process Code | |
alt Chris' PlantUML Code is wrong | |
PlantUMLServer -> Chris: Syntax error, goofball! |
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
//create our ecs task (with docker build of our container) | |
const taskDefinition = new awsx.ecs.FargateTaskDefinition("pulumi-ecs-primary", { | |
containers: { | |
sampleapp: { | |
image: awsx.ecs.Image.fromDockerBuild(repo, { | |
context: "../src/", | |
dockerfile: "../src/MyApi/MyApi.Service/AWS.Dockerfile", | |
}), | |
portMappings: [listener], | |
//we can even add environment variables to our task's container |
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
public void Configure(IApplicationBuilder app, IWebHostEnvironment env, IHostApplicationLifetime applicationLifetime) | |
{ | |
//Your other configuration | |
//Use Identity and Access Control, if enabled | |
if (bool.Parse(Configuration["AUTHENTICATION_ENABLED"] ?? "true")) | |
{ | |
app.UseAuthentication(); | |
} |
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
public void ConfigureServices(IServiceCollection services) | |
{ | |
//Other configuration above... | |
if (bool.Parse(Configuration["AUTHENTICATION_ENABLED"] ?? "true")) | |
{ | |
//add all your authentication setup logic here | |
services.AddMvcCore(options => options.EnableEndpointRouting = false) | |
.AddAuthorization(); |
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
version: "3.4" | |
services: | |
price-predict: | |
image: my-api | |
build: | |
context: . | |
dockerfile: My.Api/LOCAL.Dockerfile | |
environment: | |
- ASPNETCORE_ENVIRONMENT=Development | |
- AUTHENTICATION_ENABLED=true|false |
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
version: "3.4" | |
services: | |
my-api: | |
extra_hosts: | |
- mysql:${BITBUCKET_DOCKER_HOST_INTERNAL} |
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
definitions: | |
steps: | |
- step: &run-postman-tests | |
name: Run postman tests collections | |
image: node:13.1.0-alpine3.10 | |
services: | |
- docker | |
- mysql | |
caches: | |
- dotnetcore |
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
REPO_TO_DELETE=$( aws ecr describe-repositories --query "repositories[0].[repositoryName]" --output text) | |
echo $REPO_TO_DELETE | |
# Now pass this to your next command, as in | |
# aws ecr delete-repository --repository-name $REPO_TO_DELETE |