Skip to content

Commit

Permalink
update docs string in main.go
Browse files Browse the repository at this point in the history
  • Loading branch information
sean1588 committed Apr 18, 2024
1 parent 34d4c25 commit 93e45cf
Show file tree
Hide file tree
Showing 5 changed files with 120 additions and 4 deletions.
29 changes: 26 additions & 3 deletions provider/cmd/pulumi-gen-eks/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,32 @@ func generateSchema() schema.PackageSpec {
// TODO: method: createNodeGroup(name: string, args: ClusterNodeGroupOptions): NodeGroup
IsComponent: true,
ObjectTypeSpec: schema.ObjectTypeSpec{
Description: "Cluster is a component that wraps the AWS and Kubernetes resources necessary to " +
"run an EKS cluster, its worker nodes, its optional StorageClasses, and an optional " +
"deployment of the Kubernetes Dashboard.",
Description: "Cluster is a component that wraps the AWS and Kubernetes resources necessary to run an EKS cluster, its worker nodes, its optional StorageClasses, and an optional deployment of the Kubernetes Dashboard.\n\n" +
"## Example Usage\n\n### Provisioning a New EKS Cluster\n\n" +
"<!--Start PulumiCodeChooser -->\n" +
// TS example
"```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as eks from \"@pulumi/eks\";\n\n" +
"// Create an EKS cluster with the default configuration.\nconst cluster = new eks.Cluster(\"cluster\", {});\n\n" +
"// Export the cluster's kubeconfig.\nexport const kubeconfig = cluster.kubeconfig;\n ```\n\n" +
// Python example
"```python\n import pulumi\n import pulumi_eks as eks\n \n # Create an EKS cluster with the default configuration.\n cluster = eks.Cluster(\"cluster\")\n\n " +
"# Export the cluster's kubeconfig.\n pulumi.export(\"kubeconfig\", cluster.kubeconfig)\n ```\n\n" +
// Go example
"```go\n package main\n \n import (\n \t\"github.com/pulumi/pulumi-eks/sdk/go/eks\"\n \t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n )\n\n" +
"func main() {\n \tpulumi.Run(func(ctx *pulumi.Context) error {\n \t\t// Create an EKS cluster with the default configuration.\n" +
"\t\tcluster, err := eks.NewCluster(ctx, \"cluster\", nil)\n \t\tif err != nil {\n \t\t\treturn err\n \t\t}\n \t\t// Export the cluster's kubeconfig.\n \t\tctx.Export(\"kubeconfig\", cluster.Kubeconfig)\n" +
"\t\treturn nil\n \t})\n }\n ```\n\n" +
// C# example
"```csharp\n using System.Collections.Generic;\n using Pulumi;\n using Eks = Pulumi.Eks;\n \n return await Deployment.RunAsync(() =>\n {\n \t// Create an EKS cluster with the default configuration.\n" +
"\tvar cluster = new Eks.Cluster(\"cluster\");\n \n \treturn new Dictionary<string, object?>\n \t{\n \t\t// Export the cluster's kubeconfig.\n \t\t[\"kubeconfig\"] = cluster.Kubeconfig,\n \t};\n });\n\n```\n\n" +
// Java example
"```java\n import com.pulumi.Context;\n import com.pulumi.Pulumi;\n import com.pulumi.core.Output;\n import com.pulumi.eks.Cluster;\n import java.util.List;\n import java.util.ArrayList;\n import java.util.Map;\n" +
" import java.io.File;\n import java.nio.file.Files;\n import java.nio.file.Paths;\n \n public class App {\n \tpublic static void main(String[] args) {\n \t\tPulumi.run(App::stack);\n \t}\n \n" +
"\t public static void stack(Context ctx) {\n \t\t// Create an EKS cluster with the default configuration.\n \t\tvar cluster = new Cluster(\"cluster\");\n \n \t\t// Export the cluster's kubeconfig.\n" +
"\t\tctx.export(\"kubeconfig\", cluster.kubeconfig());\n \t}\n }\n ```\n\n" +
"```yaml\nresources:\n# Create an EKS cluster with the default configuration.\ncluster:\ntype: eks:Cluster\noutputs:\n# Export the cluster's kubeconfig.\n" +
"kubeconfig: ${cluster.kubeconfig}\n\n```\n" +
"<!--End PulumiCodeChooser -->",
Properties: map[string]schema.PropertySpec{
"kubeconfig": {
TypeSpec: schema.TypeSpec{Ref: "pulumi.json#/Any"},
Expand Down
2 changes: 1 addition & 1 deletion provider/cmd/pulumi-resource-eks/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@
"provider": {},
"resources": {
"eks:index:Cluster": {
"description": "Cluster is a component that wraps the AWS and Kubernetes resources necessary to run an EKS cluster, its worker nodes, its optional StorageClasses, and an optional deployment of the Kubernetes Dashboard.\n\n## Example Usage\n\n### Provisioning a New EKS Cluster\n\n <!--Start PulumiCodeChooser --> ```typescript\n import * as pulumi from \"@pulumi\/pulumi\";\n import * as eks from \"@pulumi\/eks\";\n\n \/\/ Create an EKS cluster with the default configuration.\n const cluster = new eks.Cluster(\"cluster\", {});\n\n \/\/ Export the cluster's kubeconfig.\n export const kubeconfig = cluster.kubeconfig;\n ```\n \n {{% \/choosable %}}\n {{% choosable language python %}}\n\n ```python\n import pulumi\n import pulumi_eks as eks\n \n # Create an EKS cluster with the default configuration.\n cluster = eks.Cluster(\"cluster\")\n \n # Export the cluster's kubeconfig.\n pulumi.export(\"kubeconfig\", cluster.kubeconfig)\n ```\n \n {{% \/choosable %}}\n {{% choosable language go %}}\n \n ```go\n package main\n \n import (\n \t\"github.com\/pulumi\/pulumi-eks\/sdk\/go\/eks\"\n \t\"github.com\/pulumi\/pulumi\/sdk\/v3\/go\/pulumi\"\n )\n \n func main() {\n \tpulumi.Run(func(ctx *pulumi.Context) error {\n \t\t\/\/ Create an EKS cluster with the default configuration.\n \t\tcluster, err := eks.NewCluster(ctx, \"cluster\", nil)\n \t\tif err != nil {\n \t\t\treturn err\n \t\t}\n \t\t\/\/ Export the cluster's kubeconfig.\n \t\tctx.Export(\"kubeconfig\", cluster.Kubeconfig)\n \t\treturn nil\n \t})\n }\n ```\n \n {{% \/choosable %}}\n {{% choosable language csharp %}}\n \n ```csharp\n using System.Collections.Generic;\n using Pulumi;\n using Eks = Pulumi.Eks;\n \n return await Deployment.RunAsync(() =>\n {\n \t\/\/ Create an EKS cluster with the default configuration.\n \tvar cluster = new Eks.Cluster(\"cluster\");\n \n \treturn new Dictionary<string, object?>\n \t{\n \t\t\/\/ Export the cluster's kubeconfig.\n \t\t[\"kubeconfig\"] = cluster.Kubeconfig,\n \t};\n });\n ```\n \n {{% \/choosable %}}\n {{% choosable language java %}}\n \n ```java\n import com.pulumi.Context;\n import com.pulumi.Pulumi;\n import com.pulumi.core.Output;\n import com.pulumi.eks.Cluster;\n import java.util.List;\n import java.util.ArrayList;\n import java.util.Map;\n import java.io.File;\n import java.nio.file.Files;\n import java.nio.file.Paths;\n \n public class App {\n \tpublic static void main(String[] args) {\n \t\tPulumi.run(App::stack);\n \t}\n \n\t public static void stack(Context ctx) {\n \t\t\/\/ Create an EKS cluster with the default configuration.\n \t\tvar cluster = new Cluster(\"cluster\");\n \n \t\t\/\/ Export the cluster's kubeconfig.\n \t\tctx.export(\"kubeconfig\", cluster.kubeconfig());\n \t}\n }\n ```\n \n {{% \/choosable %}}\n {{% choosable language yaml %}}\n \n ```yaml\n resources:\n # Create an EKS cluster with the default configuration.\n cluster:\n type: eks:Cluster\n outputs:\n # Export the cluster's kubeconfig.\n kubeconfig: ${cluster.kubeconfig}\n \n ```\n <!--End PulumiCodeChooser -->",
"description": "Cluster is a component that wraps the AWS and Kubernetes resources necessary to run an EKS cluster, its worker nodes, its optional StorageClasses, and an optional deployment of the Kubernetes Dashboard.\n\n## Example Usage\n\n### Provisioning a New EKS Cluster\n\n\u003c!--Start PulumiCodeChooser --\u003e\n```typescript\nimport * as pulumi from \"@pulumi/pulumi\";\nimport * as eks from \"@pulumi/eks\";\n\n// Create an EKS cluster with the default configuration.\nconst cluster = new eks.Cluster(\"cluster\", {});\n\n// Export the cluster's kubeconfig.\nexport const kubeconfig = cluster.kubeconfig;\n ```\n\n```python\n import pulumi\n import pulumi_eks as eks\n \n # Create an EKS cluster with the default configuration.\n cluster = eks.Cluster(\"cluster\")\n\n # Export the cluster's kubeconfig.\n pulumi.export(\"kubeconfig\", cluster.kubeconfig)\n ```\n\n```go\n package main\n \n import (\n \t\"github.com/pulumi/pulumi-eks/sdk/go/eks\"\n \t\"github.com/pulumi/pulumi/sdk/v3/go/pulumi\"\n )\n\nfunc main() {\n \tpulumi.Run(func(ctx *pulumi.Context) error {\n \t\t// Create an EKS cluster with the default configuration.\n\t\tcluster, err := eks.NewCluster(ctx, \"cluster\", nil)\n \t\tif err != nil {\n \t\t\treturn err\n \t\t}\n \t\t// Export the cluster's kubeconfig.\n \t\tctx.Export(\"kubeconfig\", cluster.Kubeconfig)\n\t\treturn nil\n \t})\n }\n ```\n\n```csharp\n using System.Collections.Generic;\n using Pulumi;\n using Eks = Pulumi.Eks;\n \n return await Deployment.RunAsync(() =\u003e\n {\n \t// Create an EKS cluster with the default configuration.\n\tvar cluster = new Eks.Cluster(\"cluster\");\n \n \treturn new Dictionary\u003cstring, object?\u003e\n \t{\n \t\t// Export the cluster's kubeconfig.\n \t\t[\"kubeconfig\"] = cluster.Kubeconfig,\n \t};\n });\n\n```\n\n```java\n import com.pulumi.Context;\n import com.pulumi.Pulumi;\n import com.pulumi.core.Output;\n import com.pulumi.eks.Cluster;\n import java.util.List;\n import java.util.ArrayList;\n import java.util.Map;\n import java.io.File;\n import java.nio.file.Files;\n import java.nio.file.Paths;\n \n public class App {\n \tpublic static void main(String[] args) {\n \t\tPulumi.run(App::stack);\n \t}\n \n\t public static void stack(Context ctx) {\n \t\t// Create an EKS cluster with the default configuration.\n \t\tvar cluster = new Cluster(\"cluster\");\n \n \t\t// Export the cluster's kubeconfig.\n\t\tctx.export(\"kubeconfig\", cluster.kubeconfig());\n \t}\n }\n ```\n\n```yaml\nresources:\n# Create an EKS cluster with the default configuration.\ncluster:\ntype: eks:Cluster\noutputs:\n# Export the cluster's kubeconfig.\nkubeconfig: ${cluster.kubeconfig}\n\n```\n\u003c!--End PulumiCodeChooser --\u003e",
"properties": {
"awsProvider": {
"$ref": "/aws/v6.5.0/schema.json#/provider",
Expand Down
26 changes: 26 additions & 0 deletions sdk/dotnet/Cluster.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,32 @@ namespace Pulumi.Eks
{
/// <summary>
/// Cluster is a component that wraps the AWS and Kubernetes resources necessary to run an EKS cluster, its worker nodes, its optional StorageClasses, and an optional deployment of the Kubernetes Dashboard.
///
/// ## Example Usage
///
/// ### Provisioning a New EKS Cluster
///
/// &lt;!--Start PulumiCodeChooser --&gt;
///
/// ```csharp
/// using System.Collections.Generic;
/// using Pulumi;
/// using Eks = Pulumi.Eks;
///
/// return await Deployment.RunAsync(() =&gt;
/// {
/// // Create an EKS cluster with the default configuration.
/// var cluster = new Eks.Cluster("cluster");
///
/// return new Dictionary&lt;string, object?&gt;
/// {
/// // Export the cluster's kubeconfig.
/// ["kubeconfig"] = cluster.Kubeconfig,
/// };
/// });
///
/// ```
/// &lt;!--End PulumiCodeChooser --&gt;
/// </summary>
[EksResourceType("eks:index:Cluster")]
public partial class Cluster : global::Pulumi.ComponentResource
Expand Down
31 changes: 31 additions & 0 deletions sdk/go/eks/cluster.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 36 additions & 0 deletions sdk/python/pulumi_eks/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,24 @@ def __init__(__self__,
"""
Cluster is a component that wraps the AWS and Kubernetes resources necessary to run an EKS cluster, its worker nodes, its optional StorageClasses, and an optional deployment of the Kubernetes Dashboard.
## Example Usage
### Provisioning a New EKS Cluster
<!--Start PulumiCodeChooser -->
```python
import pulumi
import pulumi_eks as eks
# Create an EKS cluster with the default configuration.
cluster = eks.Cluster("cluster")
# Export the cluster's kubeconfig.
pulumi.export("kubeconfig", cluster.kubeconfig)
```
<!--End PulumiCodeChooser -->
:param str resource_name: The name of the resource.
:param pulumi.ResourceOptions opts: Options for the resource.
:param pulumi.Input['pulumi_aws.ec2.SecurityGroup'] cluster_security_group: The security group to use for the cluster API endpoint. If not provided, a new security group will be created with full internet egress and ingress from node groups.
Expand Down Expand Up @@ -1263,6 +1281,24 @@ def __init__(__self__,
"""
Cluster is a component that wraps the AWS and Kubernetes resources necessary to run an EKS cluster, its worker nodes, its optional StorageClasses, and an optional deployment of the Kubernetes Dashboard.
## Example Usage
### Provisioning a New EKS Cluster
<!--Start PulumiCodeChooser -->
```python
import pulumi
import pulumi_eks as eks
# Create an EKS cluster with the default configuration.
cluster = eks.Cluster("cluster")
# Export the cluster's kubeconfig.
pulumi.export("kubeconfig", cluster.kubeconfig)
```
<!--End PulumiCodeChooser -->
:param str resource_name: The name of the resource.
:param ClusterArgs args: The arguments to use to populate this resource's properties.
:param pulumi.ResourceOptions opts: Options for the resource.
Expand Down

0 comments on commit 93e45cf

Please sign in to comment.