{"id":19963108,"url":"https://github.com/luxchanlu/pulumi-gomigrate","last_synced_at":"2026-05-05T01:37:28.299Z","repository":{"id":62866781,"uuid":"560397195","full_name":"LuxChanLu/pulumi-gomigrate","owner":"LuxChanLu","description":"Pulumi go migrate","archived":false,"fork":false,"pushed_at":"2022-11-01T22:52:03.000Z","size":149,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-12T08:16:59.725Z","etag":null,"topics":["go","golang","gomigrate","pulumi"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LuxChanLu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-11-01T12:13:46.000Z","updated_at":"2023-11-06T18:30:22.000Z","dependencies_parsed_at":"2022-11-08T06:33:31.245Z","dependency_job_id":null,"html_url":"https://github.com/LuxChanLu/pulumi-gomigrate","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuxChanLu%2Fpulumi-gomigrate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuxChanLu%2Fpulumi-gomigrate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuxChanLu%2Fpulumi-gomigrate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LuxChanLu%2Fpulumi-gomigrate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LuxChanLu","download_url":"https://codeload.github.com/LuxChanLu/pulumi-gomigrate/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":241396754,"owners_count":19956405,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","gomigrate","pulumi"],"created_at":"2024-11-13T02:14:45.162Z","updated_at":"2026-05-05T01:37:28.260Z","avatar_url":"https://github.com/LuxChanLu.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pulumi Component Provider Boilerplate (Go)\npulumi plugin install resource gomigrate --server github://api.github.com/LuxChanLu/pulumi-gomigrate\nThis repo is a boilerplate showing how to create a Pulumi component provider written in Go. You can search-replace `gomigrate` with the name of your desired provider as a starting point for creating a component provider for your component resources.\n\n## Background\nThis repository is part of the [guide for authoring and publishing a Pulumi Package](https://www.pulumi.com/docs/guides/pulumi-packages/how-to-author).\n\nLearn about the concepts behind [Pulumi Packages](https://www.pulumi.com/docs/guides/pulumi-packages/#pulumi-packages) and, more specifically, [Pulumi Components](https://www.pulumi.com/docs/intro/concepts/resources/components/)\n\n## Sample gomigrate Component Provider\n\nAn example `StaticPage` [component resource](https://www.pulumi.com/docs/intro/concepts/resources/#components) is available in `provider/pkg/provider/staticPage.go`. This component creates a static web page hosted in an AWS S3 Bucket. There is nothing special about `StaticPage` -- it is a typical component resource written in Go.\n\nThe component provider makes component resources available to other languages. The implementation is in `provider/pkg/provider/provider.go`. Each component resource in the provider must have an implementation in the `Construct` function to create an instance of the requested component resource and return its `URN` and state (outputs). There is an initial implementation that demonstrates an implementation of `Construct` for the example `StaticPage` component.\n\nA code generator is available which generates SDKs in TypeScript, Python, Go and .NET which are also checked in to the `sdk` folder. The SDKs are generated from a schema in `schema.yaml`. This file should be kept aligned with the component resources supported by the component provider implementation.\n\nAn example of using the `StaticPage` component in TypeScript is in `examples/simple`.\n\nNote that the generated provider plugin (`pulumi-resource-gomigrate`) must be on your `PATH` to be used by Pulumi deployments. If creating a provider for distribution to other users, you should ensure they install this plugin to their `PATH`.\n\n## Prerequisites\n\n- Go 1.17\n- Pulumi CLI\n- Node.js (to build the Node.js SDK)\n- Yarn (to build the Node.js SDK)\n- Python 3.6+ (to build the Python SDK)\n- .NET Core SDK (to build the .NET SDK)\n\n## Build and Test\n\n```bash\n# Build and install the provider (plugin copied to $GOPATH/bin)\nmake install_provider\n\n# Regenerate SDKs\nmake generate\n\n# Test Node.js SDK\n$ make install_nodejs_sdk\n$ cd examples/simple\n$ yarn install\n$ yarn link @pulumi/gomigrate\n$ pulumi stack init test\n$ pulumi config set aws:region us-east-1\n$ pulumi up\n```\n\n## Naming\n\nThe `gomigrate` provider's plugin binary must be named `pulumi-resource-gomigrate` (in the format `pulumi-resource-\u003cprovider\u003e`).\n\nWhile the provider plugin must follow this naming convention, the SDK package naming can be customized. TODO explain.\n\n## Configuring CI and releases\n\n1. Follow the instructions laid out in the [deployment templates](./deployment-templates/README-DEPLOYMENT.md).\n\n## Example component\n\nLet's look at the example `StaticPage` component resource in more detail.\n\n### Schema\n\nThe example `StaticPage` component resource is defined in `schema.yaml`:\n\n```yaml\nresources:\n  gomigrate:index:StaticPage:\n    isComponent: true\n    inputProperties:\n      indexContent:\n        type: string\n        description: The HTML content for index.html.\n    requiredInputs:\n      - indexContent\n    properties:\n      bucket:\n        \"$ref\": \"/aws/v4.0.0/schema.json#/resources/aws:s3%2Fbucket:Bucket\"\n        description: The bucket resource.\n      websiteUrl:\n        type: string\n        description: The website URL.\n    required:\n      - bucket\n      - websiteUrl\n```\n\nThe component resource's type token is `gomigrate:index:StaticPage` in the format of `\u003cpackage\u003e:\u003cmodule\u003e:\u003ctype\u003e`. In this case, it's in the `gomigrate` package and `index` module. This is the same type token passed to `RegisterComponentResource` inside the implementation of `NewStaticPage` in `provider/pkg/provider/staticPage.go`, and also the same token referenced in `Construct` in `provider/pkg/provider/provider.go`.\n\nThis component has a required `indexContent` input property typed as `string`, and two required output properties: `bucket` and `websiteUrl`. Note that `bucket` is typed as the `aws:s3/bucket:Bucket` resource from the `aws` provider (in the schema the `/` is escaped as `%2F`).\n\nSince this component returns a type from the `aws` provider, each SDK must reference the associated Pulumi `aws` SDK for the language. For the .NET, Node.js, and Python SDKs, dependencies are specified in the `language` section of the schema:\n\n```yaml\nlanguage:\n  csharp:\n    packageReferences:\n      Pulumi: 3.*\n      Pulumi.Aws: 4.*\n  go:\n    generateResourceContainerTypes: true\n    importBasePath: github.com/LuxChanLu/pulumi-gomigrate/sdk/go/gomigrate\n  nodejs:\n    dependencies:\n      \"@pulumi/aws\": \"^4.0.0\"\n    devDependencies:\n      typescript: \"^3.7.0\"\n  python:\n    requires:\n      pulumi: \"\u003e=3.0.0,\u003c4.0.0\"\n      pulumi-aws: \"\u003e=4.0.0,\u003c5.0.0\"\n```\n\nFor the Go SDK, dependencies are specified in the `sdk/go.mod` file.\n\n### Implementation\n\nThe implementation of this component is in `provider/pkg/provider/staticPage.go` and the structure of the component's inputs and outputs aligns with what is defined in `schema.yaml`:\n\n```go\n// The set of arguments for creating a StaticPage component resource.\ntype StaticPageArgs struct {\n    IndexContent pulumi.StringInput `pulumi:\"indexContent\"`\n}\n\n// The StaticPage component resource.\ntype StaticPage struct {\n    pulumi.ResourceState\n\n    Bucket     *s3.Bucket          `pulumi:\"bucket\"`\n    WebsiteUrl pulumi.StringOutput `pulumi:\"websiteUrl\"`\n}\n\n// NewStaticPage creates a new StaticPage component resource.\nfunc NewStaticPage(ctx *pulumi.Context, name string, args *StaticPageArgs, opts ...pulumi.ResourceOption) (*StaticPage, error) {\n    ...\n}\n```\n\nThe provider makes this component resource available in the `construct` function in `provider/pkg/provider/provider.go`. When `construct` is called and the `typ` argument is `gomigrate:index:StaticPage`, we create an instance of the `StaticPage` component resource and return its `URN` and state.\n\n```go\nfunc constructStaticPage(ctx *pulumi.Context, name string, inputs provider.ConstructInputs,\n    options pulumi.ResourceOption) (*provider.ConstructResult, error) {\n\n    // Copy the raw inputs to StaticPageArgs. `inputs.CopyTo` uses the types and `pulumi:` tags\n    // on the struct's fields to convert the raw values to the appropriate Input types.\n    args := \u0026StaticPageArgs{}\n    if err := inputs.CopyTo(args); err != nil {\n        return nil, errors.Wrap(err, \"setting args\")\n    }\n\n    // Create the component resource.\n    staticPage, err := NewStaticPage(ctx, name, args, options)\n    if err != nil {\n        return nil, errors.Wrap(err, \"creating component\")\n    }\n\n    // Return the component resource's URN and state. `NewConstructResult` automatically sets the\n    // ConstructResult's state based on resource struct fields tagged with `pulumi:` tags with a value\n    // that is convertible to `pulumi.Input`.\n    return provider.NewConstructResult(staticPage)\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluxchanlu%2Fpulumi-gomigrate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluxchanlu%2Fpulumi-gomigrate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluxchanlu%2Fpulumi-gomigrate/lists"}