Skip to content

Resource Types

Each resource in a pipeline has a type. The resource's type determines what versions are detected, the bits that are fetched when the resource's get step runs, and the side effect that occurs when the resource's put step runs.

Concourse comes with a few "core" resource types to cover common use cases like git and s3 - the rest are developed and supported by the Concourse community. An exhaustive list of all resource types is available in the Resource Types catalog.

A pipeline's resource types are listed under pipeline.resource_types with the following schema:

resource_type schema

name: identifier (required)

The name of the resource type. This should be short and simple. This name will be referenced by pipeline.resources defined within the same pipeline, and task-config.image_resources used by tasks running in the pipeline.

Pipeline-provided resource types can override the core resource types by specifying the same name.

type: resource_type.name | identifier (required)

The type of the resource used to provide the resource type's container image.

This is a bit meta. Usually this value will be registry-image as the resource type must result in a container image.

A resource type's type can refer to other resource types, and can also use the core type that it's overriding. This is useful for bringing in a newer or forked registry-image resource.

source: config (required)

The configuration for the resource type's resource. This varies by resource type, and is a black box to Concourse; it is blindly passed to the resource at runtime.

To use registry-image as an example, the source would contain something like repository: username/reponame. See the Registry Image resource (or whatever resource type your resource type uses) for more information.

privileged: boolean

Default false. If set to true, the resource's containers will be run with full capabilities, as determined by the worker backend the task runs on.

For Linux-based backends it typically determines whether or not the container will run in a separate user namespace, and whether the root user is "actual" root (if set to true) or a user namespaced root (if set to false, the default).

This is a gaping security hole; only configure it if the resource type needs it (which should be called out in its documentation). This is not up to the resource type to decide dynamically, so as to prevent privilege escalation via third-party resource type exploits.

params: config

Arbitrary config to pass when running the get step to fetch the resource type's image. This is equivalent to get step params.

check_every: duration

Default 1m. The interval on which to check for new versions of the resource. Acceptable interval options are defined by the time.ParseDuration function.

tags: [string]

Default []. A list of tags to determine which workers the checks will be performed on. You'll want to specify this if the source is internal to a worker's network, for example. See also tags

defaults: config

The default configuration for the resource type. This varies by resource type, and is a black box to Concourse; it is merged with (duplicate fields are overwritten by) resource.source and passed to the resource at runtime.

Setting default configuration for resources
resource_types:
  - name: gcs
    type: registry-image
    source:
      repository: frodenas/gcs-resource
    defaults:
      json_key: ((default_key))

resources:
  - name: bucket-a
    type: gcs
    source:
      bucket: a

  - name: bucket-b
    type: gcs
    source:
      bucket: b

  - name: bucket-c
    type: gcs
    source:
      bucket: c
      json_key: ((different_key))
Overrides default resource types

Since it's possible to overwrite the base resource types, it can be used to give defaults to resources at the pipeline level.

resource_types:
  - name: registry-image
    type: registry-image
    source:
      repository: concourse/registry-image-resource
    defaults:
      registry_mirror:
        host: https://registry.mirror.example.com

resources:
  - name: mirrored-image
    type: registry-image
    source:
      repository: busybox

Alternatively, the web node can be configured to use defaults for base resource types


Using a rss resource type to subscript to RSS feeds

Resource Types can be used to extend the functionality of your pipeline and provide deeper integrations. This example uses one to trigger a job whenever a new Dinosaur Comic is out.

---
resource_types:
  - name: rss
    type: registry-image
    source:
      repository: suhlig/concourse-rss-resource
      tag: latest

resources:
  - name: booklit-releases
    type: rss
    source:
      url: http://www.qwantz.com/rssfeed.php

jobs:
  - name: announce
    plan:
      - get: booklit-releases
        trigger: true