This repository has been archived by the owner on Jul 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace ECR repo example with with example programs (#3691)
- Loading branch information
Showing
22 changed files
with
264 additions
and
7 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
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
14 changes: 14 additions & 0 deletions
14
themes/default/static/programs/awsx-ecr-repository-csharp/Program.cs
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using Pulumi; | ||
using Pulumi.Aws.S3; | ||
using Awsx = Pulumi.Awsx; | ||
using System.Collections.Generic; | ||
|
||
return await Deployment.RunAsync(() => | ||
{ | ||
var repository = new Awsx.Ecr.Repository("repository"); | ||
|
||
return new Dictionary<string, object?> | ||
{ | ||
["url"] = repository.Url, | ||
}; | ||
}); |
3 changes: 3 additions & 0 deletions
3
themes/default/static/programs/awsx-ecr-repository-csharp/Pulumi.yaml
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name: awsx-ecr-repository-csharp | ||
runtime: dotnet | ||
description: An example that creates a container-image repository in Amazon Elastic Container Registry (ECR). |
15 changes: 15 additions & 0 deletions
15
themes/default/static/programs/awsx-ecr-repository-csharp/awsx-ecr-repository-csharp.csproj
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
|
||
<PropertyGroup> | ||
<OutputType>Exe</OutputType> | ||
<TargetFramework>net6.0</TargetFramework> | ||
<Nullable>enable</Nullable> | ||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
<PackageReference Include="Pulumi" Version="3.*" /> | ||
<PackageReference Include="Pulumi.Aws" Version="6.*" /> | ||
<PackageReference Include="Pulumi.Awsx" Version="2.*" /> | ||
</ItemGroup> | ||
|
||
</Project> |
3 changes: 3 additions & 0 deletions
3
themes/default/static/programs/awsx-ecr-repository-go/Pulumi.yaml
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name: awsx-ecr-repository-go | ||
runtime: go | ||
description: An example that creates a container-image repository in Amazon Elastic Container Registry (ECR). |
8 changes: 8 additions & 0 deletions
8
themes/default/static/programs/awsx-ecr-repository-go/go.mod.txt
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
module awsx-ecr-repository-go | ||
|
||
go 1.20 | ||
|
||
require ( | ||
github.com/pulumi/pulumi-awsx/sdk/v2 v2.3.0 | ||
github.com/pulumi/pulumi/sdk/v3 v3.93.0 | ||
) |
18 changes: 18 additions & 0 deletions
18
themes/default/static/programs/awsx-ecr-repository-go/main.go
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package main | ||
|
||
import ( | ||
"github.com/pulumi/pulumi-awsx/sdk/v2/go/awsx/ecr" | ||
"github.com/pulumi/pulumi/sdk/v3/go/pulumi" | ||
) | ||
|
||
func main() { | ||
pulumi.Run(func(ctx *pulumi.Context) error { | ||
repository, err := ecr.NewRepository(ctx, "repository", nil) | ||
if err != nil { | ||
return err | ||
} | ||
|
||
ctx.Export("url", repository.Url) | ||
return nil | ||
}) | ||
} |
3 changes: 3 additions & 0 deletions
3
themes/default/static/programs/awsx-ecr-repository-java/Pulumi.yaml
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name: awsx-ecr-repository-java | ||
runtime: java | ||
description: An example that creates a container-image repository in Amazon Elastic Container Registry (ECR). |
97 changes: 97 additions & 0 deletions
97
themes/default/static/programs/awsx-ecr-repository-java/pom.xml
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 |
---|---|---|
@@ -0,0 +1,97 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<groupId>com.pulumi</groupId> | ||
<artifactId>awsx-ecr-repository-java</artifactId> | ||
<version>1.0-SNAPSHOT</version> | ||
|
||
<properties> | ||
<encoding>UTF-8</encoding> | ||
<maven.compiler.source>11</maven.compiler.source> | ||
<maven.compiler.target>11</maven.compiler.target> | ||
<maven.compiler.release>11</maven.compiler.release> | ||
<mainClass>myproject.App</mainClass> | ||
<mainArgs/> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.pulumi</groupId> | ||
<artifactId>pulumi</artifactId> | ||
<version>(,1.0]</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.pulumi</groupId> | ||
<artifactId>aws</artifactId> | ||
<version>(6.0.2,6.99]</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>com.pulumi</groupId> | ||
<artifactId>awsx</artifactId> | ||
<version>(2.0.0,2.99]</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-jar-plugin</artifactId> | ||
<version>3.2.2</version> | ||
<configuration> | ||
<archive> | ||
<manifest> | ||
<addClasspath>true</addClasspath> | ||
<mainClass>${mainClass}</mainClass> | ||
</manifest> | ||
</archive> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-assembly-plugin</artifactId> | ||
<version>3.3.0</version> | ||
<configuration> | ||
<archive> | ||
<manifest> | ||
<addClasspath>true</addClasspath> | ||
<mainClass>${mainClass}</mainClass> | ||
</manifest> | ||
</archive> | ||
<descriptorRefs> | ||
<descriptorRef>jar-with-dependencies</descriptorRef> | ||
</descriptorRefs> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<id>make-my-jar-with-dependencies</id> | ||
<phase>package</phase> | ||
<goals> | ||
<goal>single</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.codehaus.mojo</groupId> | ||
<artifactId>exec-maven-plugin</artifactId> | ||
<version>3.0.0</version> | ||
<configuration> | ||
<mainClass>${mainClass}</mainClass> | ||
<commandlineArgs>${mainArgs}</commandlineArgs> | ||
</configuration> | ||
</plugin> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-wrapper-plugin</artifactId> | ||
<version>3.1.0</version> | ||
<configuration> | ||
<mavenVersion>3.8.5</mavenVersion> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
</project> |
14 changes: 14 additions & 0 deletions
14
themes/default/static/programs/awsx-ecr-repository-java/src/main/java/myproject/App.java
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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package myproject; | ||
|
||
import com.pulumi.Pulumi; | ||
import com.pulumi.awsx.ecr.Repository; | ||
|
||
public class App { | ||
public static void main(String[] args) { | ||
Pulumi.run(ctx -> { | ||
var repository = new Repository("repository"); | ||
|
||
ctx.export("url", repository.url()); | ||
}); | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
themes/default/static/programs/awsx-ecr-repository-javascript/Pulumi.yaml
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
name: awsx-ecr-repository-javascript | ||
runtime: | ||
name: nodejs | ||
options: | ||
typescript: false | ||
description: An example that creates a container-image repository in Amazon Elastic Container Registry (ECR). |
7 changes: 7 additions & 0 deletions
7
themes/default/static/programs/awsx-ecr-repository-javascript/index.js
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
"use strict"; | ||
const pulumi = require("@pulumi/pulumi"); | ||
const aws = require("@pulumi/aws"); | ||
const awsx = require("@pulumi/awsx"); | ||
|
||
const repo = new awsx.ecr.Repository("repo"); | ||
exports.url = repo.url; |
9 changes: 9 additions & 0 deletions
9
themes/default/static/programs/awsx-ecr-repository-javascript/package.json
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"name": "awsx-ecr-repository-javascript", | ||
"main": "index.js", | ||
"dependencies": { | ||
"@pulumi/pulumi": "^3.0.0", | ||
"@pulumi/aws": "^6.0.0", | ||
"@pulumi/awsx": "^2.0.2" | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
themes/default/static/programs/awsx-ecr-repository-python/Pulumi.yaml
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
name: awsx-ecr-repository-python | ||
runtime: | ||
name: python | ||
options: | ||
virtualenv: venv | ||
description: An example that creates a container-image repository in Amazon Elastic Container Registry (ECR). |
5 changes: 5 additions & 0 deletions
5
themes/default/static/programs/awsx-ecr-repository-python/__main__.py
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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import pulumi | ||
import pulumi_awsx as awsx | ||
|
||
repository = awsx.ecr.Repository("repository") | ||
pulumi.export("url", repository.url) |
3 changes: 3 additions & 0 deletions
3
themes/default/static/programs/awsx-ecr-repository-python/requirements.txt
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pulumi>=3.0.0,<4.0.0 | ||
pulumi-aws>=6.0.2,<7.0.0 | ||
pulumi-awsx>=2.0.0,<3.0.0 |
3 changes: 3 additions & 0 deletions
3
themes/default/static/programs/awsx-ecr-repository-typescript/Pulumi.yaml
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
name: awsx-ecr-repository-typescript | ||
runtime: nodejs | ||
description: An example that creates a container-image repository in Amazon Elastic Container Registry (ECR). |
4 changes: 4 additions & 0 deletions
4
themes/default/static/programs/awsx-ecr-repository-typescript/index.ts
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import * as awsx from "@pulumi/awsx"; | ||
|
||
const repo = new awsx.ecr.Repository("repo"); | ||
export const url = repo.url; |
12 changes: 12 additions & 0 deletions
12
themes/default/static/programs/awsx-ecr-repository-typescript/package.json
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"name": "awsx-ecr-repository-typescript", | ||
"main": "index.ts", | ||
"devDependencies": { | ||
"@types/node": "^18" | ||
}, | ||
"dependencies": { | ||
"@pulumi/pulumi": "^3.0.0", | ||
"@pulumi/aws": "^6.0.0", | ||
"@pulumi/awsx": "^2.0.2" | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
themes/default/static/programs/awsx-ecr-repository-typescript/tsconfig.json
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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"compilerOptions": { | ||
"strict": true, | ||
"outDir": "bin", | ||
"target": "es2016", | ||
"module": "commonjs", | ||
"moduleResolution": "node", | ||
"sourceMap": true, | ||
"experimentalDecorators": true, | ||
"pretty": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"noImplicitReturns": true, | ||
"forceConsistentCasingInFileNames": true | ||
}, | ||
"files": ["index.ts"] | ||
} |
8 changes: 8 additions & 0 deletions
8
themes/default/static/programs/awsx-ecr-repository-yaml/Pulumi.yaml
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
name: awsx-ecr-repository-yaml | ||
runtime: yaml | ||
description: An example that creates a container-image repository in Amazon Elastic Container Registry (ECR). | ||
resources: | ||
repository: | ||
type: awsx:ecr:Repository | ||
outputs: | ||
url: ${repository.url} |