diff --git a/pkg/codegen/docs/gen.go b/pkg/codegen/docs/gen.go index bd0212e874f0..d6475a978696 100644 --- a/pkg/codegen/docs/gen.go +++ b/pkg/codegen/docs/gen.go @@ -43,6 +43,7 @@ import ( "github.com/pulumi/pulumi/pkg/v3/codegen/nodejs" "github.com/pulumi/pulumi/pkg/v3/codegen/python" "github.com/pulumi/pulumi/pkg/v3/codegen/schema" + "github.com/pulumi/pulumi/sdk/v3/go/common/util/contract" ) //go:embed templates/*.tmpl @@ -61,6 +62,7 @@ func titleLookup(shortName string) (string, bool) { "alicloud": "Alibaba Cloud", "auth0": "Auth0", "aws": "AWS Classic", + "awsx": "AWSx (Pulumi Crosswalk for AWS)", "aws-apigateway": "AWS API Gateway", "aws-miniflux": "Miniflux", "aws-native": "AWS Native", @@ -71,12 +73,13 @@ func titleLookup(shortName string) (string, bool) { "aws-quickstart-vpc": "AWS QuickStart VPC", "aws-s3-replicated-bucket": "AWS S3 Replicated Bucket", "azure": "Azure Classic", + "azure-justrun": "Azure Justrun", "azure-native": "Azure Native", "azure-quickstart-acr-geo-replication": "Azure QuickStart ACR Geo Replication", "azure-quickstart-aks": "Azure QuickStart AKS", "azure-quickstart-compute": "Azure QuickStart Compute", "azure-quickstart-sql": "Azure QuickStart SQL", - "azuread": "Azure Active Directory", + "azuread": "Azure Active Directory (Azure AD)", "azuredevops": "Azure DevOps", "azuresel": "Azure", "civo": "Civo", @@ -84,7 +87,7 @@ func titleLookup(shortName string) (string, bool) { "cloudflare": "Cloudflare", "cloudinit": "cloud-init", "confluent": "Confluent Cloud", - "consul": "Consul", + "consul": "HashiCorp Consul", "coredns-helm": "CoreDNS (Helm)", "datadog": "Datadog", "digitalocean": "DigitalOcean", @@ -95,7 +98,7 @@ func titleLookup(shortName string) (string, bool) { "equinix-metal": "Equinix Metal", "f5bigip": "f5 BIG-IP", "fastly": "Fastly", - "gcp": "Google Cloud Classic", + "gcp": "Google Cloud (GCP) Classic", "gcp-global-cloudrun": "Google Global Cloud Run", "gcp-project-scaffold": "Google Project Scaffolding", "google-native": "Google Cloud Native", @@ -119,7 +122,7 @@ func titleLookup(shortName string) (string, bool) { "kubernetes-ingress-nginx": "NGINX Ingress Controller (Helm)", "kubernetes-coredns": "CoreDNS (Helm)", "kubernetes-cert-manager": "Jetstack Cert Manager (Helm)", - "nomad": "Nomad", + "nomad": "HashiCorp Nomad", "ns1": "NS1", "okta": "Okta", "openstack": "OpenStack", @@ -1558,14 +1561,12 @@ func (mod *modContext) genResource(r *schema.Resource) resourceDocArgs { filteredOutputProps = filterOutputProperties(r.InputProperties, r.Properties) } - // All custom resources have an implicit `id` output property, that we must inject into the docs. - if !r.IsComponent { - filteredOutputProps = append(filteredOutputProps, &schema.Property{ - Name: "id", - Comment: "The provider-assigned unique ID for this managed resource.", - Type: schema.StringType, - }) - } + // All resources have an implicit `id` output property, that we must inject into the docs. + filteredOutputProps = append(filteredOutputProps, &schema.Property{ + Name: "id", + Comment: "The provider-assigned unique ID for this managed resource.", + Type: schema.StringType, + }) for _, lang := range dctx.supportedLanguages { inputProps[lang] = mod.getProperties(r.InputProperties, lang, true, false, r.IsProvider) @@ -1691,6 +1692,14 @@ func (mod *modContext) getTypes(member interface{}, types nestedTypeUsageInfo) { } } +type fs map[string][]byte + +func (fs fs) add(path string, contents []byte) { + _, has := fs[path] + contract.Assertf(!has, "duplicate file: %s", path) + fs[path] = contents +} + // getModuleFileName returns the file name to use for a module. func (mod *modContext) getModuleFileName() string { dctx := mod.docGenContext @@ -1706,13 +1715,13 @@ func (mod *modContext) getModuleFileName() string { return mod.mod } -func (mod *modContext) gen(fs codegen.Fs) error { +func (mod *modContext) gen(fs fs) error { dctx := mod.docGenContext modName := mod.getModuleFileName() addFile := func(name, contents string) { p := path.Join(modName, name, "_index.md") - fs.Add(p, []byte(contents)) + fs.add(p, []byte(contents)) } // Resources @@ -1751,7 +1760,7 @@ func (mod *modContext) gen(fs codegen.Fs) error { return err } - fs.Add(path.Join(modName, "_index.md"), buffer.Bytes()) + fs.add(path.Join(modName, "_index.md"), buffer.Bytes()) return nil } @@ -2083,7 +2092,7 @@ func (dctx *docGenContext) generatePackage(tool string, pkg *schema.Package) (ma defer glog.Flush() glog.V(3).Infoln("generating package docs now...") - files := codegen.Fs{} + files := fs{} modules := []string{} modMap := dctx.modules() for k := range modMap { diff --git a/pkg/codegen/testing/test/testdata/enum-reference/docs/myModule/iamresource/_index.md b/pkg/codegen/testing/test/testdata/enum-reference/docs/myModule/iamresource/_index.md index 89a93c738392..d980aa5c52ff 100644 --- a/pkg/codegen/testing/test/testdata/enum-reference/docs/myModule/iamresource/_index.md +++ b/pkg/codegen/testing/test/testdata/enum-reference/docs/myModule/iamresource/_index.md @@ -310,37 +310,91 @@ All [input](#inputs) properties are implicitly available as output properties. A
-
+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + str +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

+
diff --git a/pkg/codegen/testing/test/testdata/hyphen-url/docs/registrygeoreplication/_index.md b/pkg/codegen/testing/test/testdata/hyphen-url/docs/registrygeoreplication/_index.md index 128a9fa578c4..1f54e593c0e5 100644 --- a/pkg/codegen/testing/test/testdata/hyphen-url/docs/registrygeoreplication/_index.md +++ b/pkg/codegen/testing/test/testdata/hyphen-url/docs/registrygeoreplication/_index.md @@ -325,6 +325,15 @@ All [input](#inputs) properties are implicitly available as output properties. A string

The login server url

+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

@@ -358,6 +367,15 @@ All [input](#inputs) properties are implicitly available as output properties. A string

The login server url

+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

@@ -391,6 +409,15 @@ All [input](#inputs) properties are implicitly available as output properties. A String

The login server url

+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

@@ -424,6 +451,15 @@ All [input](#inputs) properties are implicitly available as output properties. A string

The login server url

+
+ +id + + + string +
+

The provider-assigned unique ID for this managed resource.

@@ -457,6 +493,15 @@ All [input](#inputs) properties are implicitly available as output properties. A str

The login server url

+
+ +id + + + str +
+

The provider-assigned unique ID for this managed resource.

@@ -490,6 +535,15 @@ All [input](#inputs) properties are implicitly available as output properties. A String

The login server url

+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

diff --git a/pkg/codegen/testing/test/testdata/other-owned/docs/barresource/_index.md b/pkg/codegen/testing/test/testdata/other-owned/docs/barresource/_index.md index c00dfd186723..79560e17107e 100644 --- a/pkg/codegen/testing/test/testdata/other-owned/docs/barresource/_index.md +++ b/pkg/codegen/testing/test/testdata/other-owned/docs/barresource/_index.md @@ -310,37 +310,91 @@ All [input](#inputs) properties are implicitly available as output properties. A
-
+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + str +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

+
diff --git a/pkg/codegen/testing/test/testdata/other-owned/docs/fooresource/_index.md b/pkg/codegen/testing/test/testdata/other-owned/docs/fooresource/_index.md index f31715f17b6d..6f0cbf73c1ce 100644 --- a/pkg/codegen/testing/test/testdata/other-owned/docs/fooresource/_index.md +++ b/pkg/codegen/testing/test/testdata/other-owned/docs/fooresource/_index.md @@ -310,37 +310,91 @@ All [input](#inputs) properties are implicitly available as output properties. A
-
+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + str +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

+
diff --git a/pkg/codegen/testing/test/testdata/other-owned/docs/otherresource/_index.md b/pkg/codegen/testing/test/testdata/other-owned/docs/otherresource/_index.md index 01a95c4fa06c..4d68b459d2a9 100644 --- a/pkg/codegen/testing/test/testdata/other-owned/docs/otherresource/_index.md +++ b/pkg/codegen/testing/test/testdata/other-owned/docs/otherresource/_index.md @@ -310,37 +310,91 @@ All [input](#inputs) properties are implicitly available as output properties. A
-
+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + str +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

+
diff --git a/pkg/codegen/testing/test/testdata/plain-schema-gh6957/docs/staticpage/_index.md b/pkg/codegen/testing/test/testdata/plain-schema-gh6957/docs/staticpage/_index.md index 3dd33dc646b8..86a7ad7279bb 100644 --- a/pkg/codegen/testing/test/testdata/plain-schema-gh6957/docs/staticpage/_index.md +++ b/pkg/codegen/testing/test/testdata/plain-schema-gh6957/docs/staticpage/_index.md @@ -374,6 +374,15 @@ All [input](#inputs) properties are implicitly available as output properties. A Pulumi.Aws.S3.Bucket

The bucket resource.

+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

@@ -398,6 +407,15 @@ All [input](#inputs) properties are implicitly available as output properties. A Bucket

The bucket resource.

+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

@@ -422,6 +440,15 @@ All [input](#inputs) properties are implicitly available as output properties. A Bucket

The bucket resource.

+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

@@ -446,6 +473,15 @@ All [input](#inputs) properties are implicitly available as output properties. A pulumiAwss3Bucket

The bucket resource.

+
+ +id + + + string +
+

The provider-assigned unique ID for this managed resource.

@@ -470,6 +506,15 @@ All [input](#inputs) properties are implicitly available as output properties. A Bucket

The bucket resource.

+
+ +id + + + str +
+

The provider-assigned unique ID for this managed resource.

@@ -494,6 +539,15 @@ All [input](#inputs) properties are implicitly available as output properties. A aws:s3:Bucket

The bucket resource.

+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

diff --git a/pkg/codegen/testing/test/testdata/simple-methods-schema-single-value-returns/docs/foo/_index.md b/pkg/codegen/testing/test/testdata/simple-methods-schema-single-value-returns/docs/foo/_index.md index 1b464672ef35..0a6b3b44de02 100644 --- a/pkg/codegen/testing/test/testdata/simple-methods-schema-single-value-returns/docs/foo/_index.md +++ b/pkg/codegen/testing/test/testdata/simple-methods-schema-single-value-returns/docs/foo/_index.md @@ -261,37 +261,91 @@ All [input](#inputs) properties are implicitly available as output properties. A
-
+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + str +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

+
diff --git a/pkg/codegen/testing/test/testdata/simple-methods-schema/docs/foo/_index.md b/pkg/codegen/testing/test/testdata/simple-methods-schema/docs/foo/_index.md index 2b8c439c704c..158e2b2ccda8 100644 --- a/pkg/codegen/testing/test/testdata/simple-methods-schema/docs/foo/_index.md +++ b/pkg/codegen/testing/test/testdata/simple-methods-schema/docs/foo/_index.md @@ -261,37 +261,91 @@ All [input](#inputs) properties are implicitly available as output properties. A
-
+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + str +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

+
diff --git a/pkg/codegen/testing/test/testdata/simple-plain-schema-with-root-package/docs/component/_index.md b/pkg/codegen/testing/test/testdata/simple-plain-schema-with-root-package/docs/component/_index.md index b019a3facf21..f85d5f592492 100644 --- a/pkg/codegen/testing/test/testdata/simple-plain-schema-with-root-package/docs/component/_index.md +++ b/pkg/codegen/testing/test/testdata/simple-plain-schema-with-root-package/docs/component/_index.md @@ -702,37 +702,91 @@ All [input](#inputs) properties are implicitly available as output properties. A
-
+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + str +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

+
diff --git a/pkg/codegen/testing/test/testdata/simple-plain-schema/docs/component/_index.md b/pkg/codegen/testing/test/testdata/simple-plain-schema/docs/component/_index.md index bec164f5086e..9fbc94cc270f 100644 --- a/pkg/codegen/testing/test/testdata/simple-plain-schema/docs/component/_index.md +++ b/pkg/codegen/testing/test/testdata/simple-plain-schema/docs/component/_index.md @@ -751,37 +751,91 @@ All [input](#inputs) properties are implicitly available as output properties. A
-
+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + str +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

+
diff --git a/pkg/codegen/testing/test/testdata/simple-resource-schema-custom-pypackage-name/docs/otherresource/_index.md b/pkg/codegen/testing/test/testdata/simple-resource-schema-custom-pypackage-name/docs/otherresource/_index.md index fb5ed5c3c336..876c0ac9980b 100644 --- a/pkg/codegen/testing/test/testdata/simple-resource-schema-custom-pypackage-name/docs/otherresource/_index.md +++ b/pkg/codegen/testing/test/testdata/simple-resource-schema-custom-pypackage-name/docs/otherresource/_index.md @@ -310,37 +310,91 @@ All [input](#inputs) properties are implicitly available as output properties. A
-
+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + str +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

+
diff --git a/pkg/codegen/testing/test/testdata/simple-resource-schema/docs/barresource/_index.md b/pkg/codegen/testing/test/testdata/simple-resource-schema/docs/barresource/_index.md index e6664316b577..50e966eaaa19 100644 --- a/pkg/codegen/testing/test/testdata/simple-resource-schema/docs/barresource/_index.md +++ b/pkg/codegen/testing/test/testdata/simple-resource-schema/docs/barresource/_index.md @@ -310,37 +310,91 @@ All [input](#inputs) properties are implicitly available as output properties. A
-
+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + str +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

+
diff --git a/pkg/codegen/testing/test/testdata/simple-resource-schema/docs/fooresource/_index.md b/pkg/codegen/testing/test/testdata/simple-resource-schema/docs/fooresource/_index.md index c4f4ddb88655..480bbc9e06a1 100644 --- a/pkg/codegen/testing/test/testdata/simple-resource-schema/docs/fooresource/_index.md +++ b/pkg/codegen/testing/test/testdata/simple-resource-schema/docs/fooresource/_index.md @@ -310,37 +310,91 @@ All [input](#inputs) properties are implicitly available as output properties. A
-
+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + str +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

+
diff --git a/pkg/codegen/testing/test/testdata/simple-resource-schema/docs/otherresource/_index.md b/pkg/codegen/testing/test/testdata/simple-resource-schema/docs/otherresource/_index.md index fb5ed5c3c336..876c0ac9980b 100644 --- a/pkg/codegen/testing/test/testdata/simple-resource-schema/docs/otherresource/_index.md +++ b/pkg/codegen/testing/test/testdata/simple-resource-schema/docs/otherresource/_index.md @@ -310,37 +310,91 @@ All [input](#inputs) properties are implicitly available as output properties. A
-
+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + str +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

+
diff --git a/pkg/codegen/testing/test/testdata/simple-yaml-schema/docs/otherresource/_index.md b/pkg/codegen/testing/test/testdata/simple-yaml-schema/docs/otherresource/_index.md index 44fa10303933..6dbd8e0bd3d3 100644 --- a/pkg/codegen/testing/test/testdata/simple-yaml-schema/docs/otherresource/_index.md +++ b/pkg/codegen/testing/test/testdata/simple-yaml-schema/docs/otherresource/_index.md @@ -359,37 +359,91 @@ All [input](#inputs) properties are implicitly available as output properties. A
-
+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +Id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + string +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + str +
+

The provider-assigned unique ID for this managed resource.

+
-
+
+ +id + + + String +
+

The provider-assigned unique ID for this managed resource.

+