Skip to content

Commit

Permalink
updated codedocs for yaml/v2 (#2912)
Browse files Browse the repository at this point in the history
<!--Thanks for your contribution. See [CONTRIBUTING](CONTRIBUTING.md)
    for Pulumi's contribution guidelines.

    Help us merge your changes more quickly by adding more details such
    as labels, milestones, and reviewers.-->

### Proposed changes

<!--Give us a brief description of what you've done and what it solves.
-->
Updated the codedocs for new ConfigGroup and ConfigFile (v2) resources.
A working example is also provided for YAML and Java.

### Related issues (optional)

<!--Refer to related PRs or issues: #1234, or 'Fixes #1234' or 'Closes
#1234'.
Or link to full URLs to issues or pull requests in other GitHub
repositories. -->

Closes #2868
  • Loading branch information
EronWright authored Mar 28, 2024
1 parent 76baec9 commit 1010333
Show file tree
Hide file tree
Showing 13 changed files with 576 additions and 396 deletions.
4 changes: 2 additions & 2 deletions provider/cmd/pulumi-resource-kubernetes/schema.json

Large diffs are not rendered by default.

73 changes: 48 additions & 25 deletions provider/pkg/gen/examples/overlays/configFileV2.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,58 +39,81 @@ installs custom resource definitions.
{{% example %}}
### Local File

```yaml
name: example
runtime: yaml
resources:
example:
type: kubernetes:yaml/v2:ConfigFile
properties:
file: ./manifest.yaml
```
```typescript
import * as pulumi from "@pulumi/pulumi";
import * as k8s from "@pulumi/kubernetes";

const example = new k8s.yaml.v2.ConfigFile("example", {
file: "foo.yaml",
files: ["./manifest.yaml"],
});
```
```python
import pulumi
from pulumi_kubernetes.yaml.v2 import ConfigFile

example = ConfigFile(
"example",
file="foo.yaml",
file="./manifest.yaml"
)
```
```csharp
using System.Threading.Tasks;
using Pulumi;
using Pulumi.Kubernetes.Types.Inputs.Yaml.V2;
using Pulumi.Kubernetes.Yaml.V2;
using System.Collections.Generic;

class YamlStack : Stack
return await Deployment.RunAsync(() =>
{
public YamlStack()
var example = new ConfigFile("example", new ConfigFileArgs
{
var helloWorld = new ConfigFile("example", new ConfigFileArgs
{
File = "foo.yaml",
});
}
}
File = "./manifest.yaml"
});
});
```
```go
package main

import (
yamlv2 "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/yaml/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
yamlv2 "github.com/pulumi/pulumi-kubernetes/sdk/v4/go/kubernetes/yaml/v2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := yamlv2.NewConfigFile(ctx, "example",
&yamlv2.ConfigFileArgs{
File: "foo.yaml",
},
)
if err != nil {
return err
}

return nil
})
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := yamlv2.NewConfigFile(ctx, "example", &yamlv2.ConfigFileArgs{
File: pulumi.String("manifest.yaml"),
})
if err != nil {
return err
}
return nil
})
}
```
```java
package myproject;

import com.pulumi.Pulumi;
import com.pulumi.kubernetes.yaml.v2.ConfigFile;
import com.pulumi.kubernetes.yaml.v2.ConfigFileArgs;

public class App {
public static void main(String[] args) {
Pulumi.run(ctx -> {
var example = new ConfigFile("example", ConfigFileArgs.builder()
.file("./manifest.yaml")
.build());
});
}
}
```
{{% /example %}}
Expand Down
Loading

0 comments on commit 1010333

Please sign in to comment.