Skip to content

Commit

Permalink
chore: More complete language examples (#592)
Browse files Browse the repository at this point in the history
  • Loading branch information
kichik authored Jun 30, 2024
1 parent 146886f commit a2c73ab
Showing 1 changed file with 51 additions and 6 deletions.
57 changes: 51 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,14 @@ You can also create your own provider by implementing `IRunnerProvider`.
```
### Use
```python
from aws_cdk import App, Stack
from cloudsnorkel.cdk_github_runners import GitHubRunners

GitHubRunners(self, "runners")
app = App()
stack = Stack(app, "github-runners")
GitHubRunners(stack, "runners")

app.synth()
```
</details>
<details><summary>TypeScript or JavaScript</summary>
Expand All @@ -79,9 +84,14 @@ You can also create your own provider by implementing `IRunnerProvider`.
```
### Use
```typescript
import { App, Stack } from 'aws-cdk-lib';
import { GitHubRunners } from '@cloudsnorkel/cdk-github-runners';

new GitHubRunners(this, "runners");
const app = new App();
const stack = new Stack(app, 'github-runners');
new GitHubRunners(stack, 'runners');

app.synth();
```
</details>
<details><summary>Java</summary>
Expand All @@ -96,9 +106,19 @@ You can also create your own provider by implementing `IRunnerProvider`.
```
### Use
```java
import software.amazon.awscdk.App;
import software.amazon.awscdk.Stack;
import com.cloudsnorkel.cdk.github.runners.GitHubRunners;

GitHubRunners.Builder.create(this, "runners").build();
public class Example {
public static void main(String[] args){
App app = new App();
Stack stack = new Stack(app, "github-runners");
GitHubRunners.Builder.create(stack, "runners").build();

app.synth();
}
}
```
</details>
<details><summary>Go</summary>
Expand All @@ -110,9 +130,21 @@ You can also create your own provider by implementing `IRunnerProvider`.
```
### Use
```go
import "github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners"
package main

import (
"github.com/CloudSnorkel/cdk-github-runners-go/cloudsnorkelcdkgithubrunners"
"github.com/aws/aws-cdk-go/awscdk/v2"
"github.com/aws/jsii-runtime-go"
)

func main() {
app := awscdk.NewApp(nil)
stack := awscdk.NewStack(app, jsii.String("github-runners"), &awscdk.StackProps{})
cloudsnorkelcdkgithubrunners.NewGitHubRunners(stack, jsii.String("runners"), &cloudsnorkelcdkgithubrunners.GitHubRunnersProps{})

NewGitHubRunners(this, jsii.String("runners"))
app.Synth(nil)
}
```
</details>
<details><summary>.NET</summary>
Expand All @@ -124,9 +156,22 @@ You can also create your own provider by implementing `IRunnerProvider`.
```
### Use
```csharp
using Amazon.CDK;
using CloudSnorkel;

new GitHubRunners(this, "runners");
namespace Example
{
sealed class Program
{
public static void Main(string[] args)
{
var app = new App();
var stack = new Stack(app, "github-runners");
new GitHubRunners(stack, "runners");
app.Synth();
}
}
}
```
</details>
2. Use `GitHubRunners` construct in your code (starting with default arguments is fine)
Expand Down

0 comments on commit a2c73ab

Please sign in to comment.