{"id":15616602,"url":"https://github.com/ringods/pulumi-resource","last_synced_at":"2025-04-18T06:33:24.749Z","repository":{"id":46666514,"uuid":"332463150","full_name":"ringods/pulumi-resource","owner":"ringods","description":"Pulumi Resource Type for Concourse","archived":true,"fork":false,"pushed_at":"2025-02-15T12:34:34.000Z","size":208,"stargazers_count":16,"open_issues_count":1,"forks_count":4,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-13T21:12:19.579Z","etag":null,"topics":["concourse","concourse-resource"],"latest_commit_sha":null,"homepage":"","language":"Go","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/ringods.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-24T13:57:16.000Z","updated_at":"2025-02-15T12:44:02.000Z","dependencies_parsed_at":"2023-10-13T05:25:06.200Z","dependency_job_id":"854eb283-8c93-4567-9700-08aad8a4e7cb","html_url":"https://github.com/ringods/pulumi-resource","commit_stats":null,"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ringods%2Fpulumi-resource","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ringods%2Fpulumi-resource/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ringods%2Fpulumi-resource/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ringods%2Fpulumi-resource/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ringods","download_url":"https://codeload.github.com/ringods/pulumi-resource/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249445254,"owners_count":21273570,"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":["concourse","concourse-resource"],"created_at":"2024-10-03T07:11:04.872Z","updated_at":"2025-04-18T06:33:24.741Z","avatar_url":"https://github.com/ringods.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e [!IMPORTANT]\n\u003e The resource type is no longer maintained by the author. If you are interested\n\u003e in taking over ownership and continue the development, open an\n\u003e [issue](https://github.com/ringods/pulumi-resource/issues/new) to request transfer \n\u003e of this repository.\n\n# Pulumi Resource Type for Concourse\n\nA [Concourse](http://concourse-ci.org/) resource type that allows jobs to modify IaaS resources via [Pulumi](https://www.pulumi.com/). This resource will work against the Pulumi hosted platform. Cloud based state storage backends are not supported by this resource.\n\n*NOTE:* This resource is currently under development and might still contain some bugs. Use at least v0.4.0, in combination with a Pulumi 3.x based project. All previous development versions are unsupported.\n\n## Community\n\nFor usage questions, please post a new message on the [Github Discussions](https://github.com/ringods/pulumi-resource/discussions) board for this project.\n\nIf you are not sure whether your problem is a usage problem or a bug, please reach out via the discussions first. Also reach out first via the Discussions if you have a suggestion for an improvement.\n\nOnly file a new Github issue when you are really sure there is a bug.\n\n## Using the resource type in your pipeline\n\nTo use this resource type in your pipeline, you have to register it under the `resource_types` section in your pipeline:\n\n### Example\n\n```yaml\nresource_types:\n- name: pulumi\n  type: registry-image\n  source:\n    repository: ghcr.io/ringods/pulumi-resource\n    tag: v0.4.0\n```\n\nConcourse will now know about the resource type called `pulumi` in your list of resources.\n\n## Source Configuration\n\nEvery stack you want to manage in your pipeline needs to be registered as a resource in \nyour pipeline. Each stack is identified by the following 3 properties, extended with\nauthentication credentials:\n\n* `organization`: *Required.* The name of the organization you use on the Pulumi platform.\n* `project`: *Required.* The name of your Pulumi project.\n* `stack`: *Required.* Name of the stack to manage, e.g. `staging`.\n* `token`: *Required.* Access token which will be used to login on the Pulumi platform. Use Concourse [Credential Management](https://concourse-ci.org/creds.html) to keep your token safe!\n\n### Example\n\n```yaml\nresources:\n- name: my-staging-network\n  type: pulumi\n  source:\n    organization: companyname\n    project: network\n    stack: staging\n    token: pul-XXXXXXXXXXXXXXXXX\n```\n\n## Behavior\n\n### `check`: Check for new infrastructure deployments\n\nThis uses a non-public REST endpoint on the hosted platform, authenticated with the provided\naccess token, to check for new revisions of the configured stack. The `check` step filters out\nfailed deployments and will only provide new versions for successful deploys.\n\n### `in`: Get the details of a new infrastructure revision\n\nYou can use a Pulumi resource in a `get` step to act as a trigger for downstream builds.\nThis triggering will happen once the `check` step finds new succesful deploys of the\nconfigured stack.\n\nThe details of this new infrastructure revision are not yet provided for downstream processing.\n\n#### Example\n\n```yaml\n- name: after-update-of-my-staging-network\n  plan:\n  - get: my-staging-network\n    trigger: true\n  - task: do-something-after-deploying-staging-network-stack\n    ...\n```\n\n### `out`: run pulumi to deploy the latest infrastructure code\n\nUse a pulumi resource in a `put` step if you want to run pulumi in your infrastructure code via Concourse.\n\nPulumi can use different language runtimes. The amount of possibilities in language runtime, \nlanguage runtime version as well as additional tools on the side makes it sheer impossible\nto provide that all within the container image for this resource type. Therefor, this resource\ntype is implemented in a way that you can pass your custom runtime image via config.\n\n* `runtime`: should point to a `registry-image` resource containing your specific language runtime,\n  version and additional tooling.\n* `sources`: should point to an input retrieved via `get` or to an `output` from a previous step.\n* `config`: this section may contain any valid configuration which you would normally put in your\n  `Pulumi.\u003cstack\u003e.yaml` file. Secrets are *not yet* supported.\n* `env`: this section may contain environment variables which are needed. E.g., for authentication\n\nLet's show this at work with an example of a NodeJS based Pulumi stack:\n\n#### Example\n\nPipeline file:\n\n```yaml\nresources:\n- name: nodejs14\n  type: registry-image\n  source:\n    repository: node\n\n- name: myinfracode\n  type: git\n  uri: git@github.com:owner/myinfracode.git\n    branch: main\n\n- name: my-staging-network\n  type: pulumi\n  source:\n    organization: companyname\n    project: network\n    stack: staging\n    token: pul-XXXXXXXXXXXXXXXXX\n\njobs:\n- name: update-infra\n  plan:\n  - get: myinfracode\n    trigger: true\n  - get: nodejs14\n  - task: npm-install\n    image: nodejs14\n    input_mapping: { code: myinfracode }\n    file: code/npm-install.yml\n  - put: my-staging-network\n    params:\n      runtime: nodejs14\n      sources: code\n      config:\n        network:setting1: value1\n        network:setting2: value2\n      env:\n        CLOUD_PROVIDER_CREDENTIALS: |\n          {\n            \"private_key_id\": \"\u003cprivate key id string\u003e\",\n            \"private_key\": \"\u003cprivate key string here\u003e\",\n            ...\n          }\n        CLOUD_PROVIDER_REGION: value1\n        CLOUD_PROVIDER_ZONE: value2\n```\n\nThe example task file:\n\n```yaml\n---\nplatform: linux\n\ninputs:\n- name: code\n\noutputs:\n- name: code\n\nrun:\n  path: /bin/bash\n  args:\n    - -c\n    - |\n      set -euo pipefail\n      cd ./code\n      npm ci\n```\n\nThe resources section contains 3 resources:\n\n* `nodejs14`: a container image for NodeJS 14 and support tools like npm or yarn.\n  You can configures this fully to your liking.\n* `myinfracode`: a git resource pointing to your Pulumi code in a git repository, \n  e.g. tracking new commits on branch `main`\n* `my-staging-network`: the pulumi resource pointing to our staging network stack.\n\nWe then create a job which does 4 steps:\n\n* retrieves the new revision of the code in the `get: myinfracode` step.\n* fetches your NodeJS runtime image in the `get: nodejs14` step. Do not forget to `get` your runtime\n  image in the job. If you forget this step, you will not have it available in your `put` step.\n* runs `npm install` first on the retrieved code using the `nodejs14` image as the container\n* pass your modified sources as an output. If you don't do this and pass your sources using your `get` resource, you still have your clean sources.\n* runs Pulumi (via the Automation API) on your code, using the provided runtime image. The stack config\n  set via the Concourse pipeline is mixed with any config already provided in the `Pulumi.\u003cstack\u003e.yaml` file residing in the source repository\n\n## Full Example\n\nTo wire all the pieces together, here is a full example combining all the previous snippets together:\n\n```yaml\nresource_types:\n- name: pulumi\n  type: registry-image\n  source:\n    repository: ghcr.io/ringods/pulumi-resource\n    tag: v0.2.0\n\nresources:\n- name: nodejs14\n  type: registry-image\n  source:\n    repository: node\n\n- name: myinfracode\n  type: git\n  uri: git@github.com:owner/myinfracode.git\n    branch: master\n\n- name: my-staging-network\n  type: pulumi\n  source:\n    organization: companyname\n    project: network\n    stack: staging\n    token: pul-XXXXXXXXXXXXXXXXX\n\njobs:\n- name: update-infra\n  plan:\n  - get: myinfracode\n    trigger: true\n  - get: nodejs14\n  - task:\n    image: nodejs14\n    input_mapping: { code: myinfracode }\n    file: code/npm-install.yml\n  - put: my-staging-network\n    params:\n      runtime: nodejs14\n      sources: code\n      config:\n        network:setting1: value1\n        network:setting2: value2\n      env:\n        CLOUD_PROVIDER_CREDENTIALS: |\n          {\n            \"private_key_id\": \"\u003cprivate key id string\u003e\",\n            \"private_key\": \"\u003cprivate key string here\u003e\",\n            ...\n          }\n        CLOUD_PROVIDER_REGION: value1\n        CLOUD_PROVIDER_ZONE: value2\n\n- name: after-update-infra\n  plan:\n  - get: my-staging-network\n    trigger: true\n  - task: do-something-after-rolling-out-network-stack\n    ...\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fringods%2Fpulumi-resource","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fringods%2Fpulumi-resource","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fringods%2Fpulumi-resource/lists"}