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
The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The login server url
+The provider-assigned unique ID for this managed resource.
The login server url
+The provider-assigned unique ID for this managed resource.
The login server url
+The provider-assigned unique ID for this managed resource.
The login server url
+The provider-assigned unique ID for this managed resource.
The login server url
+The provider-assigned unique ID for this managed resource.
The login server url
+The provider-assigned unique ID for this managed resource.
The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The bucket resource.
+The provider-assigned unique ID for this managed resource.
The bucket resource.
+The provider-assigned unique ID for this managed resource.
The bucket resource.
+The provider-assigned unique ID for this managed resource.
The bucket resource.
+The provider-assigned unique ID for this managed resource.
The bucket resource.
+The provider-assigned unique ID for this managed resource.
The bucket resource.
+The provider-assigned unique ID for this managed resource.
The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+The provider-assigned unique ID for this managed resource.
+