forked from pulumi/examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Relax AMI filter arg * Fix duplicate project names * Use valid droplet sizes * Update the AWS JS & TS container examples * Add forceDestroy options * Fix Kubernetes version inputs * Quote Azure filter * Upgrade aws-ts-airflow * Reduce droplet count * Restore .NET version for webserver example * Skip aws-ts-airflow * Fix aws-ts-hello-fargate * Tolerate changes * More duplicate project names * Fix config references * Drop the DO node count to 2 * Fix project name * Fix aws-ts-thumbnailer * Fix AMI filter queries * Add more allow-changes
- Loading branch information
Showing
35 changed files
with
183 additions
and
117 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
name: assume-role | ||
name: aws-cs-assume-role | ||
runtime: dotnet | ||
description: Demonstrate use of AWS AssumeRole Functionality in C# |
This file contains 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
name: create-role | ||
name: aws-cs-create-role | ||
runtime: dotnet | ||
description: Demonstrate use of AWS AssumeRole Functionality in C# |
This file contains 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
name: assume-role | ||
name: aws-go-assume-role | ||
runtime: go | ||
description: Demonstrate use of AWS AssumeRole Functionality |
This file contains 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
name: create-role | ||
name: aws-go-create-role | ||
runtime: go | ||
description: Demonstrate use of AWS AssumeRole Functionality |
This file contains 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 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 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 |
---|---|---|
@@ -1,24 +1,43 @@ | ||
const pulumi = require("@pulumi/pulumi"); | ||
// Copyright 2016-2023, Pulumi Corporation. All rights reserved. | ||
|
||
const aws = require("@pulumi/aws"); | ||
const awsx = require("@pulumi/awsx"); | ||
const pulumi = require("@pulumi/pulumi"); | ||
|
||
// An ECS cluster to deploy into. | ||
const cluster = new aws.ecs.Cluster("cluster", {}); | ||
|
||
// Create an elastic network listener to listen for requests and route them to the container. | ||
// See https://docs.aws.amazon.com/elasticloadbalancing/latest/network/introduction.html | ||
// for more details. | ||
let listener = new awsx.elasticloadbalancingv2.NetworkListener("nginx", { port: 80 }); | ||
// An ALB to serve the container endpoint to the internet. | ||
const loadbalancer = new awsx.lb.ApplicationLoadBalancer("loadbalancer", {}); | ||
|
||
// An ECR repository to store our application's container image. | ||
const repo = new awsx.ecr.Repository("repo", { | ||
forceDelete: true, | ||
}); | ||
|
||
// Build and publish our application's container image from ./app to the ECR repository. | ||
const image = new awsx.ecr.Image("image", { | ||
repositoryUrl: repo.url, | ||
path: "./app", | ||
}); | ||
|
||
// Define the service to run. We pass in the listener to hook up the network load balancer | ||
// to the containers the service will launch. | ||
let service = new awsx.ecs.FargateService("nginx", { | ||
desiredCount: 2, | ||
// Deploy an ECS Service on Fargate to host the application container. | ||
const service = new awsx.ecs.FargateService("service", { | ||
cluster: cluster.arn, | ||
assignPublicIp: true, | ||
taskDefinitionArgs: { | ||
containers: { | ||
nginx: { | ||
image: awsx.ecs.Image.fromPath("nginx", "./app"), | ||
memory: 512, | ||
portMappings: [listener], | ||
}, | ||
container: { | ||
image: image.imageUri, | ||
cpu: 128, | ||
memory: 512, | ||
essential: true, | ||
portMappings: [{ | ||
containerPort: 80, | ||
targetGroup: loadbalancer.defaultTargetGroup, | ||
}], | ||
}, | ||
}, | ||
}); | ||
|
||
exports.frontendURL = pulumi.interpolate `http:https://${listener.endpoint.hostname}/`; | ||
// The URL at which the container's HTTP endpoint will be available. | ||
exports.frontendURL = pulumi.interpolate`http:https://${loadbalancer.loadBalancer.dnsName}`; |
This file contains 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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"name": "container-quickstart", | ||
"name": "aws-js-containers", | ||
"main": "index.js", | ||
"dependencies": { | ||
"@pulumi/aws": "^5.0.0", | ||
"@pulumi/awsx": "^0.40.0", | ||
"@pulumi/pulumi": "^3.0.0" | ||
"@pulumi/aws": "^5.29.1", | ||
"@pulumi/awsx": "^1.0.2", | ||
"@pulumi/pulumi": "^3.55.0" | ||
} | ||
} |
This file contains 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: assume-role | ||
name: aws-py-assume-role | ||
runtime: | ||
name: python | ||
options: | ||
|
This file contains 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
name: create-role | ||
name: aws-py-create-role | ||
runtime: | ||
name: python | ||
options: | ||
|
This file contains 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 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 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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
{ | ||
"name": "airflow", | ||
"devDependencies": { | ||
"@types/node": "^8.0.0" | ||
"@types/node": "^18.13.0" | ||
}, | ||
"dependencies": { | ||
"@pulumi/aws": "^5.0.0", | ||
"@pulumi/awsx": "^0.40.0", | ||
"@pulumi/pulumi": "^3.0.0" | ||
"@pulumi/aws": "^5.29.1", | ||
"@pulumi/awsx": "^1.0.2", | ||
"@pulumi/pulumi": "^3.55.0" | ||
} | ||
} |
This file contains 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
name: assume-role | ||
name: aws-ts-assume-role | ||
runtime: nodejs | ||
description: Demonstrate use of AWS AssumeRole Functionality |
This file contains 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
name: create-role | ||
name: aws-ts-create-role | ||
runtime: nodejs | ||
description: Demonstrate use of AWS AssumeRole Functionality |
This file contains 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 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 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 |
---|---|---|
@@ -1,26 +1,43 @@ | ||
// Copyright 2016-2019, Pulumi Corporation. All rights reserved. | ||
// Copyright 2016-2023, Pulumi Corporation. All rights reserved. | ||
|
||
import * as aws from "@pulumi/aws"; | ||
import * as awsx from "@pulumi/awsx"; | ||
import * as pulumi from "@pulumi/pulumi"; | ||
|
||
// Create an elastic network listener to listen for requests and route them to the container. | ||
// See https://docs.aws.amazon.com/elasticloadbalancing/latest/network/introduction.html | ||
// for more details. | ||
const listener = new awsx.elasticloadbalancingv2.NetworkListener("nginx", { port: 80 }); | ||
// An ECS cluster to deploy into. | ||
const cluster = new aws.ecs.Cluster("cluster", {}); | ||
|
||
// Define the service to run. We pass in the listener to hook up the network load balancer | ||
// to the containers the service will launch. | ||
const service = new awsx.ecs.FargateService("nginx", { | ||
desiredCount: 3, | ||
// An ALB to serve the container endpoint to the internet. | ||
const loadbalancer = new awsx.lb.ApplicationLoadBalancer("loadbalancer", {}); | ||
|
||
// An ECR repository to store our application's container image. | ||
const repo = new awsx.ecr.Repository("repo", { | ||
forceDelete: true, | ||
}); | ||
|
||
// Build and publish our application's container image from ./app to the ECR repository. | ||
const image = new awsx.ecr.Image("image", { | ||
repositoryUrl: repo.url, | ||
path: "./app", | ||
}); | ||
|
||
// Deploy an ECS Service on Fargate to host the application container. | ||
const service = new awsx.ecs.FargateService("service", { | ||
cluster: cluster.arn, | ||
assignPublicIp: true, | ||
taskDefinitionArgs: { | ||
containers: { | ||
nginx: { | ||
image: awsx.ecs.Image.fromPath("nginx", "./app"), | ||
memory: 512, | ||
portMappings: [listener], | ||
}, | ||
container: { | ||
image: image.imageUri, | ||
cpu: 128, | ||
memory: 512, | ||
essential: true, | ||
portMappings: [{ | ||
containerPort: 80, | ||
targetGroup: loadbalancer.defaultTargetGroup, | ||
}], | ||
}, | ||
}, | ||
}); | ||
|
||
export let frontendURL = pulumi.interpolate `http:https://${listener.endpoint.hostname}/`; | ||
// The URL at which the container's HTTP endpoint will be available. | ||
export const frontendURL = pulumi.interpolate`http:https://${loadbalancer.loadBalancer.dnsName}`; |
This file contains 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 |
---|---|---|
@@ -1,9 +1,9 @@ | ||
{ | ||
"name": "container-quickstart", | ||
"name": "aws-ts-containers", | ||
"main": "index.js", | ||
"dependencies": { | ||
"@pulumi/aws": "^5.0.0", | ||
"@pulumi/awsx": "^0.40.0", | ||
"@pulumi/pulumi": "^3.0.0" | ||
"@pulumi/aws": "^5.29.1", | ||
"@pulumi/awsx": "^1.0.2", | ||
"@pulumi/pulumi": "^3.55.0" | ||
} | ||
} |
This file contains 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 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
Oops, something went wrong.